From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 05:14:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3528C1065670; Sun, 12 Feb 2012 05:14:13 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19DDE8FC13; Sun, 12 Feb 2012 05:14:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1C5ECot066302; Sun, 12 Feb 2012 05:14:12 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1C5ECwC066298; Sun, 12 Feb 2012 05:14:12 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201202120514.q1C5ECwC066298@svn.freebsd.org> From: Max Khon Date: Sun, 12 Feb 2012 05:14: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: r231543 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 05:14:13 -0000 Author: fjoe Date: Sun Feb 12 05:14:12 2012 New Revision: 231543 URL: http://svn.freebsd.org/changeset/base/231543 Log: - Use fixed-width integer types. - Prefer to use C99 stdint types. This fixes ng_cisco on 64-bit architectures. MFC after: 1 week Modified: head/sys/netgraph/ng_cisco.c head/sys/netgraph/ng_cisco.h Modified: head/sys/netgraph/ng_cisco.c ============================================================================== --- head/sys/netgraph/ng_cisco.c Sun Feb 12 05:01:49 2012 (r231542) +++ head/sys/netgraph/ng_cisco.c Sun Feb 12 05:14:12 2012 (r231543) @@ -75,33 +75,33 @@ #define KEEPALIVE_SECS 10 struct cisco_header { - u_char address; - u_char control; - u_short protocol; -}; + uint8_t address; + uint8_t control; + uint16_t protocol; +} __packed; #define CISCO_HEADER_LEN sizeof (struct cisco_header) struct cisco_packet { - u_long type; - u_long par1; - u_long par2; - u_short rel; - u_short time0; - u_short time1; -}; + uint32_t type; + uint32_t par1; + uint32_t par2; + uint16_t rel; + uint16_t time0; + uint16_t time1; +} __packed; #define CISCO_PACKET_LEN (sizeof(struct cisco_packet)) struct protoent { hook_p hook; /* the hook for this proto */ - u_short af; /* address family, -1 = downstream */ + uint16_t af; /* address family, -1 = downstream */ }; struct cisco_priv { - u_long local_seq; - u_long remote_seq; - u_long seqRetries; /* how many times we've been here throwing out + uint32_t local_seq; + uint32_t remote_seq; + uint32_t seqRetries; /* how many times we've been here throwing out * the same sequence number without ack */ node_p node; struct callout handle; @@ -271,7 +271,7 @@ cisco_rcvmsg(node_p node, item_p item, h pos = sprintf(arg, "keepalive period: %d sec; ", KEEPALIVE_SECS); pos += sprintf(arg + pos, - "unacknowledged keepalives: %ld", sc->seqRetries); + "unacknowledged keepalives: %d", sc->seqRetries); resp->header.arglen = pos + 1; break; } @@ -603,7 +603,7 @@ cisco_send(sc_p sc, int type, long par1, struct cisco_packet *ch; struct mbuf *m; struct timeval time; - u_long t; + uint32_t t; int error = 0; getmicrouptime(&time); @@ -626,8 +626,8 @@ cisco_send(sc_p sc, int type, long par1, ch->par1 = htonl(par1); ch->par2 = htonl(par2); ch->rel = -1; - ch->time0 = htons((u_short) (t >> 16)); - ch->time1 = htons((u_short) t); + ch->time0 = htons((uint16_t) (t >> 16)); + ch->time1 = htons((uint16_t) t); NG_SEND_DATA_ONLY(error, sc->downstream.hook, m); return (error); Modified: head/sys/netgraph/ng_cisco.h ============================================================================== --- head/sys/netgraph/ng_cisco.h Sun Feb 12 05:01:49 2012 (r231542) +++ head/sys/netgraph/ng_cisco.h Sun Feb 12 05:14:12 2012 (r231543) @@ -76,8 +76,8 @@ struct ng_cisco_ipaddr { } struct ng_cisco_stats { - u_int32_t seqRetries; /* # unack'd retries */ - u_int32_t keepAlivePeriod; /* in seconds */ + uint32_t seqRetries; /* # unack'd retries */ + uint32_t keepAlivePeriod; /* in seconds */ }; /* Keep this in sync with the above structure definition */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 05:34:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F863106566B; Sun, 12 Feb 2012 05:34:02 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D6B18FC0C; Sun, 12 Feb 2012 05:34:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1C5Y22c066954; Sun, 12 Feb 2012 05:34:02 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1C5Y2S1066951; Sun, 12 Feb 2012 05:34:02 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201202120534.q1C5Y2S1066951@svn.freebsd.org> From: Max Khon Date: Sun, 12 Feb 2012 05:34: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: r231544 - in head: tools/regression/usr.bin/make/execution/joberr usr.bin/make X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 05:34:02 -0000 Author: fjoe Date: Sun Feb 12 05:34:01 2012 New Revision: 231544 URL: http://svn.freebsd.org/changeset/base/231544 Log: Include target names in diagnostic output. Submitted by: Garrett Cooper Modified: head/tools/regression/usr.bin/make/execution/joberr/expected.stdout.1 head/usr.bin/make/job.c Modified: head/tools/regression/usr.bin/make/execution/joberr/expected.stdout.1 ============================================================================== --- head/tools/regression/usr.bin/make/execution/joberr/expected.stdout.1 Sun Feb 12 05:14:12 2012 (r231543) +++ head/tools/regression/usr.bin/make/execution/joberr/expected.stdout.1 Sun Feb 12 05:34:01 2012 (r231544) @@ -1,90 +1,90 @@ Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 +*** [do-check-joberr] Error code 1 Error: build failed -*** Error code 1 -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) -*** Error code 2 (ignored) +*** [do-check-joberr] Error code 1 +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) +*** [check-joberr] Error code 2 (ignored) Modified: head/usr.bin/make/job.c ============================================================================== --- head/usr.bin/make/job.c Sun Feb 12 05:14:12 2012 (r231543) +++ head/usr.bin/make/job.c Sun Feb 12 05:34:01 2012 (r231544) @@ -954,17 +954,19 @@ JobFinish(Job *job, int *status) lastNode = job->node; } fprintf(out, - "*** Completed successfully\n"); + "*** [%s] Completed successfully\n", + job->node->name); } } else { if (usePipes && job->node != lastNode) { MESSAGE(out, job->node); lastNode = job->node; } - fprintf(out, "*** Error code %d%s\n", + fprintf(out, "*** [%s] Error code %d%s\n", + job->node->name, WEXITSTATUS(*status), (job->flags & JOB_IGNERR) ? - "(ignored)" : ""); + " (ignored)" : ""); if (job->flags & JOB_IGNERR) { *status = 0; @@ -1005,7 +1007,8 @@ JobFinish(Job *job, int *status) MESSAGE(out, job->node); lastNode = job->node; } - fprintf(out, "*** Continued\n"); + fprintf(out, "*** [%s] Continued\n", + job->node->name); } if (!(job->flags & JOB_CONTINUING)) { DEBUGF(JOB, ("Warning: process %jd was not " @@ -1029,7 +1032,8 @@ JobFinish(Job *job, int *status) lastNode = job->node; } fprintf(out, - "*** Signal %d\n", WTERMSIG(*status)); + "*** [%s] Signal %d\n", job->node->name, + WTERMSIG(*status)); fflush(out); } } @@ -1056,7 +1060,8 @@ JobFinish(Job *job, int *status) MESSAGE(out, job->node); lastNode = job->node; } - fprintf(out, "*** Stopped -- signal %d\n", WSTOPSIG(*status)); + fprintf(out, "*** [%s] Stopped -- signal %d\n", + job->node->name, WSTOPSIG(*status)); job->flags |= JOB_RESUME; TAILQ_INSERT_TAIL(&stoppedJobs, job, link); fflush(out); @@ -3034,13 +3039,15 @@ Compat_RunCommand(LstNode *cmdNode, GNod if (status == 0) { return (0); } else { - printf("*** Error code %d", status); + printf("*** [%s] Error code %d", + gn->name, status); } } else if (WIFSTOPPED(reason)) { status = WSTOPSIG(reason); } else { status = WTERMSIG(reason); - printf("*** Signal %d", status); + printf("*** [%s] Signal %d", + gn->name, status); } if (ps.errCheck) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 07:45:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 922CA106566B; Sun, 12 Feb 2012 07:45:49 +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 8150B8FC0A; Sun, 12 Feb 2012 07:45:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1C7jnZ8071157; Sun, 12 Feb 2012 07:45:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1C7jnaa071154; Sun, 12 Feb 2012 07:45:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202120745.q1C7jnaa071154@svn.freebsd.org> From: Ed Schouten Date: Sun, 12 Feb 2012 07:45: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: r231549 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 07:45:49 -0000 Author: ed Date: Sun Feb 12 07:45:48 2012 New Revision: 231549 URL: http://svn.freebsd.org/changeset/base/231549 Log: Avoid using BEFORE in the utx rc script. Requested by: dougb Modified: head/etc/rc.d/LOGIN head/etc/rc.d/utx Modified: head/etc/rc.d/LOGIN ============================================================================== --- head/etc/rc.d/LOGIN Sun Feb 12 07:06:45 2012 (r231548) +++ head/etc/rc.d/LOGIN Sun Feb 12 07:45:48 2012 (r231549) @@ -4,7 +4,7 @@ # # PROVIDE: LOGIN -# REQUIRE: DAEMON +# REQUIRE: DAEMON utx # This is a dummy dependency to ensure user services such as xdm, # inetd, cron and kerberos are started after everything else, in case Modified: head/etc/rc.d/utx ============================================================================== --- head/etc/rc.d/utx Sun Feb 12 07:06:45 2012 (r231548) +++ head/etc/rc.d/utx Sun Feb 12 07:45:48 2012 (r231549) @@ -5,7 +5,6 @@ # PROVIDE: utx # REQUIRE: DAEMON cleanvar -# BEFORE: LOGIN # KEYWORD: shutdown . /etc/rc.subr From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 09:19:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF18B106564A; Sun, 12 Feb 2012 09:19:28 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id AA1A88FC0C; Sun, 12 Feb 2012 09:19:28 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id q1C9JQM4077575 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 12 Feb 2012 01:19:27 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4F378475.9050405@freebsd.org> Date: Sun, 12 Feb 2012 01:20:53 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.26) Gecko/20120129 Thunderbird/3.1.18 MIME-Version: 1.0 To: Max Khon References: <201202120514.q1C5ECwC066298@svn.freebsd.org> In-Reply-To: <201202120514.q1C5ECwC066298@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: r231543 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 09:19:29 -0000 On 2/11/12 9:14 PM, Max Khon wrote: > Author: fjoe > Date: Sun Feb 12 05:14:12 2012 > New Revision: 231543 > URL: http://svn.freebsd.org/changeset/base/231543 > > Log: > - Use fixed-width integer types. > - Prefer to use C99 stdint types. nice.. pitty it was written in 96 :-) good work > > This fixes ng_cisco on 64-bit architectures. > > MFC after: 1 week > > Modified: > head/sys/netgraph/ng_cisco.c > head/sys/netgraph/ng_cisco.h > > Modified: head/sys/netgraph/ng_cisco.c > ============================================================================== > --- head/sys/netgraph/ng_cisco.c Sun Feb 12 05:01:49 2012 (r231542) > +++ head/sys/netgraph/ng_cisco.c Sun Feb 12 05:14:12 2012 (r231543) > @@ -75,33 +75,33 @@ > #define KEEPALIVE_SECS 10 > > struct cisco_header { > - u_char address; > - u_char control; > - u_short protocol; > -}; > + uint8_t address; > + uint8_t control; > + uint16_t protocol; > +} __packed; > > #define CISCO_HEADER_LEN sizeof (struct cisco_header) > > struct cisco_packet { > - u_long type; > - u_long par1; > - u_long par2; > - u_short rel; > - u_short time0; > - u_short time1; > -}; > + uint32_t type; > + uint32_t par1; > + uint32_t par2; > + uint16_t rel; > + uint16_t time0; > + uint16_t time1; > +} __packed; > > #define CISCO_PACKET_LEN (sizeof(struct cisco_packet)) > > struct protoent { > hook_p hook; /* the hook for this proto */ > - u_short af; /* address family, -1 = downstream */ > + uint16_t af; /* address family, -1 = downstream */ > }; > > struct cisco_priv { > - u_long local_seq; > - u_long remote_seq; > - u_long seqRetries; /* how many times we've been here throwing out > + uint32_t local_seq; > + uint32_t remote_seq; > + uint32_t seqRetries; /* how many times we've been here throwing out > * the same sequence number without ack */ > node_p node; > struct callout handle; > @@ -271,7 +271,7 @@ cisco_rcvmsg(node_p node, item_p item, h > pos = sprintf(arg, > "keepalive period: %d sec; ", KEEPALIVE_SECS); > pos += sprintf(arg + pos, > - "unacknowledged keepalives: %ld", sc->seqRetries); > + "unacknowledged keepalives: %d", sc->seqRetries); > resp->header.arglen = pos + 1; > break; > } > @@ -603,7 +603,7 @@ cisco_send(sc_p sc, int type, long par1, > struct cisco_packet *ch; > struct mbuf *m; > struct timeval time; > - u_long t; > + uint32_t t; > int error = 0; > > getmicrouptime(&time); > @@ -626,8 +626,8 @@ cisco_send(sc_p sc, int type, long par1, > ch->par1 = htonl(par1); > ch->par2 = htonl(par2); > ch->rel = -1; > - ch->time0 = htons((u_short) (t>> 16)); > - ch->time1 = htons((u_short) t); > + ch->time0 = htons((uint16_t) (t>> 16)); > + ch->time1 = htons((uint16_t) t); > > NG_SEND_DATA_ONLY(error, sc->downstream.hook, m); > return (error); > > Modified: head/sys/netgraph/ng_cisco.h > ============================================================================== > --- head/sys/netgraph/ng_cisco.h Sun Feb 12 05:01:49 2012 (r231542) > +++ head/sys/netgraph/ng_cisco.h Sun Feb 12 05:14:12 2012 (r231543) > @@ -76,8 +76,8 @@ struct ng_cisco_ipaddr { > } > > struct ng_cisco_stats { > - u_int32_t seqRetries; /* # unack'd retries */ > - u_int32_t keepAlivePeriod; /* in seconds */ > + uint32_t seqRetries; /* # unack'd retries */ > + uint32_t keepAlivePeriod; /* in seconds */ > }; > > /* Keep this in sync with the above structure definition */ > > From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 14:54:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6EA8106564A; Sun, 12 Feb 2012 14:54:19 +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 D606E8FC08; Sun, 12 Feb 2012 14:54:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1CEsJf6088956; Sun, 12 Feb 2012 14:54:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1CEsJXV088954; Sun, 12 Feb 2012 14:54:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201202121454.q1CEsJXV088954@svn.freebsd.org> From: Andriy Gapon Date: Sun, 12 Feb 2012 14:54: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: r231558 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 14:54:20 -0000 Author: avg Date: Sun Feb 12 14:54:19 2012 New Revision: 231558 URL: http://svn.freebsd.org/changeset/base/231558 Log: newvers.sh: unbreak git/git-svn support MFC after: 2 weeks Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Sun Feb 12 07:59:25 2012 (r231557) +++ head/sys/conf/newvers.sh Sun Feb 12 14:54:19 2012 (r231558) @@ -92,11 +92,15 @@ for dir in /bin /usr/bin /usr/local/bin; svnversion=${dir}/svnversion break fi - if [ -d "${SYSDIR}/../.git" -a -x "${dir}/git" ] ; then - git_cmd="${dir}/git --git-dir=${SYSDIR}/../.git" - break - fi done +if [ -d "${SYSDIR}/../.git" ] ; then + for dir in /bin /usr/bin /usr/local/bin; do + if [ -x "${dir}/git" ] ; then + git_cmd="${dir}/git --git-dir=${SYSDIR}/../.git" + break + fi + done +fi if [ -n "$svnversion" ] ; then svn=`cd ${SYSDIR} && $svnversion` From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 14:55:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFBA91065672; Sun, 12 Feb 2012 14:55:27 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3DD58FC08; Sun, 12 Feb 2012 14:55:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1CEtRLG089052; Sun, 12 Feb 2012 14:55:27 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1CEtRNU089049; Sun, 12 Feb 2012 14:55:27 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201202121455.q1CEtRNU089049@svn.freebsd.org> From: Robert Millan Date: Sun, 12 Feb 2012 14:55: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: r231559 - in head/sys: amd64/conf conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 14:55:27 -0000 Author: rmh Date: Sun Feb 12 14:55:27 2012 New Revision: 231559 URL: http://svn.freebsd.org/changeset/base/231559 Log: Move WITHOUT_SOURCELESS_* files to sys/conf/ in order to avoid "universe" target processing them as if they were standalone kernel config files. Approved by: kib (mentor) MFC after: 5 days Added: head/sys/conf/WITHOUT_SOURCELESS - copied unchanged from r230972, head/sys/amd64/conf/WITHOUT_SOURCELESS head/sys/conf/WITHOUT_SOURCELESS_HOST - copied unchanged from r230972, head/sys/amd64/conf/WITHOUT_SOURCELESS_HOST head/sys/conf/WITHOUT_SOURCELESS_UCODE - copied unchanged from r230980, head/sys/amd64/conf/WITHOUT_SOURCELESS_UCODE Deleted: head/sys/amd64/conf/WITHOUT_SOURCELESS head/sys/amd64/conf/WITHOUT_SOURCELESS_HOST head/sys/amd64/conf/WITHOUT_SOURCELESS_UCODE head/sys/i386/conf/WITHOUT_SOURCELESS head/sys/i386/conf/WITHOUT_SOURCELESS_HOST head/sys/i386/conf/WITHOUT_SOURCELESS_UCODE Copied: head/sys/conf/WITHOUT_SOURCELESS (from r230972, head/sys/amd64/conf/WITHOUT_SOURCELESS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/WITHOUT_SOURCELESS Sun Feb 12 14:55:27 2012 (r231559, copy of r230972, head/sys/amd64/conf/WITHOUT_SOURCELESS) @@ -0,0 +1,7 @@ +# +# WITHOUT_SOURCELESS -- Disable drivers that include sourceless code. +# +# $FreeBSD$ + +include WITHOUT_SOURCELESS_HOST +include WITHOUT_SOURCELESS_UCODE Copied: head/sys/conf/WITHOUT_SOURCELESS_HOST (from r230972, head/sys/amd64/conf/WITHOUT_SOURCELESS_HOST) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/WITHOUT_SOURCELESS_HOST Sun Feb 12 14:55:27 2012 (r231559, copy of r230972, head/sys/amd64/conf/WITHOUT_SOURCELESS_HOST) @@ -0,0 +1,10 @@ +# +# WITHOUT_SOURCELESS_UCODE -- Disable drivers that include sourceless +# native code for host CPU. +# +# $FreeBSD$ + +nodevice hpt27xx +nodevice hptmv +nodevice hptrr +nodevice nve Copied: head/sys/conf/WITHOUT_SOURCELESS_UCODE (from r230980, head/sys/amd64/conf/WITHOUT_SOURCELESS_UCODE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/WITHOUT_SOURCELESS_UCODE Sun Feb 12 14:55:27 2012 (r231559, copy of r230980, head/sys/amd64/conf/WITHOUT_SOURCELESS_UCODE) @@ -0,0 +1,41 @@ +# +# WITHOUT_SOURCELESS_UCODE -- Disable drivers that include sourceless +# microcode. +# +# $FreeBSD$ + +nodevice adw +nodevice bce +nodevice fatm +nodevice fxp +nodevice ispfw +nodevice mwlfw +nodevice ralfw +nodevice runfw +nodevice sf +nodevice sn +nodevice ti +nodevice txp +nodevice ce +nodevice cp +nodevice ctau +nodevice ipwfw +nodevice iwifw +nodevice iwnfw +nodevice wpifw + +# drm +nodevice mga +nodevice r128 +nodevice radeon + +# sound +nodevice csa +nodevice ds1 +nodevice maestro3 + +# usb +nodevice rum +nodevice uath +nodevice zyd +nodevice kue From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 14:58:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAE531065672; Sun, 12 Feb 2012 14:58:50 +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 99F888FC0C; Sun, 12 Feb 2012 14:58:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1CEwots089306; Sun, 12 Feb 2012 14:58:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1CEwoJS089303; Sun, 12 Feb 2012 14:58:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201202121458.q1CEwoJS089303@svn.freebsd.org> From: Andriy Gapon Date: Sun, 12 Feb 2012 14:58: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: r231563 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 14:58:50 -0000 Author: avg Date: Sun Feb 12 14:58:50 2012 New Revision: 231563 URL: http://svn.freebsd.org/changeset/base/231563 Log: start watchdogd before most of other daemons/servers The main benefit is that watchdogd would shutdown after most of other daemons/servers and thus, for example, would remedy a system hang caused by unlucky X server shutdown. Reviewed by: dougb (earlier version) MFC after: 2 weeks Modified: head/etc/rc.d/SERVERS head/etc/rc.d/watchdogd Modified: head/etc/rc.d/SERVERS ============================================================================== --- head/etc/rc.d/SERVERS Sun Feb 12 14:56:50 2012 (r231562) +++ head/etc/rc.d/SERVERS Sun Feb 12 14:58:50 2012 (r231563) @@ -4,7 +4,7 @@ # # PROVIDE: SERVERS -# REQUIRE: mountcritremote abi ldconfig savecore +# REQUIRE: mountcritremote abi ldconfig savecore watchdogd # This is a dummy dependency, for early-start servers relying on # some basic configuration. Modified: head/etc/rc.d/watchdogd ============================================================================== --- head/etc/rc.d/watchdogd Sun Feb 12 14:56:50 2012 (r231562) +++ head/etc/rc.d/watchdogd Sun Feb 12 14:58:50 2012 (r231563) @@ -28,7 +28,7 @@ # # PROVIDE: watchdogd -# REQUIRE: DAEMON cleanvar +# REQUIRE: FILESYSTEMS cleanvar syslogd # KEYWORD: nojail shutdown . /etc/rc.subr From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 16:43:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 824C21065674; Sun, 12 Feb 2012 16:43:29 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1E2848FC08; Sun, 12 Feb 2012 16:43:28 +0000 (UTC) Received: by iaeo4 with SMTP id o4so3721558iae.13 for ; Sun, 12 Feb 2012 08:43:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=mDqSARexVluEG9V/uYNjEfA4I/bvrIX+/eSWQKb+cYM=; b=Tb5K1ETZd50ra30HfA5GtOc50SVGZAYk6K0BxKoVOT/FqKjHtaeZuZJGAgR8UFWvWh c/wP3wAwTPBAu05441GNiE8EbqxsvGqz+vDn2+JEY4ZOj3VxXnZY6sr5GXA4ROeF5tN/ 8TQ/vThwFFy9UtCVgQs/24YTZRc+bLlu96d44= MIME-Version: 1.0 Received: by 10.50.178.65 with SMTP id cw1mr22558116igc.16.1329065008585; Sun, 12 Feb 2012 08:43:28 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.43.130.201 with HTTP; Sun, 12 Feb 2012 08:43:28 -0800 (PST) In-Reply-To: <4F2CFEE3.6070306@daemonic.se> References: <201202040054.q140siBP012241@svn.freebsd.org> <4F2CFEE3.6070306@daemonic.se> Date: Sun, 12 Feb 2012 16:43:28 +0000 X-Google-Sender-Auth: KxJ6sll-kNDsbL5YieCpewONut8 Message-ID: From: Robert Millan To: Niclas Zeising Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Kostik Belousov , svn-src-all@freebsd.org, src-committers@freebsd.org, Adrian Chadd Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 16:43:29 -0000 El 4 de febrer de 2012 9:48, Niclas Zeising ha escrit= : >> +++ head/sys/amd64/conf/WITHOUT_SOURCELESS_HOST =C2=A0 =C2=A0 =C2=A0 Sat= Feb =C2=A04 00:54:43 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r230972) >> @@ -0,0 +1,10 @@ >> +# >> +# WITHOUT_SOURCELESS_UCODE -- Disable drivers that include sourceless > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0^^^^^ > This seems like a typo. Shouldn't it read HOST instead? Oops, yes of course. Thanks for pointing it out. > Also, can you please regenerate the src.conf manual page? Sure. But as I've never done this before, I don't know the right way to do this. Is it: cd /usr/src/tools/build/options && ./makeman > ../../../share/man/man5/src.conf.5 ? I notice that this command replaces "from FreeBSD" lines with $FreeBSD$. I'm not sure if this is a problem: -.\" from FreeBSD: head/tools/build/options/WITHOUT_WIRELESS 183242 2008-09-21 22:02:26Z sam +.\" $FreeBSD$ From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 16:53:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7A3A1065709; Sun, 12 Feb 2012 16:53:47 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 712BB8FC19; Sun, 12 Feb 2012 16:53:47 +0000 (UTC) Received: by iaeo4 with SMTP id o4so3733537iae.13 for ; Sun, 12 Feb 2012 08:53:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=WWfzBG+s7/VAaPy+nmqe7k+lE/feC9vGyUQMJj/hyNM=; b=SKGq3MLSHOl8yymZJ26pJ1IBgEYamSu5tXpXGF8inp1uNmynRE72M9BCxVqbdWT3Qb vzbhTMK6INDRRs7P2VU3jVX5YpVXej9LLnYAdxvh8DcnYNq++SxcsLQZNmgKh9pI4Vda v2wK8RfwAOZiSO/4m8CJY5p0555sLx8M+0Rc4= MIME-Version: 1.0 Received: by 10.50.178.65 with SMTP id cw1mr22590485igc.16.1329065626228; Sun, 12 Feb 2012 08:53:46 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.43.130.201 with HTTP; Sun, 12 Feb 2012 08:53:46 -0800 (PST) In-Reply-To: <201202061248.43744.jkim@FreeBSD.org> References: <201202040054.q140siBP012241@svn.freebsd.org> <201202061248.43744.jkim@FreeBSD.org> Date: Sun, 12 Feb 2012 16:53:46 +0000 X-Google-Sender-Auth: oBvmsk93oX1zCgKMZsXayd8Ayps Message-ID: From: Robert Millan To: Jung-uk Kim Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , Kostik Belousov , "svn-src-all@freebsd.org" , src-committers@freebsd.org, Adrian Chadd Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 16:53:47 -0000 El 6 de febrer de 2012 17:48, Jung-uk Kim ha escrit: > On Friday 03 February 2012 07:54 pm, Robert Millan wrote: >> +nodevice =C2=A0 =C2=A0 =C2=A0 ti > > Tigon 1 and 2 had open-sourced firmware. =C2=A0In fact, I believe wpaul > developed custom firmware for FreeBSD and the (early?) sources are > still available here: > > http://people.freebsd.org/~wpaul/Alteon/ Well, there's always source somewhere. I just noticed that some of my original intent of this MK knob was blurred when renaming to "MK_SOURCELESS". The part that is relevant to me (I don't know about others, just talking for myself here!) is whether a driver is completely built from source or if a chunk of binary bytes (either uuencode'd or as a C array) is used instead. But of course if source is available we could avoid this debate by just integrating it into the tree :-). Is this something that would be desireable in FreeBSD? I notice there's something similar already (sys/dev/aic7xxx/aicasm). Btw, which would be the appropiate list to discuss this? freebsd-arch? From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 17:44:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 171F71065673; Sun, 12 Feb 2012 17:44:41 +0000 (UTC) (envelope-from zeising@daemonic.se) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 7F6228FC13; Sun, 12 Feb 2012 17:44:40 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id A8BEB40002; Sun, 12 Feb 2012 18:44:38 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 9DD8340006; Sun, 12 Feb 2012 18:44:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (mx.daemonic.se [IPv6:2001:470:dca9:0:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 9473B40002; Sun, 12 Feb 2012 18:44:37 +0100 (CET) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 2830C119C1B; Sun, 12 Feb 2012 18:44:37 +0100 (CET) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([IPv6:2001:470:dca9:0:1::3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [2001:470:dca9:0:1::6]) (amavisd-new, port 10025) with ESMTPS id uBDFuAvlRkHZ; Sun, 12 Feb 2012 18:44:34 +0100 (CET) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2001:470:dca9:0:1::4]) by mx.daemonic.se (Postfix) with ESMTPS id B547A119C17; Sun, 12 Feb 2012 18:44:34 +0100 (CET) Received: from [IPv6:2001:470:dca9:1::4] (vivi.daemonic.se [IPv6:2001:470:dca9:1::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 9DABA12B20D; Sun, 12 Feb 2012 18:44:34 +0100 (CET) Message-ID: <4F37FA7D.4070808@daemonic.se> Date: Sun, 12 Feb 2012 18:44:29 +0100 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: Robert Millan References: <201202040054.q140siBP012241@svn.freebsd.org> <4F2CFEE3.6070306@daemonic.se> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@freebsd.org, Kostik Belousov , svn-src-all@freebsd.org, src-committers@freebsd.org, Adrian Chadd Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 17:44:41 -0000 On 2012-02-12 17:43, Robert Millan wrote: > El 4 de febrer de 2012 9:48, Niclas Zeising ha escrit: >>> +++ head/sys/amd64/conf/WITHOUT_SOURCELESS_HOST Sat Feb 4 00:54:43 2012 (r230972) >>> @@ -0,0 +1,10 @@ >>> +# >>> +# WITHOUT_SOURCELESS_UCODE -- Disable drivers that include sourceless >> ^^^^^ >> This seems like a typo. Shouldn't it read HOST instead? > > Oops, yes of course. Thanks for pointing it out. > >> Also, can you please regenerate the src.conf manual page? > > Sure. But as I've never done this before, I don't know the right way > to do this. Is it: > > cd /usr/src/tools/build/options && ./makeman > > ../../../share/man/man5/src.conf.5 > > ? > > I notice that this command replaces "from FreeBSD" lines with > $FreeBSD$. I'm not sure if this is a problem: > > -.\" from FreeBSD: head/tools/build/options/WITHOUT_WIRELESS 183242 > 2008-09-21 22:02:26Z sam > +.\" $FreeBSD$ I am not 100% sure about how makeman works, but something akin to what you described above seems right. I think the change in the FreeBSD: line depends on if you do it from a svn repo or from a repo updated using cvsup or similar. With that said, I think dim@ already has regenerated src.conf for you, and commited it. Have a look at r231055 Regards! -- Niclas From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 18:29:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A6A61065674; Sun, 12 Feb 2012 18:29:57 +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 804858FC0A; Sun, 12 Feb 2012 18:29:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1CITvuM096018; Sun, 12 Feb 2012 18:29:57 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1CITu63095981; Sun, 12 Feb 2012 18:29:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202121829.q1CITu63095981@svn.freebsd.org> From: Ed Schouten Date: Sun, 12 Feb 2012 18:29: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: r231564 - in head: lib/libc/db/man lib/libc/gen lib/libc/net lib/libc/rpc lib/libc/sys lib/libcam lib/libdevstat lib/libradius sbin/bsdlabel sbin/newfs_msdos share/man/man4 share/man/ma... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 18:29:57 -0000 Author: ed Date: Sun Feb 12 18:29:56 2012 New Revision: 231564 URL: http://svn.freebsd.org/changeset/base/231564 Log: Globally replace u_int*_t from (non-contributed) man pages. The reasoning behind this, is that if we are consistent in our documentation about the uint*_t stuff, people will be less tempted to write new code that uses the non-standard types. I am not going to bump the man page dates, as these changes can be considered style nits. The meaning of the man pages is unaffected. MFC after: 1 month Modified: head/lib/libc/db/man/hash.3 head/lib/libc/gen/arc4random.3 head/lib/libc/net/nsdispatch.3 head/lib/libc/rpc/rpc.3 head/lib/libc/rpc/rpc_clnt_create.3 head/lib/libc/sys/getdirentries.2 head/lib/libc/sys/jail.2 head/lib/libc/sys/nfssvc.2 head/lib/libcam/cam.3 head/lib/libcam/cam_cdbparse.3 head/lib/libdevstat/devstat.3 head/lib/libradius/libradius.3 head/sbin/bsdlabel/bsdlabel.8 head/sbin/newfs_msdos/newfs_msdos.8 head/share/man/man4/agp.4 head/share/man/man4/icmp6.4 head/share/man/man4/ip6.4 head/share/man/man4/mem.4 head/share/man/man4/mtio.4 head/share/man/man4/natm.4 head/share/man/man4/net80211.4 head/share/man/man4/ng_async.4 head/share/man/man4/ng_bridge.4 head/share/man/man4/ng_btsocket.4 head/share/man/man4/ng_car.4 head/share/man/man4/ng_ccatm.4 head/share/man/man4/ng_cisco.4 head/share/man/man4/ng_etf.4 head/share/man/man4/ng_hci.4 head/share/man/man4/ng_l2cap.4 head/share/man/man4/ng_l2tp.4 head/share/man/man4/ng_mppc.4 head/share/man/man4/ng_netflow.4 head/share/man/man4/ng_one2many.4 head/share/man/man4/ng_ppp.4 head/share/man/man4/ng_pppoe.4 head/share/man/man4/ng_pptpgre.4 head/share/man/man4/ppi.4 head/share/man/man5/fs.5 head/share/man/man9/MD5.9 head/share/man/man9/bios.9 head/share/man/man9/bus_space.9 head/share/man/man9/crypto.9 head/share/man/man9/device_set_flags.9 head/share/man/man9/devstat.9 head/share/man/man9/eventtimers.9 head/share/man/man9/get_cyclecount.9 head/share/man/man9/mbchain.9 head/share/man/man9/mbuf_tags.9 head/share/man/man9/mdchain.9 head/share/man/man9/netisr.9 head/share/man/man9/random.9 head/share/man/man9/rijndael.9 head/share/man/man9/zone.9 head/usr.bin/m4/lib/ohash_interval.3 head/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.3 Modified: head/lib/libc/db/man/hash.3 ============================================================================== --- head/lib/libc/db/man/hash.3 Sun Feb 12 14:58:50 2012 (r231563) +++ head/lib/libc/db/man/hash.3 Sun Feb 12 18:29:56 2012 (r231564) @@ -65,7 +65,7 @@ typedef struct { u_int ffactor; u_int nelem; u_int cachesize; - u_int32_t (*hash)(const void *, size_t); + uint32_t (*hash)(const void *, size_t); int lorder; } HASHINFO; .Ed Modified: head/lib/libc/gen/arc4random.3 ============================================================================== --- head/lib/libc/gen/arc4random.3 Sun Feb 12 14:58:50 2012 (r231563) +++ head/lib/libc/gen/arc4random.3 Sun Feb 12 18:29:56 2012 (r231564) @@ -44,12 +44,12 @@ .Lb libc .Sh SYNOPSIS .In stdlib.h -.Ft u_int32_t +.Ft uint32_t .Fn arc4random "void" .Ft void .Fn arc4random_buf "void *buf" "size_t nbytes" -.Ft u_int32_t -.Fn arc4random_uniform "u_int32_t upper_bound" +.Ft uint32_t +.Fn arc4random_uniform "uint32_t upper_bound" .Ft void .Fn arc4random_stir "void" .Ft void Modified: head/lib/libc/net/nsdispatch.3 ============================================================================== --- head/lib/libc/net/nsdispatch.3 Sun Feb 12 14:58:50 2012 (r231563) +++ head/lib/libc/net/nsdispatch.3 Sun Feb 12 18:29:56 2012 (r231564) @@ -129,7 +129,7 @@ structures, which have the following for .Bd -literal -offset indent typedef struct _ns_src { const char *src; - u_int32_t flags; + uint32_t flags; } ns_src; .Ed .Bd -ragged -offset indent Modified: head/lib/libc/rpc/rpc.3 ============================================================================== --- head/lib/libc/rpc/rpc.3 Sun Feb 12 14:58:50 2012 (r231563) +++ head/lib/libc/rpc/rpc.3 Sun Feb 12 18:29:56 2012 (r231564) @@ -119,12 +119,12 @@ file. .Sh Derived Types The derived types used in the RPC interfaces are defined as follows: .Bd -literal - typedef u_int32_t rpcprog_t; - typedef u_int32_t rpcvers_t; - typedef u_int32_t rpcproc_t; - typedef u_int32_t rpcprot_t; - typedef u_int32_t rpcport_t; - typedef int32_t rpc_inline_t; + typedef uint32_t rpcprog_t; + typedef uint32_t rpcvers_t; + typedef uint32_t rpcproc_t; + typedef uint32_t rpcprot_t; + typedef uint32_t rpcport_t; + typedef int32_t rpc_inline_t; .Ed .Sh "Data Structures" Some of the data structures used by the Modified: head/lib/libc/rpc/rpc_clnt_create.3 ============================================================================== --- head/lib/libc/rpc/rpc_clnt_create.3 Sun Feb 12 14:58:50 2012 (r231563) +++ head/lib/libc/rpc/rpc_clnt_create.3 Sun Feb 12 18:29:56 2012 (r231564) @@ -106,10 +106,10 @@ Set the timeout argument to 0 for batchi .It Dv CLGET_FD Ta "int *" Ta "get fd from handle" .It Dv CLSET_FD_CLOSE Ta "void" Ta "close fd on destroy" .It Dv CLSET_FD_NCLOSE Ta void Ta "do not close fd on destroy" -.It Dv CLGET_VERS Ta "u_int32_t *" Ta "get RPC program version" -.It Dv CLSET_VERS Ta "u_int32_t *" Ta "set RPC program version" -.It Dv CLGET_XID Ta "u_int32_t *" Ta "get XID of previous call" -.It Dv CLSET_XID Ta "u_int32_t *" Ta "set XID of next call" +.It Dv CLGET_VERS Ta "uint32_t *" Ta "get RPC program version" +.It Dv CLSET_VERS Ta "uint32_t *" Ta "set RPC program version" +.It Dv CLGET_XID Ta "uint32_t *" Ta "get XID of previous call" +.It Dv CLSET_XID Ta "uint32_t *" Ta "set XID of next call" .El .Pp The following operations are valid for connectionless transports only: Modified: head/lib/libc/sys/getdirentries.2 ============================================================================== --- head/lib/libc/sys/getdirentries.2 Sun Feb 12 14:58:50 2012 (r231563) +++ head/lib/libc/sys/getdirentries.2 Sun Feb 12 18:29:56 2012 (r231564) @@ -71,10 +71,10 @@ The data in the buffer is a series of .Vt dirent structures each containing the following entries: .Bd -literal -offset indent -u_int32_t d_fileno; -u_int16_t d_reclen; -u_int8_t d_type; -u_int8_t d_namlen; +uint32_t d_fileno; +uint16_t d_reclen; +uint8_t d_type; +uint8_t d_namlen; char d_name[MAXNAMELEN + 1]; /* see below */ .Ed .Pp Modified: head/lib/libc/sys/jail.2 ============================================================================== --- head/lib/libc/sys/jail.2 Sun Feb 12 14:58:50 2012 (r231563) +++ head/lib/libc/sys/jail.2 Sun Feb 12 18:29:56 2012 (r231564) @@ -59,7 +59,7 @@ system call sets up a jail and locks the The argument is a pointer to a structure describing the prison: .Bd -literal -offset indent struct jail { - u_int32_t version; + uint32_t version; char *path; char *hostname; char *jailname; Modified: head/lib/libc/sys/nfssvc.2 ============================================================================== --- head/lib/libc/sys/nfssvc.2 Sun Feb 12 14:58:50 2012 (r231563) +++ head/lib/libc/sys/nfssvc.2 Sun Feb 12 18:29:56 2012 (r231564) @@ -143,14 +143,14 @@ and a pointer to a struct nfsd_srvargs { struct nfsd *nsd_nfsd; /* Pointer to in kernel nfsd struct */ uid_t nsd_uid; /* Effective uid mapped to cred */ - u_int32_t nsd_haddr; /* Ip address of client */ + uint32_t nsd_haddr; /* Ip address of client */ struct ucred nsd_cr; /* Cred. uid maps to */ int nsd_authlen; /* Length of auth string (ret) */ u_char *nsd_authstr; /* Auth string (ret) */ int nsd_verflen; /* and the verifier */ u_char *nsd_verfstr; struct timeval nsd_timestamp; /* timestamp from verifier */ - u_int32_t nsd_ttl; /* credential ttl (sec) */ + uint32_t nsd_ttl; /* credential ttl (sec) */ NFSKERBKEY_T nsd_key; /* Session key */ }; .Ed Modified: head/lib/libcam/cam.3 ============================================================================== --- head/lib/libcam/cam.3 Sun Feb 12 14:58:50 2012 (r231563) +++ head/lib/libcam/cam.3 Sun Feb 12 18:29:56 2012 (r231564) @@ -145,7 +145,7 @@ struct cam_device { * Device name given by * the user. */ - u_int32_t given_unit_number; /* + uint32_t given_unit_number; /* * Unit number given by * the user. */ @@ -153,7 +153,7 @@ struct cam_device { * Name of the device, * e.g. 'pass' */ - u_int32_t dev_unit_num; /* Unit number of the passthrough + uint32_t dev_unit_num; /* Unit number of the passthrough * device associated with this * particular device. */ @@ -161,18 +161,18 @@ struct cam_device { char sim_name[SIM_IDLEN+1];/* * Controller name, e.g.'ahc' */ - u_int32_t sim_unit_number; /* Controller unit number */ - u_int32_t bus_id; /* Controller bus number */ + uint32_t sim_unit_number; /* Controller unit number */ + uint32_t bus_id; /* Controller bus number */ lun_id_t target_lun; /* Logical Unit Number */ target_id_t target_id; /* Target ID */ path_id_t path_id; /* System SCSI bus number */ - u_int16_t pd_type; /* type of peripheral device */ + uint16_t pd_type; /* type of peripheral device */ struct scsi_inquiry_data inq_data; /* SCSI Inquiry data */ - u_int8_t serial_num[252]; /* device serial number */ - u_int8_t serial_num_len; /* length of the serial number */ - u_int8_t sync_period; /* Negotiated sync period */ - u_int8_t sync_offset; /* Negotiated sync offset */ - u_int8_t bus_width; /* Negotiated bus width */ + uint8_t serial_num[252]; /* device serial number */ + uint8_t serial_num_len; /* length of the serial number */ + uint8_t sync_period; /* Negotiated sync period */ + uint8_t sync_offset; /* Negotiated sync offset */ + uint8_t bus_width; /* Negotiated bus width */ int fd; /* file descriptor for device */ }; .Ed Modified: head/lib/libcam/cam_cdbparse.3 ============================================================================== --- head/lib/libcam/cam_cdbparse.3 Sun Feb 12 14:58:50 2012 (r231563) +++ head/lib/libcam/cam_cdbparse.3 Sun Feb 12 18:29:56 2012 (r231564) @@ -83,9 +83,9 @@ .Ft int .Fo csio_build .Fa "struct ccb_scsiio *csio" -.Fa "u_int8_t *data_ptr" -.Fa "u_int32_t dxfer_len" -.Fa "u_int32_t flags" +.Fa "uint8_t *data_ptr" +.Fa "uint32_t dxfer_len" +.Fa "uint32_t flags" .Fa "int retry_count" .Fa "int timeout" .Fa "const char *cmd_spec" @@ -94,9 +94,9 @@ .Ft int .Fo csio_build_visit .Fa "struct ccb_scsiio *csio" -.Fa "u_int8_t *data_ptr" -.Fa "u_int32_t dxfer_len" -.Fa "u_int32_t flags" +.Fa "uint8_t *data_ptr" +.Fa "uint32_t dxfer_len" +.Fa "uint32_t flags" .Fa "int retry_count" .Fa "int timeout" .Fa "const char *cmd_spec" @@ -122,14 +122,14 @@ .Fc .Ft int .Fo buff_decode -.Fa "u_int8_t *buff" +.Fa "uint8_t *buff" .Fa "size_t len" .Fa "const char *fmt" .Fa "..." .Fc .Ft int .Fo buff_decode_visit -.Fa "u_int8_t *buff" +.Fa "uint8_t *buff" .Fa "size_t len" .Fa "const char *fmt" .Fa "void (*arg_put)(void *, int, void *, int, char *)" @@ -150,7 +150,7 @@ .Fc .Ft int .Fo buff_encode_visit -.Fa "u_int8_t *buff" +.Fa "uint8_t *buff" .Fa "size_t len" .Fa "const char *fmt" .Fa "int (*arg_get)(void *hook, char *field_name)" Modified: head/lib/libdevstat/devstat.3 ============================================================================== --- head/lib/libdevstat/devstat.3 Sun Feb 12 14:58:50 2012 (r231563) +++ head/lib/libdevstat/devstat.3 Sun Feb 12 18:29:56 2012 (r231564) @@ -193,7 +193,7 @@ subelement contains the following elemen .Bd -literal -offset indent struct devinfo { struct devstat *devices; - u_int8_t *mem_ptr; + uint8_t *mem_ptr; long generation; int numdevs; }; @@ -472,7 +472,7 @@ structure to calculate statistics over For each statistics to be calculated, the user should supply the proper enumerated type (listed below), and a variable of the indicated type. All statistics are either integer values, for which a -.Vt u_int64_t +.Vt uint64_t is used, or floating point, for which a .Vt "long double" @@ -489,7 +489,7 @@ be the last argument passed to It is an argument list terminator. .It Dv DSM_TOTAL_BYTES type: -.Vt "u_int64_t *" +.Vt "uint64_t *" .Pp The total number of bytes transferred between the acquisition of .Fa previous @@ -499,7 +499,7 @@ and .It Dv DSM_TOTAL_BYTES_WRITE .It Dv DSM_TOTAL_BYTES_FREE type: -.Vt "u_int64_t *" +.Vt "uint64_t *" .Pp The total number of bytes in transactions of the specified type between the acquisition of @@ -508,7 +508,7 @@ and .Fa current . .It Dv DSM_TOTAL_TRANSFERS type: -.Vt "u_int64_t *" +.Vt "uint64_t *" .Pp The total number of transfers between the acquisition of .Fa previous @@ -519,7 +519,7 @@ and .It Dv DSM_TOTAL_TRANSFERS_WRITE .It Dv DSM_TOTAL_TRANSFERS_FREE type: -.Vt "u_int64_t *" +.Vt "uint64_t *" .Pp The total number of transactions of the specified type between the acquisition of @@ -528,7 +528,7 @@ and .Fa current . .It Dv DSM_TOTAL_BLOCKS type: -.Vt "u_int64_t *" +.Vt "uint64_t *" .Pp The total number of blocks transferred between the acquisition of .Fa previous @@ -541,7 +541,7 @@ blocksize of 512 bytes will be used in t .It Dv DSM_TOTAL_BLOCKS_WRITE .It Dv DSM_TOTAL_BLOCKS_FREE type: -.Vt "u_int64_t *" +.Vt "uint64_t *" .Pp The total number of blocks of the specified type between the acquisition of .Fa previous @@ -665,7 +665,7 @@ and .Fa current . .It Dv DSM_QUEUE_LENGTH type: -.Vt "u_int64_t *" +.Vt "uint64_t *" .Pp The number of not yet completed transactions at the time when .Fa current Modified: head/lib/libradius/libradius.3 ============================================================================== --- head/lib/libradius/libradius.3 Sun Feb 12 14:58:50 2012 (r231563) +++ head/lib/libradius/libradius.3 Sun Feb 12 18:29:56 2012 (r231564) @@ -51,14 +51,14 @@ .Fn rad_create_response "struct rad_handle *h" "int code" .Ft "struct in_addr" .Fn rad_cvt_addr "const void *data" -.Ft u_int32_t +.Ft uint32_t .Fn rad_cvt_int "const void *data" .Ft char * .Fn rad_cvt_string "const void *data" "size_t len" .Ft int .Fn rad_get_attr "struct rad_handle *h" "const void **data" "size_t *len" .Ft int -.Fn rad_get_vendor_attr "u_int32_t *vendor" "const void **data" "size_t *len" +.Fn rad_get_vendor_attr "uint32_t *vendor" "const void **data" "size_t *len" .Ft int .Fn rad_init_send_request "struct rad_handle *h" "int *fd" "struct timeval *tv" .Ft int @@ -66,7 +66,7 @@ .Ft int .Fn rad_put_attr "struct rad_handle *h" "int type" "const void *data" "size_t len" .Ft int -.Fn rad_put_int "struct rad_handle *h" "int type" "u_int32_t value" +.Fn rad_put_int "struct rad_handle *h" "int type" "uint32_t value" .Ft int .Fn rad_put_string "struct rad_handle *h" "int type" "const char *str" .Ft int @@ -76,7 +76,7 @@ .Ft int .Fn rad_put_vendor_attr "struct rad_handle *h" "int vendor" "int type" "const void *data" "size_t len" .Ft int -.Fn rad_put_vendor_int "struct rad_handle *h" "int vendor" "int type" "u_int32_t value" +.Fn rad_put_vendor_int "struct rad_handle *h" "int vendor" "int type" "uint32_t value" .Ft int .Fn rad_put_vendor_string "struct rad_handle *h" "int vendor" "int type" "const char *str" .Ft ssize_t Modified: head/sbin/bsdlabel/bsdlabel.8 ============================================================================== --- head/sbin/bsdlabel/bsdlabel.8 Sun Feb 12 14:58:50 2012 (r231563) +++ head/sbin/bsdlabel/bsdlabel.8 Sun Feb 12 18:29:56 2012 (r231564) @@ -475,7 +475,7 @@ The kernel device drivers will not allow to be decreased or the offset of a partition to be changed while it is open. .Sh COMPATIBILITY Due to the use of an -.Vt u_int32_t +.Vt uint32_t to store the number of sectors, .Bx labels are restricted to a maximum of 2^32-1 sectors. Modified: head/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.8 Sun Feb 12 14:58:50 2012 (r231563) +++ head/sbin/newfs_msdos/newfs_msdos.8 Sun Feb 12 18:29:56 2012 (r231564) @@ -180,27 +180,27 @@ For reference purposes, this structure i below. .Bd -literal struct bsbpb { - u_int16_t bpbBytesPerSec; /* [-S] bytes per sector */ - u_int8_t bpbSecPerClust; /* [-c] sectors per cluster */ - u_int16_t bpbResSectors; /* [-r] reserved sectors */ - u_int8_t bpbFATs; /* [-n] number of FATs */ - u_int16_t bpbRootDirEnts; /* [-e] root directory entries */ - u_int16_t bpbSectors; /* [-s] total sectors */ - u_int8_t bpbMedia; /* [-m] media descriptor */ - u_int16_t bpbFATsecs; /* [-a] sectors per FAT */ - u_int16_t bpbSecPerTrack; /* [-u] sectors per track */ - u_int16_t bpbHeads; /* [-h] drive heads */ - u_int32_t bpbHiddenSecs; /* [-o] hidden sectors */ - u_int32_t bpbHugeSectors; /* [-s] big total sectors */ + uint16_t bpbBytesPerSec; /* [-S] bytes per sector */ + uint8_t bpbSecPerClust; /* [-c] sectors per cluster */ + uint16_t bpbResSectors; /* [-r] reserved sectors */ + uint8_t bpbFATs; /* [-n] number of FATs */ + uint16_t bpbRootDirEnts; /* [-e] root directory entries */ + uint16_t bpbSectors; /* [-s] total sectors */ + uint8_t bpbMedia; /* [-m] media descriptor */ + uint16_t bpbFATsecs; /* [-a] sectors per FAT */ + uint16_t bpbSecPerTrack; /* [-u] sectors per track */ + uint16_t bpbHeads; /* [-h] drive heads */ + uint32_t bpbHiddenSecs; /* [-o] hidden sectors */ + uint32_t bpbHugeSectors; /* [-s] big total sectors */ }; /* FAT32 extensions */ struct bsxbpb { - u_int32_t bpbBigFATsecs; /* [-a] big sectors per FAT */ - u_int16_t bpbExtFlags; /* control flags */ - u_int16_t bpbFSVers; /* file system version */ - u_int32_t bpbRootClust; /* root directory start cluster */ - u_int16_t bpbFSInfo; /* [-i] file system info sector */ - u_int16_t bpbBackup; /* [-k] backup boot sector */ + uint32_t bpbBigFATsecs; /* [-a] big sectors per FAT */ + uint16_t bpbExtFlags; /* control flags */ + uint16_t bpbFSVers; /* file system version */ + uint32_t bpbRootClust; /* root directory start cluster */ + uint16_t bpbFSInfo; /* [-i] file system info sector */ + uint16_t bpbBackup; /* [-k] backup boot sector */ }; .Ed .Sh LIMITATION Modified: head/share/man/man4/agp.4 ============================================================================== --- head/share/man/man4/agp.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/agp.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -80,8 +80,8 @@ The result is a pointer to the following .Bd -literal typedef struct _agp_info { agp_version version; /* version of the driver */ - u_int32_t bridge_id; /* bridge vendor/device */ - u_int32_t agp_mode; /* mode info of bridge */ + uint32_t bridge_id; /* bridge vendor/device */ + uint32_t agp_mode; /* mode info of bridge */ off_t aper_base; /* base of aperture */ size_t aper_size; /* size of aperture */ size_t pg_total; /* max pages (swap + system) */ @@ -105,7 +105,7 @@ This takes the following structure: .Bd -literal typedef struct _agp_setup { - u_int32_t agp_mode; /* mode info of bridge */ + uint32_t agp_mode; /* mode info of bridge */ } agp_setup; .Ed .Pp @@ -120,8 +120,8 @@ takes the following structure: typedef struct _agp_allocate { int key; /* tag of allocation */ size_t pg_count; /* number of pages */ - u_int32_t type; /* 0 == normal, other devspec */ - u_int32_t physical; /* device specific (some devices + uint32_t type; /* 0 == normal, other devspec */ + uint32_t physical; /* device specific (some devices * need a phys address of the * actual page behind the gatt * table) */ @@ -159,7 +159,7 @@ takes the following structure: .Bd -literal typedef struct _agp_unbind { int key; /* tag of allocation */ - u_int32_t priority; /* priority for paging out */ + uint32_t priority; /* priority for paging out */ } agp_unbind; .Ed .El Modified: head/share/man/man4/icmp6.4 ============================================================================== --- head/share/man/man4/icmp6.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/icmp6.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -140,13 +140,13 @@ This header corresponds to the structure and has the following definition: .Bd -literal -offset indent struct icmp6_hdr { - u_int8_t icmp6_type; /* type field */ - u_int8_t icmp6_code; /* code field */ - u_int16_t icmp6_cksum; /* checksum field */ + uint8_t icmp6_type; /* type field */ + uint8_t icmp6_code; /* code field */ + uint16_t icmp6_cksum; /* checksum field */ union { - u_int32_t icmp6_un_data32[1]; /* type-specific */ - u_int16_t icmp6_un_data16[2]; /* type-specific */ - u_int8_t icmp6_un_data8[4]; /* type-specific */ + uint32_t icmp6_un_data32[1]; /* type-specific */ + uint16_t icmp6_un_data16[2]; /* type-specific */ + uint8_t icmp6_un_data8[4]; /* type-specific */ } icmp6_dataun; } __packed; Modified: head/share/man/man4/ip6.4 ============================================================================== --- head/share/man/man4/ip6.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/ip6.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -75,12 +75,12 @@ The header has the following definition: struct ip6_hdr { union { struct ip6_hdrctl { - u_int32_t ip6_un1_flow; /* 20 bits of flow ID */ - u_int16_t ip6_un1_plen; /* payload length */ - u_int8_t ip6_un1_nxt; /* next header */ - u_int8_t ip6_un1_hlim; /* hop limit */ + uint32_t ip6_un1_flow; /* 20 bits of flow ID */ + uint16_t ip6_un1_plen; /* payload length */ + uint8_t ip6_un1_nxt; /* next header */ + uint8_t ip6_un1_hlim; /* hop limit */ } ip6_un1; - u_int8_t ip6_un2_vfc; /* version and class */ + uint8_t ip6_un2_vfc; /* version and class */ } ip6_ctlun; struct in6_addr ip6_src; /* source address */ struct in6_addr ip6_dst; /* destination address */ @@ -121,8 +121,8 @@ The IPv6 header may be followed by any n with the following generic definition: .Bd -literal -offset indent struct ip6_ext { - u_int8_t ip6e_nxt; - u_int8_t ip6e_len; + uint8_t ip6e_nxt; + uint8_t ip6e_len; } __packed; .Ed .Ss Options @@ -281,8 +281,8 @@ The option is stored in the following st returned: .Bd -literal struct ip6_hbh { - u_int8_t ip6h_nxt; /* next header */ - u_int8_t ip6h_len; /* length in units of 8 octets */ + uint8_t ip6h_nxt; /* next header */ + uint8_t ip6h_len; /* length in units of 8 octets */ /* followed by options */ } __packed; .Ed @@ -301,8 +301,8 @@ The option is stored in the following st returned: .Bd -literal struct ip6_dest { - u_int8_t ip6d_nxt; /* next header */ - u_int8_t ip6d_len; /* length in units of 8 octets */ + uint8_t ip6d_nxt; /* next header */ + uint8_t ip6d_len; /* length in units of 8 octets */ /* followed by options */ } __packed; .Ed @@ -333,10 +333,10 @@ The header is stored in the following st returned: .Bd -literal struct ip6_rthdr { - u_int8_t ip6r_nxt; /* next header */ - u_int8_t ip6r_len; /* length in units of 8 octets */ - u_int8_t ip6r_type; /* routing type */ - u_int8_t ip6r_segleft; /* segments left */ + uint8_t ip6r_nxt; /* next header */ + uint8_t ip6r_len; /* length in units of 8 octets */ + uint8_t ip6r_type; /* routing type */ + uint8_t ip6r_segleft; /* segments left */ /* followed by routing-type-specific data */ } __packed; .Ed Modified: head/share/man/man4/mem.4 ============================================================================== --- head/share/man/man4/mem.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/mem.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -101,8 +101,8 @@ The region cannot be written to. Memory ranges are described by .Vt struct mem_range_desc : .Bd -literal -offset indent -u_int64_t mr_base; /\(** physical base address \(**/ -u_int64_t mr_len; /\(** physical length of region \(**/ +uint64_t mr_base; /\(** physical base address \(**/ +uint64_t mr_len; /\(** physical length of region \(**/ int mr_flags; /\(** attributes of region \(**/ char mr_owner[8]; .Ed Modified: head/share/man/man4/mtio.4 ============================================================================== --- head/share/man/man4/mtio.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/mtio.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -175,7 +175,7 @@ struct mtget { #if defined (__FreeBSD__) int32_t mt_blksiz; /* presently operating blocksize */ int32_t mt_density; /* presently operating density */ - u_int32_t mt_comp; /* presently operating compression */ + uint32_t mt_comp; /* presently operating compression */ int32_t mt_blksiz0; /* blocksize for mode 0 */ int32_t mt_blksiz1; /* blocksize for mode 1 */ int32_t mt_blksiz2; /* blocksize for mode 2 */ @@ -185,10 +185,10 @@ struct mtget { int32_t mt_density2; /* density for mode 2 */ int32_t mt_density3; /* density for mode 3 */ /* the following are not yet implemented */ - u_int32_t mt_comp0; /* compression type for mode 0 */ - u_int32_t mt_comp1; /* compression type for mode 1 */ - u_int32_t mt_comp2; /* compression type for mode 2 */ - u_int32_t mt_comp3; /* compression type for mode 3 */ + uint32_t mt_comp0; /* compression type for mode 0 */ + uint32_t mt_comp1; /* compression type for mode 1 */ + uint32_t mt_comp2; /* compression type for mode 2 */ + uint32_t mt_comp3; /* compression type for mode 3 */ /* end not yet implemented */ #endif int32_t mt_fileno; /* relative file number of current position */ @@ -203,23 +203,23 @@ struct scsi_tape_errors { * Check Condition noted for these operations. The act * of issuing an MTIOCERRSTAT unlatches and clears them. */ - u_int8_t io_sense[32]; /* Last Sense Data For Data I/O */ + uint8_t io_sense[32]; /* Last Sense Data For Data I/O */ int32_t io_resid; /* residual count from last Data I/O */ - u_int8_t io_cdb[16]; /* Command that Caused the Last Data Sense */ - u_int8_t ctl_sense[32]; /* Last Sense Data For Control I/O */ + uint8_t io_cdb[16]; /* Command that Caused the Last Data Sense */ + uint8_t ctl_sense[32]; /* Last Sense Data For Control I/O */ int32_t ctl_resid; /* residual count from last Control I/O */ - u_int8_t ctl_cdb[16]; /* Command that Caused the Last Control Sense */ + uint8_t ctl_cdb[16]; /* Command that Caused the Last Control Sense */ /* * These are the read and write cumulative error counters. * (how to reset cumulative error counters is not yet defined). * (not implemented as yet but space is being reserved for them) */ struct { - u_int32_t retries; /* total # retries performed */ - u_int32_t corrected; /* total # corrections performed */ - u_int32_t processed; /* total # corrections successful */ - u_int32_t failures; /* total # corrections/retries failed */ - u_int64_t nbytes; /* total # bytes processed */ + uint32_t retries; /* total # retries performed */ + uint32_t corrected; /* total # corrections performed */ + uint32_t processed; /* total # corrections successful */ + uint32_t failures; /* total # corrections/retries failed */ + uint64_t nbytes; /* total # bytes processed */ } wterr, rderr; }; @@ -265,18 +265,18 @@ union mterrstat { * rethink these ioctls to support all the entities they haul into * the picture (64 bit blocks, logical file record numbers, etc..). */ -#define MTIOCRDSPOS _IOR('m', 5, u_int32_t) /* get logical blk addr */ -#define MTIOCRDHPOS _IOR('m', 6, u_int32_t) /* get hardware blk addr */ -#define MTIOCSLOCATE _IOW('m', 5, u_int32_t) /* seek to logical blk addr */ -#define MTIOCHLOCATE _IOW('m', 6, u_int32_t) /* seek to hardware blk addr */ +#define MTIOCRDSPOS _IOR('m', 5, uint32_t) /* get logical blk addr */ +#define MTIOCRDHPOS _IOR('m', 6, uint32_t) /* get hardware blk addr */ +#define MTIOCSLOCATE _IOW('m', 5, uint32_t) /* seek to logical blk addr */ +#define MTIOCHLOCATE _IOW('m', 6, uint32_t) /* seek to hardware blk addr */ #define MTIOCERRSTAT _IOR('m', 7, union mterrstat) /* get tape errors */ /* * Set EOT model- argument is number of filemarks to end a tape with. * Note that not all possible values will be accepted. */ -#define MTIOCSETEOTMODEL _IOW('m', 8, u_int32_t) +#define MTIOCSETEOTMODEL _IOW('m', 8, uint32_t) /* Get current EOT model */ -#define MTIOCGETEOTMODEL _IOR('m', 8, u_int32_t) +#define MTIOCGETEOTMODEL _IOR('m', 8, uint32_t) #ifndef _KERNEL #define DEFTAPE "/dev/nsa0" Modified: head/share/man/man4/natm.4 ============================================================================== --- head/share/man/man4/natm.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/natm.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -23,11 +23,11 @@ The NATM layer uses a to specify a virtual circuit: .Bd -literal -offset indent struct sockaddr_natm { - u_int8_t snatm_len; /* length */ - u_int8_t snatm_family; /* AF_NATM */ + uint8_t snatm_len; /* length */ + uint8_t snatm_family; /* AF_NATM */ char snatm_if[IFNAMSIZ]; /* interface name */ - u_int16_t snatm_vci; /* vci */ - u_int8_t snatm_vpi; /* vpi */ + uint16_t snatm_vci; /* vci */ + uint8_t snatm_vpi; /* vpi */ }; .Ed .Pp Modified: head/share/man/man4/net80211.4 ============================================================================== --- head/share/man/man4/net80211.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/net80211.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -64,7 +64,7 @@ This structure is defined as follows: .Bd -literal struct ieee80211req { char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */ - u_int16_t i_type; /* req type */ + uint16_t i_type; /* req type */ int16_t i_val; /* Index or simple value */ int16_t i_len; /* Index or simple value */ void *i_data; /* Extra data */ Modified: head/share/man/man4/ng_async.4 ============================================================================== --- head/share/man/man4/ng_async.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/ng_async.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -118,9 +118,9 @@ Sets the node configuration, which is de .Bd -literal -offset 4n struct ng_async_cfg { u_char enabled; /* Turn encoding on/off */ - u_int16_t amru; /* Max receive async frame len */ - u_int16_t smru; /* Max receive sync frame len */ - u_int32_t accm; /* ACCM encoding */ + uint16_t amru; /* Max receive async frame len */ + uint16_t smru; /* Max receive sync frame len */ + uint32_t accm; /* ACCM encoding */ }; .Ed .Pp Modified: head/share/man/man4/ng_bridge.4 ============================================================================== --- head/share/man/man4/ng_bridge.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/ng_bridge.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -108,9 +108,9 @@ as an argument: struct ng_bridge_config { u_char ipfw[NG_BRIDGE_MAX_LINKS]; /* enable ipfw */ u_char debugLevel; /* debug level */ - u_int32_t loopTimeout; /* link loopback mute time */ - u_int32_t maxStaleness; /* max host age before nuking */ - u_int32_t minStableAge; /* min time for a stable host */ + uint32_t loopTimeout; /* link loopback mute time */ + uint32_t maxStaleness; /* max host age before nuking */ + uint32_t minStableAge; /* min time for a stable host */ }; .Ed .Pp @@ -155,20 +155,20 @@ currently connected: .Bd -literal -offset 0n /* Statistics structure (one for each link) */ struct ng_bridge_link_stats { - u_int64_t recvOctets; /* total octets rec'd on link */ - u_int64_t recvPackets; /* total pkts rec'd on link */ - u_int64_t recvMulticasts; /* multicast pkts rec'd on link */ - u_int64_t recvBroadcasts; /* broadcast pkts rec'd on link */ - u_int64_t recvUnknown; /* pkts rec'd with unknown dest addr */ - u_int64_t recvRunts; /* pkts rec'd less than 14 bytes */ - u_int64_t recvInvalid; /* pkts rec'd with bogus source addr */ - u_int64_t xmitOctets; /* total octets xmit'd on link */ - u_int64_t xmitPackets; /* total pkts xmit'd on link */ - u_int64_t xmitMulticasts; /* multicast pkts xmit'd on link */ - u_int64_t xmitBroadcasts; /* broadcast pkts xmit'd on link */ - u_int64_t loopDrops; /* pkts dropped due to loopback */ - u_int64_t loopDetects; /* number of loop detections */ - u_int64_t memoryFailures; /* times couldn't get mem or mbuf */ + uint64_t recvOctets; /* total octets rec'd on link */ + uint64_t recvPackets; /* total pkts rec'd on link */ + uint64_t recvMulticasts; /* multicast pkts rec'd on link */ + uint64_t recvBroadcasts; /* broadcast pkts rec'd on link */ + uint64_t recvUnknown; /* pkts rec'd with unknown dest addr */ + uint64_t recvRunts; /* pkts rec'd less than 14 bytes */ + uint64_t recvInvalid; /* pkts rec'd with bogus source addr */ + uint64_t xmitOctets; /* total octets xmit'd on link */ + uint64_t xmitPackets; /* total pkts xmit'd on link */ + uint64_t xmitMulticasts; /* multicast pkts xmit'd on link */ + uint64_t xmitBroadcasts; /* broadcast pkts xmit'd on link */ + uint64_t loopDrops; /* pkts dropped due to loopback */ + uint64_t loopDetects; /* number of loop detections */ + uint64_t memoryFailures; /* times couldn't get mem or mbuf */ }; .Ed .It Dv NGM_BRIDGE_CLR_STATS Modified: head/share/man/man4/ng_btsocket.4 ============================================================================== --- head/share/man/man4/ng_btsocket.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/ng_btsocket.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -154,7 +154,7 @@ The Bluetooth L2CAP socket address is de struct sockaddr_l2cap { u_char l2cap_len; /* total length */ u_char l2cap_family; /* address family */ - u_int16_t l2cap_psm; /* Protocol/Service Multiplexor */ + uint16_t l2cap_psm; /* Protocol/Service Multiplexor */ bdaddr_t l2cap_bdaddr; /* address */ }; .Ed @@ -272,7 +272,7 @@ struct sockaddr_rfcomm { u_char rfcomm_len; /* total length */ u_char rfcomm_family; /* address family */ bdaddr_t rfcomm_bdaddr; /* address */ - u_int8_t rfcomm_channel; /* channel */ + uint8_t rfcomm_channel; /* channel */ }; .Ed .Ss Dv SOCK_STREAM Ss RFCOMM sockets Modified: head/share/man/man4/ng_car.4 ============================================================================== --- head/share/man/man4/ng_car.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/ng_car.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -123,15 +123,15 @@ Return current node configuration as .Vt "struct ng_car_bulkconf" .Bd -literal struct ng_car_hookconf { - u_int64_t cbs; /* Committed burst size */ - u_int64_t ebs; /* Exceeded/Peak burst size */ - u_int64_t cir; /* Committed information rate */ - u_int64_t pir; /* Peak information rate */ - u_int8_t green_action; /* Action for green packets */ - u_int8_t yellow_action; /* Action for yellow packets */ - u_int8_t red_action; /* Action for red packets */ - u_int8_t mode; /* operation mode */ - u_int8_t opt; /* mode options */ + uint64_t cbs; /* Committed burst size */ + uint64_t ebs; /* Exceeded/Peak burst size */ + uint64_t cir; /* Committed information rate */ + uint64_t pir; /* Peak information rate */ + uint8_t green_action; /* Action for green packets */ + uint8_t yellow_action; /* Action for yellow packets */ + uint8_t red_action; /* Action for red packets */ + uint8_t mode; /* operation mode */ + uint8_t opt; /* mode options */ }; /* possible actions (..._action) */ @@ -161,12 +161,12 @@ Return node statistics as .Vt "struct ng_car_bulkstats" .Bd -literal struct ng_car_hookstats { - u_int64_t passed_pkts; - u_int64_t droped_pkts; - u_int64_t green_pkts; - u_int64_t yellow_pkts; - u_int64_t red_pkts; - u_int64_t errors; + uint64_t passed_pkts; + uint64_t droped_pkts; + uint64_t green_pkts; + uint64_t yellow_pkts; + uint64_t red_pkts; + uint64_t errors; }; struct ng_car_bulkstats { Modified: head/share/man/man4/ng_ccatm.4 ============================================================================== --- head/share/man/man4/ng_ccatm.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/ng_ccatm.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -110,7 +110,7 @@ The interface on these hooks is defined and uses a structure .Bd -literal struct ccatm_op { - u_int32_t op; /* request code */ + uint32_t op; /* request code */ u_char data[]; /* optional data */ }; .Ed @@ -230,7 +230,7 @@ struct ngm_ccatm_get_addresses { struct ngm_ccatm_address_req addr[0]; }; struct ngm_ccatm_address_req { - u_int32_t port; + uint32_t port; struct uni_addr addr; }; .Ed Modified: head/share/man/man4/ng_cisco.4 ============================================================================== --- head/share/man/man4/ng_cisco.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/ng_cisco.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -148,8 +148,8 @@ Returns a .Dv "struct ngciscostat" : .Bd -literal -offset 4n struct ngciscostat { - u_int32_t seq_retries; /* # unack'd retries */ - u_int32_t keepalive_period; /* in seconds */ + uint32_t seq_retries; /* # unack'd retries */ + uint32_t keepalive_period; /* in seconds */ }; .Ed .El Modified: head/share/man/man4/ng_etf.4 ============================================================================== --- head/share/man/man4/ng_etf.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/ng_etf.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -102,7 +102,7 @@ are specified in a structure of type .Bd -literal -offset 4n struct ng_etffilter { char matchhook[NG_HOOKSIZ]; /* hook name */ - u_int16_t ethertype; /* catch these */ + uint16_t ethertype; /* catch these */ }; .Ed .El Modified: head/share/man/man4/ng_hci.4 ============================================================================== --- head/share/man/man4/ng_hci.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/ng_hci.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -133,9 +133,9 @@ The next sections specify the HCI packet .Bd -literal -offset indent #define NG_HCI_CMD_PKT 0x01 typedef struct { - u_int8_t type; /* MUST be 0x1 */ - u_int16_t opcode; /* OpCode */ - u_int8_t length; /* parameter(s) length in bytes */ + uint8_t type; /* MUST be 0x1 */ + uint16_t opcode; /* OpCode */ + uint8_t length; /* parameter(s) length in bytes */ } __attribute__ ((packed)) ng_hci_cmd_pkt_t; .Ed .Pp @@ -156,9 +156,9 @@ Controller to the Host. .Bd -literal -offset indent #define NG_HCI_EVENT_PKT 0x04 typedef struct { - u_int8_t type; /* MUST be 0x4 */ - u_int8_t event; /* event */ - u_int8_t length; /* parameter(s) length in bytes */ + uint8_t type; /* MUST be 0x4 */ + uint8_t event; /* event */ + uint8_t length; /* parameter(s) length in bytes */ } __attribute__ ((packed)) ng_hci_event_pkt_t; .Ed .Pp @@ -168,9 +168,9 @@ when events occur. .Bd -literal -offset indent #define NG_HCI_ACL_DATA_PKT 0x02 typedef struct { - u_int8_t type; /* MUST be 0x2 */ - u_int16_t con_handle; /* connection handle + PB + BC flags */ - u_int16_t length; /* payload length in bytes */ + uint8_t type; /* MUST be 0x2 */ + uint16_t con_handle; /* connection handle + PB + BC flags */ + uint16_t length; /* payload length in bytes */ } __attribute__ ((packed)) ng_hci_acldata_pkt_t; .Ed .Pp @@ -180,9 +180,9 @@ Host Controller. .Bd -literal -offset indent #define NG_HCI_SCO_DATA_PKT 0x03 typedef struct { - u_int8_t type; /* MUST be 0x3 */ - u_int16_t con_handle; /* connection handle + reserved bits */ - u_int8_t length; /* payload length in bytes */ + uint8_t type; /* MUST be 0x3 */ + uint16_t con_handle; /* connection handle + reserved bits */ + uint8_t length; /* payload length in bytes */ } __attribute__ ((packed)) ng_hci_scodata_pkt_t; .Ed .Pp @@ -216,9 +216,9 @@ Netgraph message defined as follows. .Bd -literal -offset indent #define NGM_HCI_NODE_UP 112 /* HCI -> Upper */ typedef struct { - u_int16_t pkt_size; /* max. ACL/SCO packet size (w/o hdr) */ - u_int16_t num_pkts; /* ACL/SCO packet queue size */ - u_int16_t reserved; /* place holder */ + uint16_t pkt_size; /* max. ACL/SCO packet size (w/o hdr) */ + uint16_t num_pkts; /* ACL/SCO packet queue size */ + uint16_t reserved; /* place holder */ bdaddr_t bdaddr; /* bdaddr */ } ng_hci_node_up_ep; .Ed @@ -244,8 +244,8 @@ Netgraph message is defined as follows. .Bd -literal -offset indent #define NGM_HCI_SYNC_CON_QUEUE 113 /* HCI -> Upper */ typedef struct { - u_int16_t con_handle; /* connection handle */ - u_int16_t completed; /* number of completed packets */ + uint16_t con_handle; /* connection handle */ + uint16_t completed; /* number of completed packets */ } ng_hci_sync_con_queue_ep; .Ed .Sh HOOKS Modified: head/share/man/man4/ng_l2cap.4 ============================================================================== --- head/share/man/man4/ng_l2cap.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/ng_l2cap.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -310,9 +310,9 @@ appropriate upstream hook and must be pr .Bd -literal -offset indent /* L2CA data packet header */ typedef struct { - u_int32_t token; /* token to use in L2CAP_L2CA_WRITE */ - u_int16_t length; /* length of the data */ - u_int16_t lcid; /* local channel ID */ + uint32_t token; /* token to use in L2CAP_L2CA_WRITE */ + uint16_t length; /* length of the data */ + uint16_t lcid; /* local channel ID */ } __attribute__ ((packed)) ng_l2cap_l2ca_hdr_t; .Ed .Pp Modified: head/share/man/man4/ng_l2tp.4 ============================================================================== --- head/share/man/man4/ng_l2tp.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/ng_l2tp.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -115,11 +115,11 @@ as an argument: struct ng_l2tp_config { u_char enabled; /* enables traffic flow */ u_char match_id; /* tunnel id must match 'tunnel_id' */ - u_int16_t tunnel_id; /* local tunnel id */ - u_int16_t peer_id; /* peer's tunnel id */ - u_int16_t peer_win; /* peer's max recv window size */ - u_int16_t rexmit_max; /* max retransmits before failure */ - u_int16_t rexmit_max_to; /* max delay between retransmits */ + uint16_t tunnel_id; /* local tunnel id */ + uint16_t peer_id; /* peer's tunnel id */ + uint16_t peer_win; /* peer's max recv window size */ + uint16_t rexmit_max; /* max retransmits before failure */ + uint16_t rexmit_max_to; /* max delay between retransmits */ }; .Ed .Pp @@ -197,8 +197,8 @@ The argument is a .Bd -literal /* Configuration for a session hook */ struct ng_l2tp_sess_config { - u_int16_t session_id; /* local session id */ - u_int16_t peer_id; /* peer's session id */ + uint16_t session_id; /* local session id */ + uint16_t peer_id; /* peer's session id */ u_char control_dseq; /* we control data sequencing? */ u_char enable_dseq; /* enable data sequencing? */ u_char include_length; /* include length field? */ Modified: head/share/man/man4/ng_mppc.4 ============================================================================== --- head/share/man/man4/ng_mppc.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/ng_mppc.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -106,7 +106,7 @@ as an argument: /* Configuration for a session */ struct ng_mppc_config { u_char enable; /* enable */ - u_int32_t bits; /* config bits */ + uint32_t bits; /* config bits */ u_char startkey[MPPE_KEY_LEN]; /* start key */ }; Modified: head/share/man/man4/ng_netflow.4 ============================================================================== --- head/share/man/man4/ng_netflow.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/ng_netflow.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -148,8 +148,8 @@ This message requires as an argument: .Bd -literal -offset 4n struct ng_netflow_setifindex { - u_int16_t iface; /* which iface to operate on */ - u_int16_t index; /* new index */ + uint16_t iface; /* which iface to operate on */ + uint16_t index; /* new index */ }; .Ed .Pp @@ -175,8 +175,8 @@ This message requires as an argument: .Bd -literal -offset 4n struct ng_netflow_setconfig { - u_int16_t iface; - u_int32_t conf; + uint16_t iface; + uint32_t conf; #define NG_NETFLOW_CONF_INGRESS 1 #define NG_NETFLOW_CONF_EGRESS 2 #define NG_NETFLOW_CONF_ONCE 4 Modified: head/share/man/man4/ng_one2many.4 ============================================================================== --- head/share/man/man4/ng_one2many.4 Sun Feb 12 14:58:50 2012 (r231563) +++ head/share/man/man4/ng_one2many.4 Sun Feb 12 18:29:56 2012 (r231564) @@ -156,8 +156,8 @@ as the control message argument: .Bd -literal *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 19:07:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB56D1065672; Sun, 12 Feb 2012 19:07:02 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8F7848FC08; Sun, 12 Feb 2012 19:07:01 +0000 (UTC) Received: by bkcjg1 with SMTP id jg1so3809988bkc.13 for ; Sun, 12 Feb 2012 11:07:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=yWd4/SAMWKnjdB0vuNovleOsBWl43gnnDD453zuuKcc=; b=AS1ynaQCnZjxacjcCa0buzg4BMf2MYMTTI0nL1QK1+VKq1QmiagsHCdoyy/LhlVc6F CwdI0J5FrbKYfkZdEUZvsQerEnsWPdVQpMY4yYObIaEiMeghuHAq8NKARJ18I8GeWJXt amNB5/DUJPeM5DOJVr+i+1rBOx4oEkKuNQOTo= Received: by 10.204.10.91 with SMTP id o27mr5842916bko.17.1329073620697; Sun, 12 Feb 2012 11:07:00 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id jc4sm38621743bkc.7.2012.02.12.11.06.57 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 12 Feb 2012 11:06:58 -0800 (PST) From: Mikolaj Golub To: Andrey Zonov References: <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> <86sjihsln4.fsf@kopusha.home.net> <4F365C10.5050607@zonov.org> X-Comment-To: Andrey Zonov Sender: Mikolaj Golub Date: Sun, 12 Feb 2012 21:06:55 +0200 In-Reply-To: <4F365C10.5050607@zonov.org> (Andrey Zonov's message of "Sat, 11 Feb 2012 16:16:16 +0400") Message-ID: <861upz6fcg.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 19:07:03 -0000 On Sat, 11 Feb 2012 16:16:16 +0400 Andrey Zonov wrote: AZ> On 11.02.2012 14:35, Mikolaj Golub wrote: >> >> Thank you. Here are the patches I would like to commit if there are no >> objections or other suggestions: >> >> http://people.freebsd.org/~trociny/daemon/daemon.spawn.1.patch >> http://people.freebsd.org/~trociny/daemon/daemon.SIGTERM.1.patch >> http://people.freebsd.org/~trociny/daemon/daemon.restart.1.patch The restart patch has been updated: the variable initialization was lost when separting the patches. http://people.freebsd.org/~trociny/daemon/daemon.restart.2.patch >> AZ> There are two more suggestions, if you don't mind. AZ> Use madvise(MADV_PROTECT). It would be useful because of the AZ> daemon(8) should not leak or eats much memory. I also thought about this and it looks like a good idea for me too. http://people.freebsd.org/~trociny/daemon/daemon.madvise.1.patch AZ> Check return code from pidfile_write() function. I saw many times AZ> when pid could not be written because of there is not enough free AZ> space (but file was created). Unfortunately, I have no suggestions AZ> how to handle this properly. We could return with error in this case (for me this almost the same as if we don't create file at all). But if we check pidfile_write() status we should resign the pidfile_write() feature that allows to pass NULL pidfh and check if pidfile option is used. Something like in this patch: http://people.freebsd.org/~trociny/daemon/daemon.pidfile_write.1.patch Not sure I should commit this though. -- Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 19:29:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61B74106566B; Sun, 12 Feb 2012 19:29:35 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CBBC8FC16; Sun, 12 Feb 2012 19:29:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1CJTZFP097885; Sun, 12 Feb 2012 19:29:35 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1CJTZ7d097882; Sun, 12 Feb 2012 19:29:35 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201202121929.q1CJTZ7d097882@svn.freebsd.org> From: Robert Millan Date: Sun, 12 Feb 2012 19:29: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: r231565 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 19:29:35 -0000 Author: rmh Date: Sun Feb 12 19:29:34 2012 New Revision: 231565 URL: http://svn.freebsd.org/changeset/base/231565 Log: Fix a typo. Approved by: kib (mentor) Reported by: lwhsu, Niclas Zeising MFC after: 5 days Modified: head/sys/conf/WITHOUT_SOURCELESS_HOST Modified: head/sys/conf/WITHOUT_SOURCELESS_HOST ============================================================================== --- head/sys/conf/WITHOUT_SOURCELESS_HOST Sun Feb 12 18:29:56 2012 (r231564) +++ head/sys/conf/WITHOUT_SOURCELESS_HOST Sun Feb 12 19:29:34 2012 (r231565) @@ -1,5 +1,5 @@ # -# WITHOUT_SOURCELESS_UCODE -- Disable drivers that include sourceless +# WITHOUT_SOURCELESS_HOST -- Disable drivers that include sourceless # native code for host CPU. # # $FreeBSD$ From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 19:49:23 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 110F3106566C; Sun, 12 Feb 2012 19:49:23 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id B13528FC0A; Sun, 12 Feb 2012 19:49:22 +0000 (UTC) Received: from localhost.samsco.home (pooker.samsco.org [168.103.85.57]) (authenticated bits=0) by pooker.samsco.org (8.14.5/8.14.5) with ESMTP id q1CJnGcD034353; Sun, 12 Feb 2012 12:49:16 -0700 (MST) (envelope-from scottl@samsco.org) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Scott Long In-Reply-To: <201202121455.q1CEtRNU089049@svn.freebsd.org> Date: Sun, 12 Feb 2012 12:49:16 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <15AE59C7-99D6-43F2-A3E8-9A4349E5E9CF@samsco.org> References: <201202121455.q1CEtRNU089049@svn.freebsd.org> To: Robert Millan X-Mailer: Apple Mail (2.1251.1) X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231559 - in head/sys: amd64/conf conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 19:49:23 -0000 On Feb 12, 2012, at 7:55 AM, Robert Millan wrote: > Author: rmh > Date: Sun Feb 12 14:55:27 2012 > New Revision: 231559 > URL: http://svn.freebsd.org/changeset/base/231559 >=20 > Log: > Move WITHOUT_SOURCELESS_* files to sys/conf/ in order to avoid = "universe" > target processing them as if they were standalone kernel config files. Thanks, these were an eyesore in the arch directories. They're still an = eyesore, but less of one now. Scott From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 20:04:16 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 368D6106566B; Sun, 12 Feb 2012 20:04:16 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id D1C028FC0C; Sun, 12 Feb 2012 20:04:15 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 1D06F3BF; Sun, 12 Feb 2012 21:04:13 +0100 (CET) Date: Sun, 12 Feb 2012 21:02:53 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120212200253.GC1355@garage.freebsd.pl> References: <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> <86sjihsln4.fsf@kopusha.home.net> <4F365C10.5050607@zonov.org> <861upz6fcg.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ctP54qlpMx3WjD+/" Content-Disposition: inline In-Reply-To: <861upz6fcg.fsf@kopusha.home.net> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 20:04:16 -0000 --ctP54qlpMx3WjD+/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 12, 2012 at 09:06:55PM +0200, Mikolaj Golub wrote: > AZ> Check return code from pidfile_write() function. I saw many times > AZ> when pid could not be written because of there is not enough free > AZ> space (but file was created). Unfortunately, I have no suggestions > AZ> how to handle this properly. >=20 > We could return with error in this case (for me this almost the same as i= f we > don't create file at all). But if we check pidfile_write() status we shou= ld > resign the pidfile_write() feature that allows to pass NULL pidfh and che= ck if > pidfile option is used. Something like in this patch: >=20 > http://people.freebsd.org/~trociny/daemon/daemon.pidfile_write.1.patch >=20 > Not sure I should commit this though. Please don't. Even if you can't write the pidfile, you should run the service. The same as for pidfile_open() failure as documented in example. Feel free to warn about problem with writing to pidfile, but don't treat it as critial error. We can also add such a warning to the example in the manual page. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --ctP54qlpMx3WjD+/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk84Gu0ACgkQForvXbEpPzS2ZwCfbUTLJTsB/Fw+k2x2BkoFORC4 WyMAn3+qZ7yh/iYGFvpGYO1CzRAqdvhq =eHFr -----END PGP SIGNATURE----- --ctP54qlpMx3WjD+/-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 20:09:39 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49A07106564A; Sun, 12 Feb 2012 20:09:39 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id E56B38FC13; Sun, 12 Feb 2012 20:09:37 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 8FE733C4; Sun, 12 Feb 2012 21:09:36 +0100 (CET) Date: Sun, 12 Feb 2012 21:08:17 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120212200817.GD1355@garage.freebsd.pl> References: <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> <86sjihsln4.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8w3uRX/HFJGApMzv" Content-Disposition: inline In-Reply-To: <86sjihsln4.fsf@kopusha.home.net> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 20:09:39 -0000 --8w3uRX/HFJGApMzv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 11, 2012 at 12:35:27PM +0200, Mikolaj Golub wrote: > Thank you. Here are the patches I would like to commit if there are no > objections or other suggestions: >=20 > http://people.freebsd.org/~trociny/daemon/daemon.spawn.1.patch The patch looks good to me. I'd just fix style nit: please compare 'pidfile' with NULL, don't treat it as bool. > http://people.freebsd.org/~trociny/daemon/daemon.SIGTERM.1.patch > http://people.freebsd.org/~trociny/daemon/daemon.restart.1.patch I'd prefer not to be listed in 'Discussed by' for those two patches. As I said before, I'm not convinced those are desired functionalities. I don't object strongly against them, but having my name there suggests we reached some consensus and we didn't:) --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --8w3uRX/HFJGApMzv Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk84HDEACgkQForvXbEpPzRy3gCfVbdVfvLGKgmSjNovx4uwvwcK tVkAoKp2ItXL2dEvG3S0PTR8wH+KZcww =RhjG -----END PGP SIGNATURE----- --8w3uRX/HFJGApMzv-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 20:49:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFEE11065678; Sun, 12 Feb 2012 20:49:45 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id A34568FC13; Sun, 12 Feb 2012 20:49:45 +0000 (UTC) Received: by pbcxa7 with SMTP id xa7so3507160pbc.13 for ; Sun, 12 Feb 2012 12:49:45 -0800 (PST) Received: by 10.68.73.103 with SMTP id k7mr39714604pbv.132.1329079314789; Sun, 12 Feb 2012 12:41:54 -0800 (PST) Received: from [10.254.254.77] (ppp95-165-146-120.pppoe.spdop.ru. [95.165.146.120]) by mx.google.com with ESMTPS id w4sm34550485pbf.4.2012.02.12.12.41.50 (version=SSLv3 cipher=OTHER); Sun, 12 Feb 2012 12:41:53 -0800 (PST) Message-ID: <4F38240B.5040507@zonov.org> Date: Mon, 13 Feb 2012 00:41:47 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> <86sjihsln4.fsf@kopusha.home.net> <4F365C10.5050607@zonov.org> <861upz6fcg.fsf@kopusha.home.net> <20120212200253.GC1355@garage.freebsd.pl> In-Reply-To: <20120212200253.GC1355@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQn5AKDjWqjKHiPVUhMaH3zMfCptaZcaeWqJSAN4kcRruv8BWKN++p0tpNKw+8dbqQssBJHT Cc: Mikolaj Golub , Guy Helmer , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 20:49:46 -0000 On 13.02.2012 0:02, Pawel Jakub Dawidek wrote: > On Sun, Feb 12, 2012 at 09:06:55PM +0200, Mikolaj Golub wrote: >> AZ> Check return code from pidfile_write() function. I saw many times >> AZ> when pid could not be written because of there is not enough free >> AZ> space (but file was created). Unfortunately, I have no suggestions >> AZ> how to handle this properly. >> >> We could return with error in this case (for me this almost the same as if we >> don't create file at all). But if we check pidfile_write() status we should >> resign the pidfile_write() feature that allows to pass NULL pidfh and check if >> pidfile option is used. Something like in this patch: >> >> http://people.freebsd.org/~trociny/daemon/daemon.pidfile_write.1.patch >> >> Not sure I should commit this though. > > Please don't. Even if you can't write the pidfile, you should run the > service. The same as for pidfile_open() failure as documented in > example. Feel free to warn about problem with writing to pidfile, but > don't treat it as critial error. The problem is the following you cannot stop such a service with standard rc.d script and empty pidfile. > > We can also add such a warning to the example in the manual page. > -- Andrey Zonov From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 20:56:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D150106566C; Sun, 12 Feb 2012 20:56:59 +0000 (UTC) (envelope-from jos@catnook.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8509B8FC13; Sun, 12 Feb 2012 20:56:58 +0000 (UTC) Received: by obcwo16 with SMTP id wo16so7690935obc.13 for ; Sun, 12 Feb 2012 12:56:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.60.12.103 with SMTP id x7mr3239577oeb.51.1329080218121; Sun, 12 Feb 2012 12:56:58 -0800 (PST) Received: by 10.182.116.33 with HTTP; Sun, 12 Feb 2012 12:56:58 -0800 (PST) In-Reply-To: <4F38240B.5040507@zonov.org> References: <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> <86sjihsln4.fsf@kopusha.home.net> <4F365C10.5050607@zonov.org> <861upz6fcg.fsf@kopusha.home.net> <20120212200253.GC1355@garage.freebsd.pl> <4F38240B.5040507@zonov.org> Date: Sun, 12 Feb 2012 12:56:58 -0800 Message-ID: From: Jos Backus To: Andrey Zonov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Guy Helmer , svn-src-all@freebsd.org, Mikolaj Golub , svn-src-head@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 20:56:59 -0000 On Sun, Feb 12, 2012 at 12:41 PM, Andrey Zonov wrote: > On 13.02.2012 0:02, Pawel Jakub Dawidek wrote: >> >> On Sun, Feb 12, 2012 at 09:06:55PM +0200, Mikolaj Golub wrote: >>> >>> =A0AZ> =A0Check return code from pidfile_write() function. =A0I saw man= y times >>> =A0AZ> =A0when pid could not be written because of there is not enough = free >>> =A0AZ> =A0space (but file was created). =A0Unfortunately, I have no sug= gestions >>> =A0AZ> =A0how to handle this properly. >>> >>> We could return with error in this case (for me this almost the same as >>> if we >>> don't create file at all). But if we check pidfile_write() status we >>> should >>> resign the pidfile_write() feature that allows to pass NULL pidfh and >>> check if >>> pidfile option is used. Something like in this patch: >>> >>> http://people.freebsd.org/~trociny/daemon/daemon.pidfile_write.1.patch >>> >>> Not sure I should commit this though. >> >> >> Please don't. Even if you can't write the pidfile, you should run the >> service. The same as for pidfile_open() failure as documented in >> example. Feel free to warn about problem with writing to pidfile, but >> don't treat it as critial error. > > > The problem is the following you cannot stop such a service with standard > rc.d script and empty pidfile. Right. So why not add a Unix socket listener to daemon(8) so the rc.d script can send commands over the socket instead of using the pidfile? This is what supervise/svc let you do today. I don't understand why this solution isn't obvious once you are committed to running daemon(8) for each service anyway. And then you don't need pidfiles because now you have a much better, standard control interface (sending commands to daemon(8) and gathering responses). Jos >> >> We can also add such a warning to the example in the manual page. >> > > -- > Andrey Zonov > > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" --=20 Jos Backus jos at catnook.com From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 21:17:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B28A106564A; Sun, 12 Feb 2012 21:17:08 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id BA1A08FC12; Sun, 12 Feb 2012 21:17:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.4/8.14.4) with ESMTP id q1CKuL5M039081; Mon, 13 Feb 2012 00:56:21 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Mon, 13 Feb 2012 00:56:21 +0400 (MSK) From: Dmitry Morozovsky To: Andrey Zonov In-Reply-To: <4F38240B.5040507@zonov.org> Message-ID: References: <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> <86sjihsln4.fsf@kopusha.home.net> <4F365C10.5050607@zonov.org> <861upz6fcg.fsf@kopusha.home.net> <20120212200253.GC1355@garage.freebsd.pl> <4F38240B.5040507@zonov.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (woozle.rinet.ru [0.0.0.0]); Mon, 13 Feb 2012 00:56:22 +0400 (MSK) Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Guy Helmer , svn-src-all@freebsd.org, Mikolaj Golub , svn-src-head@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 21:17:08 -0000 On Mon, 13 Feb 2012, Andrey Zonov wrote: [snip] > > Please don't. Even if you can't write the pidfile, you should run the > > service. The same as for pidfile_open() failure as documented in > > example. Feel free to warn about problem with writing to pidfile, but > > don't treat it as critial error. > > The problem is the following you cannot stop such a service with standard rc.d > script and empty pidfile. As for me, unstoppable (via standard way) service is at least slightly better than unstartable. -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 21:32:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 805281065670; Sun, 12 Feb 2012 21:32:24 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 30ADF8FC0C; Sun, 12 Feb 2012 21:32:23 +0000 (UTC) Received: by bkcjg1 with SMTP id jg1so3865242bkc.13 for ; Sun, 12 Feb 2012 13:32:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=VjReZXRHGN70AEGbCNzZ7HU5OiOPkyO7OL3KPHzEF8g=; b=d7xfKwsQmeajUHWTkcY4qwDzaPKplFsuOK605HFekFbdU7tMBkzPRBDcGKgy1C79YB FLYKxQl3hF/Ncz/cmb+ATTQ1kVwf/v2/MJgDU1N3s7dXawNLUo1DPWa1A1apl3NziKFU 4lm04bhdT8e/3C4ysoPCQxU1ifq8Mke+Uyybc= Received: by 10.204.152.88 with SMTP id f24mr5846328bkw.31.1329082342266; Sun, 12 Feb 2012 13:32:22 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id ez5sm39498248bkc.15.2012.02.12.13.32.19 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 12 Feb 2012 13:32:21 -0800 (PST) From: Mikolaj Golub To: Jos Backus References: <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> <86sjihsln4.fsf@kopusha.home.net> <4F365C10.5050607@zonov.org> <861upz6fcg.fsf@kopusha.home.net> <20120212200253.GC1355@garage.freebsd.pl> <4F38240B.5040507@zonov.org> X-Comment-To: Jos Backus Sender: Mikolaj Golub Date: Sun, 12 Feb 2012 23:32:17 +0200 In-Reply-To: (Jos Backus's message of "Sun, 12 Feb 2012 12:56:58 -0800") Message-ID: <86wr7r4u1q.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Guy Helmer , svn-src-all@freebsd.org, Andrey Zonov , svn-src-head@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 21:32:24 -0000 On Sun, 12 Feb 2012 12:56:58 -0800 Jos Backus wrote: JB> Right. So why not add a Unix socket listener to daemon(8) so the rc.d JB> script can send commands over the socket instead of using the pidfile? JB> This is what supervise/svc let you do today. JB> I don't understand why this solution isn't obvious once you are JB> committed to running daemon(8) for each service anyway. And then you JB> don't need pidfiles because now you have a much better, standard JB> control interface (sending commands to daemon(8) and gathering JB> responses). Why do you think one is committed to running daemon(8) for each service? daemon(8) is for a program that can't daemonize itself and you want an easy way to run it detached from a terminal. And have an easy way to integrate it in rc(8) using rc.subr(8). And rc.subr(8) knows about pidfiles but knows nothing about unix sockets. Although I don't say that the idea to use a socket file for monitoring and control is bad in general. -- Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 22:37:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C68D106566B; Sun, 12 Feb 2012 22:37:11 +0000 (UTC) (envelope-from jos@catnook.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 566778FC14; Sun, 12 Feb 2012 22:37:10 +0000 (UTC) Received: by obcwo16 with SMTP id wo16so7759319obc.13 for ; Sun, 12 Feb 2012 14:37:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.47.37 with SMTP id a5mr9804227obn.41.1329086229951; Sun, 12 Feb 2012 14:37:09 -0800 (PST) Received: by 10.182.116.33 with HTTP; Sun, 12 Feb 2012 14:37:09 -0800 (PST) Received: by 10.182.116.33 with HTTP; Sun, 12 Feb 2012 14:37:09 -0800 (PST) In-Reply-To: <86wr7r4u1q.fsf@kopusha.home.net> References: <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> <86sjihsln4.fsf@kopusha.home.net> <4F365C10.5050607@zonov.org> <861upz6fcg.fsf@kopusha.home.net> <20120212200253.GC1355@garage.freebsd.pl> <4F38240B.5040507@zonov.org> <86wr7r4u1q.fsf@kopusha.home.net> Date: Sun, 12 Feb 2012 14:37:09 -0800 Message-ID: From: Jos Backus To: Mikolaj Golub X-Gm-Message-State: ALoCoQn+ugJNH6lgk/EV86J1965QwWHXA/GkKp8KOTIua0q2QS1KPVvnL+VeEIT4AJQVw3Ofj0cM Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Guy Helmer , svn-src-all@freebsd.org, Andrey Zonov , svn-src-head@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 22:37:11 -0000 On Feb 12, 2012 1:32 PM, "Mikolaj Golub" wrote: > > > On Sun, 12 Feb 2012 12:56:58 -0800 Jos Backus wrote: > > JB> Right. So why not add a Unix socket listener to daemon(8) so the rc.d > JB> script can send commands over the socket instead of using the pidfile? > JB> This is what supervise/svc let you do today. > > JB> I don't understand why this solution isn't obvious once you are > JB> committed to running daemon(8) for each service anyway. And then you > JB> don't need pidfiles because now you have a much better, standard > JB> control interface (sending commands to daemon(8) and gathering > JB> responses). > > Why do you think one is committed to running daemon(8) for each service? > daemon(8) is for a program that can't daemonize itself and you want an easy > way to run it detached from a terminal. And have an easy way to integrate it > in rc(8) using rc.subr(8). And rc.subr(8) knows about pidfiles but knows > nothing about unix sockets. I realize that. But ISTR someone mentioned earlier keeping daemon(8) running to keep the pidfile open or something to that effect. > > Although I don't say that the idea to use a socket file for monitoring and > control is bad in general. Right. This approach has a number of benefits. I emailed the daemontools- encore author about including it in FreeBSD but so far he hasn't responded. Jos > > -- > Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Sun Feb 12 23:18:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABE3E106564A; Sun, 12 Feb 2012 23:18:05 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 964C68FC0C; Sun, 12 Feb 2012 23:18:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1CNI5KY005367; Sun, 12 Feb 2012 23:18:05 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1CNI5YQ005365; Sun, 12 Feb 2012 23:18:05 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201202122318.q1CNI5YQ005365@svn.freebsd.org> From: Brooks Davis Date: Sun, 12 Feb 2012 23:18: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: r231568 - head/usr.sbin/periodic X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Feb 2012 23:18:05 -0000 Author: brooks Date: Sun Feb 12 23:18:05 2012 New Revision: 231568 URL: http://svn.freebsd.org/changeset/base/231568 Log: Prevent periodic scripts that run longer than the expected period from starting up before the previous script finishes. This prevents an infinite number of them from piling up and slowing a system down. Since all the refactoring to make this happen required churning the indenting of most of this file, make the indentation more consistent. Reviewed by: simon MFC after: 1 week Modified: head/usr.sbin/periodic/periodic.sh Modified: head/usr.sbin/periodic/periodic.sh ============================================================================== --- head/usr.sbin/periodic/periodic.sh Sun Feb 12 23:12:47 2012 (r231567) +++ head/usr.sbin/periodic/periodic.sh Sun Feb 12 23:18:05 2012 (r231568) @@ -14,6 +14,18 @@ usage () { exit 1 } +output_pipe() +{ + # Where's our output going ? + eval output=\$${1##*/}_output + case "$output" in + /*) pipe="cat >>$output";; + "") pipe=cat;; + *) pipe="mail -E -s '$host ${1##*/} run output' $output";; + esac + eval $pipe +} + if [ $# -lt 1 ] ; then usage fi @@ -27,83 +39,102 @@ fi host=`hostname` export host + +# If we were called normally, then create a lock file for each argument +# in turn and reinvoke ourselves with the LOCKED argument. This prevents +# very long running jobs from being overlapped by another run as this is +# will lead the system running progressivly slower and more and more jobs +# are run at once. +if [ $1 != "LOCKED" ]; then + ret=0 + for arg; do + lockfile=/var/run/periodic.${arg##*/}.lock + lockf -t 0 "${lockfile}" /bin/sh $0 LOCKED "$arg" + case $? in + 0) ;; + 73) #EX_CANTCREATE + echo "can't create ${lockfile}" | output_pipe $arg + ret=1 + ;; + 75) #EX_TEMPFAIL + echo "$host ${arg##*/} prior run still in progress" | \ + output_pipe $arg + ret=1 + ;; + *) + ret=1 + ;; + esac + done + exit $ret +fi + +if [ $# -ne 2 ]; then + usage +fi +shift +arg=$1 + tmp_output=`mktemp ${TMPDIR:-/tmp}/periodic.XXXXXXXXXX` # Execute each executable file in the directory list. If the x bit is not # set, assume the user didn't really want us to muck with it (it's a # README file or has been disabled). -for arg -do - # Where's our output going ? - eval output=\$${arg##*/}_output - case "$output" in - /*) pipe="cat >>$output";; - "") pipe=cat;; - *) pipe="mail -E -s '$host ${arg##*/} run output' $output";; +success=YES info=YES badconfig=NO empty_output=YES # Defaults when ${run}_* aren't YES/NO +for var in success info badconfig empty_output; do + case $(eval echo "\$${arg##*/}_show_$var") in + [Yy][Ee][Ss]) eval $var=YES;; + [Nn][Oo]) eval $var=NO;; esac +done - success=YES info=YES badconfig=NO empty_output=YES # Defaults when ${run}_* aren't YES/NO - for var in success info badconfig empty_output - do - case $(eval echo "\$${arg##*/}_show_$var") in - [Yy][Ee][Ss]) eval $var=YES;; - [Nn][Oo]) eval $var=NO;; - esac +case $arg in +/*) if [ -d "$arg" ]; then + dirlist="$arg" + else + echo "$0: $arg not found" >&2 + continue + fi + ;; +*) dirlist= + for top in /etc/periodic ${local_periodic}; do + [ -d $top/$arg ] && dirlist="$dirlist $top/$arg" done + ;; +esac - case $arg in - /*) if [ -d "$arg" ] - then - dirlist="$arg" - else - echo "$0: $arg not found" >&2 - continue - fi;; - *) dirlist= - for top in /etc/periodic ${local_periodic} - do - [ -d $top/$arg ] && dirlist="$dirlist $top/$arg" - done;; - esac - - { - empty=TRUE - processed=0 - for dir in $dirlist - do - for file in $dir/* - do - if [ -x $file -a ! -d $file ] - then - output=TRUE - processed=$(($processed + 1)) - $file $tmp_output 2>&1 - rc=$? - if [ -s $tmp_output ] - then - case $rc in - 0) [ $success = NO ] && output=FALSE;; - 1) [ $info = NO ] && output=FALSE;; - 2) [ $badconfig = NO ] && output=FALSE;; - esac - [ $output = TRUE ] && { cat $tmp_output; empty=FALSE; } - fi - cp /dev/null $tmp_output +{ + empty=TRUE + processed=0 + for dir in $dirlist; do + for file in $dir/*; do + if [ -x $file -a ! -d $file ]; then + output=TRUE + processed=$(($processed + 1)) + $file $tmp_output 2>&1 + rc=$? + if [ -s $tmp_output ]; then + case $rc in + 0) [ $success = NO ] && output=FALSE;; + 1) [ $info = NO ] && output=FALSE;; + 2) [ $badconfig = NO ] && output=FALSE;; + esac + [ $output = TRUE ] && { cat $tmp_output; empty=FALSE; } fi - done + cp /dev/null $tmp_output + fi done - if [ $empty = TRUE ] - then - if [ $empty_output = TRUE ] - then + done + if [ $empty = TRUE ]; then + if [ $empty_output = TRUE ]; then [ $processed = 1 ] && plural= || plural=s echo "No output from the $processed file$plural processed" - fi - else - echo "" - echo "-- End of $arg output --" fi - } | eval $pipe -done + else + echo "" + echo "-- End of $arg output --" + fi +} | output_pipe ${arg} + rm -f $tmp_output From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 00:28:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABF5F1065670; Mon, 13 Feb 2012 00:28:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A9E58FC13; Mon, 13 Feb 2012 00:28:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1D0SfAJ007694; Mon, 13 Feb 2012 00:28:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1D0SfsB007692; Mon, 13 Feb 2012 00:28:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202130028.q1D0SfsB007692@svn.freebsd.org> From: Adrian Chadd Date: Mon, 13 Feb 2012 00:28: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: r231571 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 00:28:41 -0000 Author: adrian Date: Mon Feb 13 00:28:41 2012 New Revision: 231571 URL: http://svn.freebsd.org/changeset/base/231571 Log: Attempt to address some potential vap->iv_bss race conditions. There are unfortunately a number of situations where vap->iv_bss is changed or freed by some code in net80211. Because multiple threads can concurrently be doing work (and the vap->iv_bss access isn't at all done behind any kind of lock), it's quite possible that: * a change will occur in one thread - eg, by a call through ieee80211_sta_join1(); * a state change occurs in another thread - eg an RX is scheduled in the ath tasklet and it calls ieee80211_input_mimo_all(), which does dereference vap->iv_bss; * these two executing concurrently, causing things to explode. Another instance is ath_beacon_alloc() which takes an ieee80211_node *. It's called with the vap->iv_bss node from ath_newstate(). If the node has changed in the meantime (say it's been freed elsewhere) the reference that it grabbed _before_ refcounting it may be stale. I would _prefer_ that these sorts of things were serialised somewhere but that may be a bit much to ask. Instead, the best we can (currently) hope is that the underlying bss node is still (somewhat) valid. There is a related PR (kern/164382) described by the first case above. That should be fixed by properly serialising the RX path and reset path so an RX can't occur at the same time as the vap free/shutdown path. This is inspired by some related fixes in r212127. PR: kern/165060 Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Feb 12 23:48:39 2012 (r231570) +++ head/sys/dev/ath/if_ath.c Mon Feb 13 00:28:41 2012 (r231571) @@ -1669,6 +1669,7 @@ ath_bmiss_vap(struct ieee80211vap *vap) struct ath_softc *sc = ifp->if_softc; u_int64_t lastrx = sc->sc_lastrx; u_int64_t tsf = ath_hal_gettsf64(sc->sc_ah); + /* XXX should take a locked ref to iv_bss */ u_int bmisstimeout = vap->iv_bmissthreshold * vap->iv_bss->ni_intval * 1024; @@ -3245,7 +3246,7 @@ ath_beacon_config(struct ath_softc *sc, if (vap == NULL) vap = TAILQ_FIRST(&ic->ic_vaps); /* XXX */ - ni = vap->iv_bss; + ni = ieee80211_ref_node(vap->iv_bss); /* extract tstamp from last beacon and convert to TU */ nexttbtt = TSF_TO_TU(LE_READ_4(ni->ni_tstamp.data + 4), @@ -3415,6 +3416,7 @@ ath_beacon_config(struct ath_softc *sc, ath_beacon_start_adhoc(sc, vap); } sc->sc_syncbeacon = 0; + ieee80211_free_node(ni); #undef FUDGE #undef TSF_TO_TU } @@ -3853,6 +3855,7 @@ ath_recv_mgmt(struct ieee80211_node *ni, switch (subtype) { case IEEE80211_FC0_SUBTYPE_BEACON: /* update rssi statistics for use by the hal */ + /* XXX unlocked check against vap->iv_bss? */ ATH_RSSI_LPF(sc->sc_halstats.ns_avgbrssi, rssi); if (sc->sc_syncbeacon && ni == vap->iv_bss && vap->iv_state == IEEE80211_S_RUN) { @@ -5721,7 +5724,7 @@ ath_newstate(struct ieee80211vap *vap, e taskqueue_unblock(sc->sc_tq); } - ni = vap->iv_bss; + ni = ieee80211_ref_node(vap->iv_bss); rfilt = ath_calcrxfilter(sc); stamode = (vap->iv_opmode == IEEE80211_M_STA || vap->iv_opmode == IEEE80211_M_AHDEMO || @@ -5752,7 +5755,8 @@ ath_newstate(struct ieee80211vap *vap, e if (nstate == IEEE80211_S_RUN) { /* NB: collect bss node again, it may have changed */ - ni = vap->iv_bss; + ieee80211_free_node(ni); + ni = ieee80211_ref_node(vap->iv_bss); DPRINTF(sc, ATH_DEBUG_STATE, "%s(RUN): iv_flags 0x%08x bintvl %d bssid %s " @@ -5875,6 +5879,7 @@ ath_newstate(struct ieee80211vap *vap, e #endif } bad: + ieee80211_free_node(ni); return error; } @@ -5893,6 +5898,7 @@ ath_setup_stationkey(struct ieee80211_no struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; ieee80211_keyix keyix, rxkeyix; + /* XXX should take a locked ref to vap->iv_bss */ if (!ath_key_alloc(vap, &ni->ni_ucastkey, &keyix, &rxkeyix)) { /* * Key cache is full; we'll fall back to doing @@ -6448,6 +6454,7 @@ ath_tdma_config(struct ath_softc *sc, st return; } } + /* XXX should take a locked ref to iv_bss */ tp = vap->iv_bss->ni_txparms; /* * Calculate the guard time for each slot. This is the @@ -6697,6 +6704,7 @@ ath_tdma_beacon_send(struct ath_softc *s * Record local TSF for our last send for use * in arbitrating slot collisions. */ + /* XXX should take a locked ref to iv_bss */ vap->iv_bss->ni_tstamp.tsf = ath_hal_gettsf64(ah); } } From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 01:33:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBD6B106566C; Mon, 13 Feb 2012 01:33:39 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6ED38FC0A; Mon, 13 Feb 2012 01:33:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1D1Xdo2009789; Mon, 13 Feb 2012 01:33:39 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1D1XdDP009787; Mon, 13 Feb 2012 01:33:39 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201202130133.q1D1XdDP009787@svn.freebsd.org> From: Kirk McKusick Date: Mon, 13 Feb 2012 01:33: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: r231572 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 01:33:40 -0000 Author: mckusick Date: Mon Feb 13 01:33:39 2012 New Revision: 231572 URL: http://svn.freebsd.org/changeset/base/231572 Log: Missing conditions in checking whether an inode has been written. Found and tested by: Peter Holm MFC after: 2 weeks (to 9 only) Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Feb 13 00:28:41 2012 (r231571) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Feb 13 01:33:39 2012 (r231572) @@ -7161,13 +7161,16 @@ check_inode_unwritten(inodedep) mtx_assert(&lk, MA_OWNED); if ((inodedep->id_state & (DEPCOMPLETE | UNLINKED)) != 0 || + !LIST_EMPTY(&inodedep->id_dirremhd) || !LIST_EMPTY(&inodedep->id_pendinghd) || !LIST_EMPTY(&inodedep->id_bufwait) || !LIST_EMPTY(&inodedep->id_inowait) || + !TAILQ_EMPTY(&inodedep->id_inoreflst) || !TAILQ_EMPTY(&inodedep->id_inoupdt) || !TAILQ_EMPTY(&inodedep->id_newinoupdt) || !TAILQ_EMPTY(&inodedep->id_extupdt) || !TAILQ_EMPTY(&inodedep->id_newextupdt) || + !TAILQ_EMPTY(&inodedep->id_freeblklst) || inodedep->id_mkdiradd != NULL || inodedep->id_nlinkdelta != 0) return (0); From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 01:44:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B3A4106564A; Mon, 13 Feb 2012 01:44:13 +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 463D38FC08; Mon, 13 Feb 2012 01:44:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1D1iD7a010139; Mon, 13 Feb 2012 01:44:13 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1D1iD4X010137; Mon, 13 Feb 2012 01:44:13 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202130144.q1D1iD4X010137@svn.freebsd.org> From: Ed Maste Date: Mon, 13 Feb 2012 01:44: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: r231573 - head/sys/dev/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 01:44:13 -0000 Author: emaste Date: Mon Feb 13 01:44:12 2012 New Revision: 231573 URL: http://svn.freebsd.org/changeset/base/231573 Log: Fix panic after "WARNING - ATA_IDENTIFY taskqueue timeout" When performing a firmware upgrade via atacontrol[1] the subsequent command may time out producing the error message above. When this happens the callout could still be active, and the system would then panic due to a destroyed semaphore. Instead, ensure that the callout is done first, via callout_drain. Note that this fix applies to the "old" ata(4) and so isn't applicable to the default configuration in HEAD. It is still applicable to stable/8. [1] http://lists.freebsd.org/pipermail/freebsd-current/2012-January/031122.html Submitted by: Nima Misaghian Reviewed by: rstone, attilio, mav Obtained from: SVOS MFC after: 3 days Modified: head/sys/dev/ata/ata-queue.c Modified: head/sys/dev/ata/ata-queue.c ============================================================================== --- head/sys/dev/ata/ata-queue.c Mon Feb 13 01:33:39 2012 (r231572) +++ head/sys/dev/ata/ata-queue.c Mon Feb 13 01:44:12 2012 (r231573) @@ -112,6 +112,7 @@ ata_queue_request(struct ata_request *re ATA_DEBUG_RQ(request, "wait for completion"); if (!dumping && sema_timedwait(&request->done, request->timeout * hz * 4)) { + callout_drain(&request->callout); device_printf(request->dev, "WARNING - %s taskqueue timeout " "- completing request directly\n", From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 06:20:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A2D71065672; Mon, 13 Feb 2012 06:20:50 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id B07768FC12; Mon, 13 Feb 2012 06:20:48 +0000 (UTC) Received: by bkcjg1 with SMTP id jg1so4087454bkc.13 for ; Sun, 12 Feb 2012 22:20:47 -0800 (PST) Received: by 10.204.152.25 with SMTP id e25mr5428036bkw.49.1329114047667; Sun, 12 Feb 2012 22:20:47 -0800 (PST) Received: from [10.254.254.77] (ppp95-165-146-120.pppoe.spdop.ru. [95.165.146.120]) by mx.google.com with ESMTPS id cz3sm42974110bkb.3.2012.02.12.22.20.46 (version=SSLv3 cipher=OTHER); Sun, 12 Feb 2012 22:20:47 -0800 (PST) Message-ID: <4F38ABBD.7080502@zonov.org> Date: Mon, 13 Feb 2012 10:20:45 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Dmitry Morozovsky References: <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> <86sjihsln4.fsf@kopusha.home.net> <4F365C10.5050607@zonov.org> <861upz6fcg.fsf@kopusha.home.net> <20120212200253.GC1355@garage.freebsd.pl> <4F38240B.5040507@zonov.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkfxKeoDkIm4+Cksj/K8jl8n5S3ilQlthjX0oe84R1y7L9zaPxsCmiR+vrKdAeHKI8q6L8i Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Guy Helmer , svn-src-all@freebsd.org, Mikolaj Golub , svn-src-head@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 06:20:50 -0000 On 13.02.2012 0:56, Dmitry Morozovsky wrote: > On Mon, 13 Feb 2012, Andrey Zonov wrote: > > [snip] > >>> Please don't. Even if you can't write the pidfile, you should run the >>> service. The same as for pidfile_open() failure as documented in >>> example. Feel free to warn about problem with writing to pidfile, but >>> don't treat it as critial error. >> >> The problem is the following you cannot stop such a service with standard rc.d >> script and empty pidfile. > > As for me, unstoppable (via standard way) service is at least slightly better > than unstartable. > OK, another solution for this problem is do not automatically remove pidfile when pidfile_write() fails. I can explain this. Sometimes daemons crash and I want to restart them. I use cron for this purpose like this: */5 * * * * root /usr/local/etc/rc.d/mydaemon status > /dev/null || /usr/local/etc/rc.d/mydaemon start and if mydaemon doesn't listen any socket or pidfile_write() fails and remove pidfile (it doesn't hold lock on it, in fact) mydaemon will start. If you have other solution -- welcome. -- Andrey Zonov From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 07:47:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3E88106564A; Mon, 13 Feb 2012 07:47:16 +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 C89098FC0A; Mon, 13 Feb 2012 07:47:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1D7lG4a022656; Mon, 13 Feb 2012 07:47:16 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1D7lGUB022654; Mon, 13 Feb 2012 07:47:16 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201202130747.q1D7lGUB022654@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 13 Feb 2012 07:47: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: r231575 - head/etc/devd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 07:47:17 -0000 Author: hselasky Date: Mon Feb 13 07:47:16 2012 New Revision: 231575 URL: http://svn.freebsd.org/changeset/base/231575 Log: Re-generate /etc/devd/usb.conf MFC after: 1 day Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Mon Feb 13 07:30:42 2012 (r231574) +++ head/etc/devd/usb.conf Mon Feb 13 07:47:16 2012 (r231575) @@ -157,7 +157,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0403"; - match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; + match "product" "(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xa6d0|0xa6d0|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82)"; action "kldload uftdi"; }; @@ -293,7 +293,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0411"; - match "product" "(0x0148|0x0150|0x015d|0x016f)"; + match "product" "(0x0148|0x0150|0x015d|0x016f|0x01a2)"; action "kldload if_run"; }; @@ -1021,7 +1021,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x05c6"; - match "product" "(0x6000|0x6613)"; + match "product" "(0x1000|0x6000|0x6613)"; action "kldload u3g"; }; @@ -1301,7 +1301,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0789"; - match "product" "(0x0162|0x0163|0x0164)"; + match "product" "(0x0162|0x0163|0x0164|0x0166)"; action "kldload if_run"; }; @@ -2093,7 +2093,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0b95"; - match "product" "(0x1720|0x1780|0x7720|0x772a|0x772b)"; + match "product" "(0x1720|0x1780|0x7720|0x772a|0x772b|0x7e2b)"; action "kldload if_axe"; }; @@ -4205,6 +4205,15 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "intclass" "0x02"; + match "intsubclass" "0x02"; + match "intprotocol" "0xff"; + action "kldload umodem"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "intclass" "0x03"; match "intsubclass" "0x01"; match "intprotocol" "0x01"; @@ -4327,5 +4336,5 @@ nomatch 32 { action "kldload umass"; }; -# 1645 USB entries processed +# 1652 USB entries processed From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 07:47:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47AB2106564A; Mon, 13 Feb 2012 07:47:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B8BB8FC13; Mon, 13 Feb 2012 07:47:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1D7lbRc022702; Mon, 13 Feb 2012 07:47:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1D7lajK022699; Mon, 13 Feb 2012 07:47:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202130747.q1D7lajK022699@svn.freebsd.org> From: Adrian Chadd Date: Mon, 13 Feb 2012 07:47: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: r231576 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 07:47:37 -0000 Author: adrian Date: Mon Feb 13 07:47:36 2012 New Revision: 231576 URL: http://svn.freebsd.org/changeset/base/231576 Log: Correct the 802.11s mesh configuration structure and related tidbits. * Change the mesh IE size to be IEEE80211_MESH_CONF_SZ rather than the size of the structure; * conf_cap is now a uint8_t rather than a uint16_t (uint16_t in D3.0, uint8_t in the amendment spec); * Update mesh config capability bits - earlier bits were from draft X, current is amendment spec; * Update the following to be an enum rather than #define and added a VENDOR entry too from the amendment spec; IEEE80211_MESHCONF_PATH_* IEEE80211_MESHCONF_METRIC_* IEEE80211_MESHCONF_CC_* IEEE80211_MESHCONF_SYNC_* IEEE80211_MESHCONF_AUTH_* * Kept IEEE80211_MESHCONF_FORM_* and IEEE80211_MESHCONF_CAP_* as defines because they are defined in a way that we need to mask in/out information; * In IEEE80211_MESHCONF_CAP_* IEEE80211_MESHCONF_CAP_TBTTA is removed and 0x80 is made reserved as defined in the amendment spec. Submitted by: monthadar@gmail.com Reviewed by: rpaulo Modified: head/sys/net80211/ieee80211_mesh.c head/sys/net80211/ieee80211_mesh.h Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Mon Feb 13 07:47:16 2012 (r231575) +++ head/sys/net80211/ieee80211_mesh.c Mon Feb 13 07:47:36 2012 (r231576) @@ -2289,7 +2289,6 @@ mesh_verify_meshconf(struct ieee80211vap const struct ieee80211_meshconf_ie *meshconf = (const struct ieee80211_meshconf_ie *) ie; const struct ieee80211_mesh_state *ms = vap->iv_mesh; - uint16_t cap; if (meshconf == NULL) return 1; @@ -2323,10 +2322,8 @@ mesh_verify_meshconf(struct ieee80211vap meshconf->conf_pselid); return 1; } - /* NB: conf_cap is only read correctly here */ - cap = LE_READ_2(&meshconf->conf_cap); /* Not accepting peers */ - if (!(cap & IEEE80211_MESHCONF_CAP_AP)) { + if (!(meshconf->conf_cap & IEEE80211_MESHCONF_CAP_AP)) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH, "not accepting peers: 0x%x\n", meshconf->conf_cap); return 1; @@ -2395,7 +2392,7 @@ ieee80211_add_meshconf(uint8_t *frm, str KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a MBSS vap")); *frm++ = IEEE80211_ELEMID_MESHCONF; - *frm++ = sizeof(struct ieee80211_meshconf_ie) - 2; + *frm++ = IEEE80211_MESH_CONF_SZ; *frm++ = ms->ms_ppath->mpp_ie; /* path selection */ *frm++ = ms->ms_pmetric->mpm_ie; /* link metric */ *frm++ = IEEE80211_MESHCONF_CC_DISABLED; @@ -2411,7 +2408,7 @@ ieee80211_add_meshconf(uint8_t *frm, str caps |= IEEE80211_MESHCONF_CAP_AP; if (ms->ms_flags & IEEE80211_MESHFLAGS_FWD) caps |= IEEE80211_MESHCONF_CAP_FWRD; - ADDSHORT(frm, caps); + *frm++ = caps; return frm; } Modified: head/sys/net80211/ieee80211_mesh.h ============================================================================== --- head/sys/net80211/ieee80211_mesh.h Mon Feb 13 07:47:16 2012 (r231575) +++ head/sys/net80211/ieee80211_mesh.h Mon Feb 13 07:47:36 2012 (r231576) @@ -40,6 +40,7 @@ * 802.11s Information Elements. */ /* Mesh Configuration */ +#define IEEE80211_MESH_CONF_SZ (7) struct ieee80211_meshconf_ie { uint8_t conf_ie; /* IEEE80211_ELEMID_MESHCONF */ uint8_t conf_len; @@ -49,31 +50,66 @@ struct ieee80211_meshconf_ie { uint8_t conf_syncid; /* Sync. Protocol ID */ uint8_t conf_authid; /* Auth. Protocol ID */ uint8_t conf_form; /* Formation Information */ - uint16_t conf_cap; + uint8_t conf_cap; } __packed; /* Hybrid Wireless Mesh Protocol */ -#define IEEE80211_MESHCONF_PATH_HWMP 0x00 +enum { + /* 0 reserved */ + IEEE80211_MESHCONF_PATH_HWMP = 1, + /* 2-254 reserved */ + IEEE80211_MESHCONF_PATH_VENDOR = 255, +}; + /* Airtime Link Metric */ -#define IEEE80211_MESHCONF_METRIC_AIRTIME 0x00 +enum { + /* 0 reserved */ + IEEE80211_MESHCONF_METRIC_AIRTIME = 1, + /* 2-254 reserved */ + IEEE80211_MESHCONF_METRIC_VENDOR = 255, +}; + /* Congestion Control */ -#define IEEE80211_MESHCONF_CC_DISABLED 0x00 -#define IEEE80211_MESHCONF_CC_SIG 0x01 +enum { + IEEE80211_MESHCONF_CC_DISABLED = 0, + IEEE80211_MESHCONF_CC_SIG = 1, + /* 2-254 reserved */ + IEEE80211_MESHCONF_CC_VENDOR = 255, +}; + /* Neighbour Offset */ -#define IEEE80211_MESHCONF_SYNC_NEIGHOFF 0x00 -#define IEEE80211_MESHCONF_AUTH_DISABLED 0x00 -/* Simultaneous Authenticaction of Equals */ -#define IEEE80211_MESHCONF_AUTH_SAE 0x01 -#define IEEE80211_MESHCONF_FORM_MP 0x01 /* Connected to Portal */ -#define IEEE80211_MESHCONF_FORM_NNEIGH_MASK 0x04 /* Number of Neighbours */ +enum { + /* 0 reserved */ + IEEE80211_MESHCONF_SYNC_NEIGHOFF = 1, + /* 2-254 rserved */ + IEEE80211_MESHCONF_SYNC_VENDOR = 255, +}; + +/* Authentication Protocol Identifier */ +enum { + + IEEE80211_MESHCONF_AUTH_DISABLED = 0, + /* Simultaneous Authenticaction of Equals */ + IEEE80211_MESHCONF_AUTH_SEA = 1, + IEEE80211_MESHCONF_AUTH_8021X = 2, /* IEEE 802.1X */ + /* 3-254 reserved */ + IEEE80211_MESHCONF_AUTH_VENDOR = 255, +}; + +/* Mesh Formation Info */ +#define IEEE80211_MESHCONF_FORM_MP 0x01 /* Connected to Portal */ +#define IEEE80211_MESHCONF_FORM_NNEIGH_MASK 0x7E /* Number of Neighbours */ +#define IEEE80211_MESHCONF_FORM_SA 0xF0 /* indicating 802.1X auth */ + +/* Mesh Capability */ #define IEEE80211_MESHCONF_CAP_AP 0x01 /* Accepting Peers */ #define IEEE80211_MESHCONF_CAP_MCCAS 0x02 /* MCCA supported */ #define IEEE80211_MESHCONF_CAP_MCCAE 0x04 /* MCCA enabled */ #define IEEE80211_MESHCONF_CAP_FWRD 0x08 /* forwarding enabled */ #define IEEE80211_MESHCONF_CAP_BTR 0x10 /* Beacon Timing Report Enab */ -#define IEEE80211_MESHCONF_CAP_TBTTA 0x20 /* TBTT Adj. Enabled */ -#define IEEE80211_MESHCONF_CAP_TBTT 0x40 /* TBTT Adjusting */ -#define IEEE80211_MESHCONF_CAP_PSL 0x80 /* Power Save Level */ +#define IEEE80211_MESHCONF_CAP_TBTT 0x20 /* TBTT Adjusting */ +#define IEEE80211_MESHCONF_CAP_PSL 0x40 /* Power Save Level */ +/* 0x80 reserved */ /* Mesh Identifier */ struct ieee80211_meshid_ie { From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 11:15:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85A38106568D; Mon, 13 Feb 2012 11:15:30 +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 74B118FC19; Mon, 13 Feb 2012 11:15:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1DBFUZE040001; Mon, 13 Feb 2012 11:15:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1DBFUQ7039998; Mon, 13 Feb 2012 11:15:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202131115.q1DBFUQ7039998@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 13 Feb 2012 11:15: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: r231582 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 11:15:30 -0000 Author: kib Date: Mon Feb 13 11:15:29 2012 New Revision: 231582 URL: http://svn.freebsd.org/changeset/base/231582 Log: Add missed EOL when die() was converted to use rtld_fdputstr() instead of errx(). Reported by: amdmi3 PR: bin/165075 MFC after: 3 days Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Feb 13 10:48:43 2012 (r231581) +++ head/libexec/rtld-elf/rtld.c Mon Feb 13 11:15:29 2012 (r231582) @@ -757,6 +757,7 @@ die(void) if (msg == NULL) msg = "Fatal error"; rtld_fdputstr(STDERR_FILENO, msg); + rtld_fdputchar(STDERR_FILENO, '\n'); _exit(1); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 12:00:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A41A0106564A; Mon, 13 Feb 2012 12:00:00 +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 839F88FC08; Mon, 13 Feb 2012 12:00:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1DC0011041478; Mon, 13 Feb 2012 12:00:00 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1DC00AW041463; Mon, 13 Feb 2012 12:00:00 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202131200.q1DC00AW041463@svn.freebsd.org> From: Ed Schouten Date: Mon, 13 Feb 2012 12:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231584 - head/crypto/openssh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 12:00:00 -0000 Author: ed Date: Mon Feb 13 11:59:59 2012 New Revision: 231584 URL: http://svn.freebsd.org/changeset/base/231584 Log: Polish diff against upstream. - Revert unneeded whitespace changes. - Revert modifications to loginrec.c, as the upstream version already does the right thing. - Fix indentation and whitespace of local changes. Approved by: des MFC after: 1 month Modified: head/crypto/openssh/auth2.c head/crypto/openssh/channels.c head/crypto/openssh/channels.h head/crypto/openssh/kex.c head/crypto/openssh/loginrec.c (contents, props changed) head/crypto/openssh/readconf.c head/crypto/openssh/readconf.h head/crypto/openssh/servconf.c head/crypto/openssh/sftp.1 head/crypto/openssh/ssh.c head/crypto/openssh/sshd.c head/crypto/openssh/sshd_config.5 head/crypto/openssh/version.h Modified: head/crypto/openssh/auth2.c ============================================================================== --- head/crypto/openssh/auth2.c Mon Feb 13 11:36:42 2012 (r231583) +++ head/crypto/openssh/auth2.c Mon Feb 13 11:59:59 2012 (r231584) @@ -223,8 +223,8 @@ input_userauth_request(int type, u_int32 login_cap_t *lc; const char *from_host, *from_ip; - from_host = get_canonical_hostname(options.use_dns); - from_ip = get_remote_ipaddr(); + from_host = get_canonical_hostname(options.use_dns); + from_ip = get_remote_ipaddr(); #endif if (authctxt == NULL) @@ -272,23 +272,23 @@ input_userauth_request(int type, u_int32 } #ifdef HAVE_LOGIN_CAP - if (authctxt->pw != NULL) { - lc = login_getpwclass(authctxt->pw); - if (lc == NULL) - lc = login_getclassbyname(NULL, authctxt->pw); - if (!auth_hostok(lc, from_host, from_ip)) { - logit("Denied connection for %.200s from %.200s [%.200s].", - authctxt->pw->pw_name, from_host, from_ip); - packet_disconnect("Sorry, you are not allowed to connect."); - } - if (!auth_timeok(lc, time(NULL))) { - logit("LOGIN %.200s REFUSED (TIME) FROM %.200s", - authctxt->pw->pw_name, from_host); - packet_disconnect("Logins not available right now."); - } - login_close(lc); - lc = NULL; - } + if (authctxt->pw != NULL) { + lc = login_getpwclass(authctxt->pw); + if (lc == NULL) + lc = login_getclassbyname(NULL, authctxt->pw); + if (!auth_hostok(lc, from_host, from_ip)) { + logit("Denied connection for %.200s from %.200s [%.200s].", + authctxt->pw->pw_name, from_host, from_ip); + packet_disconnect("Sorry, you are not allowed to connect."); + } + if (!auth_timeok(lc, time(NULL))) { + logit("LOGIN %.200s REFUSED (TIME) FROM %.200s", + authctxt->pw->pw_name, from_host); + packet_disconnect("Logins not available right now."); + } + login_close(lc); + lc = NULL; + } #endif /* HAVE_LOGIN_CAP */ /* reset state */ Modified: head/crypto/openssh/channels.c ============================================================================== --- head/crypto/openssh/channels.c Mon Feb 13 11:36:42 2012 (r231583) +++ head/crypto/openssh/channels.c Mon Feb 13 11:59:59 2012 (r231584) @@ -824,7 +824,7 @@ channel_tcpwinsz(void) u_int maxlen; /* If we are not on a socket return 128KB. */ - if (!packet_connection_is_on_socket()) + if (!packet_connection_is_on_socket()) return (128 * 1024); tcpwinsz = 0; @@ -854,7 +854,7 @@ channel_pre_open(Channel *c, fd_set *rea limit = MIN(compat20 ? c->remote_window : packet_get_maxsize(), 2 * c->tcpwinsz); - + if (c->istate == CHAN_INPUT_OPEN && limit > 0 && buffer_len(&c->input) < limit && @@ -2687,10 +2687,10 @@ channel_set_af(int af) IPv4or6 = af; } -void +void channel_set_hpn(int disabled, u_int buf_size) { - hpn_disabled = disabled; + hpn_disabled = disabled; buffer_size = buf_size; debug("HPN Disabled: %d, HPN Buffer Size: %d", hpn_disabled, buffer_size); @@ -2856,10 +2856,10 @@ channel_setup_fwd_listener(int type, con c = channel_new("port listener", type, sock, sock, -1, CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 0, "port listener", 1); - else - c = channel_new("port listener", type, sock, sock, -1, - buffer_size, CHAN_TCP_PACKET_DEFAULT, - 0, "port listener", 1); + else + c = channel_new("port listener", type, sock, sock, -1, + buffer_size, CHAN_TCP_PACKET_DEFAULT, + 0, "port listener", 1); c->path = xstrdup(host); c->host_port = port_to_connect; c->listening_port = listen_port; Modified: head/crypto/openssh/channels.h ============================================================================== --- head/crypto/openssh/channels.h Mon Feb 13 11:36:42 2012 (r231583) +++ head/crypto/openssh/channels.h Mon Feb 13 11:59:59 2012 (r231584) @@ -126,7 +126,7 @@ struct Channel { u_int local_window_max; u_int local_consumed; u_int local_maxpacket; - u_int tcpwinsz; + u_int tcpwinsz; int dynamic_window; int extended_usage; int single_connection; @@ -165,13 +165,10 @@ struct Channel { /* default window/packet sizes for tcp/x11-fwd-channel */ #define CHAN_SES_PACKET_DEFAULT (32*1024) #define CHAN_SES_WINDOW_DEFAULT (64*CHAN_SES_PACKET_DEFAULT) - #define CHAN_TCP_PACKET_DEFAULT (32*1024) #define CHAN_TCP_WINDOW_DEFAULT (64*CHAN_TCP_PACKET_DEFAULT) - #define CHAN_X11_PACKET_DEFAULT (16*1024) #define CHAN_X11_WINDOW_DEFAULT (4*CHAN_X11_PACKET_DEFAULT) - #define CHAN_HPN_MIN_WINDOW_DEFAULT (2*1024*1024) /* possible input states */ @@ -302,6 +299,7 @@ void chan_write_failed(Channel *); void chan_obuf_empty(Channel *); /* hpn handler */ -void channel_set_hpn(int, u_int); + +void channel_set_hpn(int, u_int); #endif Modified: head/crypto/openssh/kex.c ============================================================================== --- head/crypto/openssh/kex.c Mon Feb 13 11:36:42 2012 (r231583) +++ head/crypto/openssh/kex.c Mon Feb 13 11:59:59 2012 (r231584) @@ -457,13 +457,13 @@ kex_choose_conf(Kex *kex) #ifdef NONE_CIPHER_ENABLED debug("REQUESTED ENC.NAME is '%s'", newkeys->enc.name); if (strcmp(newkeys->enc.name, "none") == 0) { - debug("Requesting NONE. Authflag is %d", auth_flag); + debug("Requesting NONE. Authflag is %d", auth_flag); if (auth_flag == 1) debug("None requested post authentication."); else fatal("Pre-authentication none cipher requests " "are not allowed."); - } + } #endif debug("kex: %s %s %s %s", ctos ? "client->server" : "server->client", Modified: head/crypto/openssh/loginrec.c ============================================================================== --- head/crypto/openssh/loginrec.c Mon Feb 13 11:36:42 2012 (r231583) +++ head/crypto/openssh/loginrec.c Mon Feb 13 11:59:59 2012 (r231584) @@ -146,7 +146,6 @@ */ #include "includes.h" -__RCSID("$FreeBSD$"); #include #include @@ -516,10 +515,6 @@ getlast_entry(struct logininfo *li) return (utmpx_get_entry(li)); #endif -#if 1 - return (utmpx_get_entry(li)); -#endif - #if defined(DISABLE_LASTLOG) /* On some systems we shouldn't even try to obtain last login * time, e.g. AIX */ Modified: head/crypto/openssh/readconf.c ============================================================================== --- head/crypto/openssh/readconf.c Mon Feb 13 11:36:42 2012 (r231583) +++ head/crypto/openssh/readconf.c Mon Feb 13 11:59:59 2012 (r231584) @@ -264,6 +264,7 @@ static struct { { "noneswitch", oNoneSwitch }, #endif { "versionaddendum", oVersionAddendum }, + { NULL, oBadOption } }; @@ -1092,9 +1093,9 @@ parse_int: case oNoneEnabled: intptr = &options->none_enabled; goto parse_flag; - + /* - * We check to see if the command comes from the command line or not. + * We check to see if the command comes from the command line or not. * If it does then enable it otherwise fail. NONE must never be a * default configuration. */ @@ -1110,7 +1111,7 @@ parse_int: "from the command line", filename); error("Continuing..."); return 0; - } + } #endif case oVersionAddendum: @@ -1458,7 +1459,7 @@ fill_default_options(Options * options) /* options->host_key_alias should not be set by default */ /* options->preferred_authentications will be set in ssh */ if (options->hpn_disabled == -1) - options->hpn_disabled = 0; + options->hpn_disabled = 0; if (options->hpn_buffer_size > -1) { u_int maxlen; @@ -1478,7 +1479,7 @@ fill_default_options(Options * options) } if (options->tcp_rcv_buf == 0) options->tcp_rcv_buf = 1; - if (options->tcp_rcv_buf > -1) + if (options->tcp_rcv_buf > -1) options->tcp_rcv_buf *= 1024; if (options->tcp_rcv_buf_poll == -1) options->tcp_rcv_buf_poll = 1; Modified: head/crypto/openssh/readconf.h ============================================================================== --- head/crypto/openssh/readconf.h Mon Feb 13 11:36:42 2012 (r231583) +++ head/crypto/openssh/readconf.h Mon Feb 13 11:59:59 2012 (r231584) @@ -133,6 +133,7 @@ typedef struct { int visual_host_key; int use_roaming; + int request_tty; int hpn_disabled; /* Switch to disable HPN buffer management. */ Modified: head/crypto/openssh/servconf.c ============================================================================== --- head/crypto/openssh/servconf.c Mon Feb 13 11:36:42 2012 (r231583) +++ head/crypto/openssh/servconf.c Mon Feb 13 11:59:59 2012 (r231584) @@ -166,7 +166,7 @@ fill_default_server_options(ServerOption _PATH_HOST_KEY_FILE; if (options->protocol & SSH_PROTO_2) { options->host_key_files[options->num_host_key_files++] = - _PATH_HOST_RSA_KEY_FILE; + _PATH_HOST_RSA_KEY_FILE; options->host_key_files[options->num_host_key_files++] = _PATH_HOST_DSA_KEY_FILE; #ifdef OPENSSL_HAS_ECC @@ -286,7 +286,7 @@ fill_default_server_options(ServerOption options->ip_qos_interactive = IPTOS_LOWDELAY; if (options->ip_qos_bulk == -1) options->ip_qos_bulk = IPTOS_THROUGHPUT; - if (options->hpn_disabled == -1) + if (options->hpn_disabled == -1) options->hpn_disabled = 0; if (options->hpn_buffer_size == -1) { /* Modified: head/crypto/openssh/sftp.1 ============================================================================== --- head/crypto/openssh/sftp.1 Mon Feb 13 11:36:42 2012 (r231583) +++ head/crypto/openssh/sftp.1 Mon Feb 13 11:59:59 2012 (r231584) @@ -246,7 +246,7 @@ diagnostic messages from Specify how many requests may be outstanding at any one time. Increasing this may slightly improve file transfer speed but will increase memory usage. -The default is 256 outstanding requests providing for 8MB +The default is 256 outstanding requests providing for 8MB of outstanding data with a 32KB buffer. .It Fl r Recursively copy entire directories when uploading and downloading. Modified: head/crypto/openssh/ssh.c ============================================================================== --- head/crypto/openssh/ssh.c Mon Feb 13 11:36:42 2012 (r231583) +++ head/crypto/openssh/ssh.c Mon Feb 13 11:59:59 2012 (r231584) @@ -1461,6 +1461,7 @@ ssh_session2_open(void) c->dynamic_window = 1; debug("Enabled Dynamic Window Scaling\n"); } + debug3("ssh_session2_open: channel_new: %d", c->self); channel_send_open(c->self); Modified: head/crypto/openssh/sshd.c ============================================================================== --- head/crypto/openssh/sshd.c Mon Feb 13 11:36:42 2012 (r231583) +++ head/crypto/openssh/sshd.c Mon Feb 13 11:59:59 2012 (r231584) @@ -1916,11 +1916,11 @@ main(int ac, char **av) #ifdef __FreeBSD__ /* * Initialize the resolver. This may not happen automatically - * before privsep chroot(). + * before privsep chroot(). */ if ((_res.options & RES_INIT) == 0) { - debug("res_init()"); - res_init(); + debug("res_init()"); + res_init(); } #ifdef GSSAPI /* Modified: head/crypto/openssh/sshd_config.5 ============================================================================== --- head/crypto/openssh/sshd_config.5 Mon Feb 13 11:36:42 2012 (r231583) +++ head/crypto/openssh/sshd_config.5 Mon Feb 13 11:59:59 2012 (r231584) @@ -499,7 +499,7 @@ or .Pp .Pa /etc/hosts.equiv and -.Pa /etc/ssh/shosts.equiv +.Pa /etc/ssh/shosts.equiv are still used. The default is .Dq yes . Modified: head/crypto/openssh/version.h ============================================================================== --- head/crypto/openssh/version.h Mon Feb 13 11:36:42 2012 (r231583) +++ head/crypto/openssh/version.h Mon Feb 13 11:59:59 2012 (r231584) @@ -2,11 +2,11 @@ /* $FreeBSD$ */ #ifndef SSH_VERSION -#define SSH_VERSION_BASE "OpenSSH_5.9p1" -#define SSH_VERSION_ADDENDUM "FreeBSD-20111001" +#define SSH_VERSION_BASE "OpenSSH_5.9p1" +#define SSH_VERSION_ADDENDUM "FreeBSD-20111001" #define SSH_VERSION_HPN "_hpn13v11" #define SSH_VERSION SSH_VERSION_BASE SSH_VERSION_HPN " " SSH_VERSION_ADDENDUM -#define SSH_RELEASE (ssh_version_get()) +#define SSH_RELEASE (ssh_version_get()) const char *ssh_version_get(void); void ssh_version_set_addendum(const char *); From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 13:07:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A43C1065676; Mon, 13 Feb 2012 13:07:57 +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 6988D8FC1F; Mon, 13 Feb 2012 13:07:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1DD7vjC043818; Mon, 13 Feb 2012 13:07:57 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1DD7vHn043816; Mon, 13 Feb 2012 13:07:57 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202131307.q1DD7vHn043816@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 13 Feb 2012 13:07: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: r231585 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 13:07:57 -0000 Author: glebius Date: Mon Feb 13 13:07:56 2012 New Revision: 231585 URL: http://svn.freebsd.org/changeset/base/231585 Log: No need to optimise for a node with no hooks, my braino. Modified: head/sys/netgraph/ng_socket.c Modified: head/sys/netgraph/ng_socket.c ============================================================================== --- head/sys/netgraph/ng_socket.c Mon Feb 13 11:59:59 2012 (r231584) +++ head/sys/netgraph/ng_socket.c Mon Feb 13 13:07:56 2012 (r231585) @@ -850,12 +850,9 @@ ngs_findhook(node_p node, const char *na uint32_t h; /* - * Microoptimisations for a ng_socket with no - * hooks, or with a single hook, which is a - * common case. + * Microoptimisation for an ng_socket with + * a single hook, which is a common case. */ - if (node->nd_numhooks == 0) - return (NULL); if (node->nd_numhooks == 1) { hook_p hook; From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 14:40:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE669106566B; Mon, 13 Feb 2012 14:40:15 +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 B25008FC13; Mon, 13 Feb 2012 14:40:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1DEeFVS046755; Mon, 13 Feb 2012 14:40:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1DEeFmH046752; Mon, 13 Feb 2012 14:40:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202131440.q1DEeFmH046752@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 13 Feb 2012 14:40: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: r231586 - head/usr.bin/write X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 14:40:16 -0000 Author: glebius Date: Mon Feb 13 14:40:15 2012 New Revision: 231586 URL: http://svn.freebsd.org/changeset/base/231586 Log: Fix write(1) to support wide characters. Submitted by: amdmi3 PR: bin/164317 Modified: head/usr.bin/write/write.1 head/usr.bin/write/write.c Modified: head/usr.bin/write/write.1 ============================================================================== --- head/usr.bin/write/write.1 Mon Feb 13 13:07:56 2012 (r231585) +++ head/usr.bin/write/write.1 Mon Feb 13 14:40:15 2012 (r231586) @@ -31,7 +31,7 @@ .\" @(#)write.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd July 17, 2004 +.Dd February 13, 2012 .Dt WRITE 1 .Os .Sh NAME @@ -107,7 +107,3 @@ setting is used to determine which chara terminal, not the receiver's (which .Nm has no way of knowing). -.Pp -The -.Nm -utility does not recognize multibyte characters. Modified: head/usr.bin/write/write.c ============================================================================== --- head/usr.bin/write/write.c Mon Feb 13 13:07:56 2012 (r231585) +++ head/usr.bin/write/write.c Mon Feb 13 14:40:15 2012 (r231586) @@ -60,12 +60,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include void done(int); void do_write(char *, char *, uid_t); static void usage(void); int term_chk(char *, int *, time_t *, int); -void wr_fputs(unsigned char *s); +void wr_fputs(wchar_t *s); void search_utmp(char *, char *, char *, uid_t); int utmp_chk(char *, char *); @@ -243,7 +245,8 @@ do_write(char *tty, char *mytty, uid_t m char *nows; struct passwd *pwd; time_t now; - char path[MAXPATHLEN], host[MAXHOSTNAMELEN], line[512]; + char path[MAXPATHLEN], host[MAXHOSTNAMELEN]; + wchar_t line[512]; /* Determine our login name before we reopen() stdout */ if ((login = getlogin()) == NULL) { @@ -269,7 +272,7 @@ do_write(char *tty, char *mytty, uid_t m (void)printf("\r\n\007\007\007Message from %s@%s on %s at %s ...\r\n", login, host, mytty, nows + 11); - while (fgets(line, sizeof(line), stdin) != NULL) + while (fgetws(line, sizeof(line)/sizeof(wchar_t), stdin) != NULL) wr_fputs(line); } @@ -288,30 +291,20 @@ done(int n __unused) * turns \n into \r\n */ void -wr_fputs(unsigned char *s) +wr_fputs(wchar_t *s) { -#define PUTC(c) if (putchar(c) == EOF) err(1, NULL); +#define PUTC(c) if (putwchar(c) == WEOF) err(1, NULL); - for (; *s != '\0'; ++s) { - if (*s == '\n') { - PUTC('\r'); - } else if (((*s & 0x80) && *s < 0xA0) || - /* disable upper controls */ - (!isprint(*s) && !isspace(*s) && - *s != '\a' && *s != '\b') - ) { - if (*s & 0x80) { - *s &= ~0x80; - PUTC('M'); - PUTC('-'); - } - if (iscntrl(*s)) { - *s ^= 0x40; - PUTC('^'); - } + for (; *s != L'\0'; ++s) { + if (*s == L'\n') { + PUTC(L'\r'); + PUTC(L'\n'); + } else if (iswprint(*s) || iswspace(*s)) { + PUTC(*s); + } else { + wprintf(L"<0x%X>", *s); } - PUTC(*s); } return; #undef PUTC From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 16:26:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D71CC1065670; Mon, 13 Feb 2012 16:26:40 +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 AEAA98FC18; Mon, 13 Feb 2012 16:26:40 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id D1B0B46B46; Mon, 13 Feb 2012 11:26:39 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 53E4FB925; Mon, 13 Feb 2012 11:26:39 -0500 (EST) From: John Baldwin To: "Bjoern A. Zeeb" Date: Mon, 13 Feb 2012 11:07:42 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202110743.q1B7hXoq019215@svn.freebsd.org> In-Reply-To: <201202110743.q1B7hXoq019215@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201202131107.42248.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 13 Feb 2012 11:26:39 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231508 - head/sys/dev/oce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 16:26:40 -0000 On Saturday, February 11, 2012 2:43:33 am Bjoern A. Zeeb wrote: > Author: bz > Date: Sat Feb 11 07:43:33 2012 > New Revision: 231508 > URL: http://svn.freebsd.org/changeset/base/231508 > > Log: > Make use of the read-only variant of the IF_ADDR_*LOCK() macros introduced > in r229614 rather than the compat one. Drivers should use the 'if_*addr_*lock()' functions, not the macros directly anyway. In this case it should likely be if_maddr_rlock() and if_maddr_runlock(). -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 16:26:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CAA5106564A; Mon, 13 Feb 2012 16:26:41 +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 4417B8FC13; Mon, 13 Feb 2012 16:26:41 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id F378046B09; Mon, 13 Feb 2012 11:26:40 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 72704B93F; Mon, 13 Feb 2012 11:26:40 -0500 (EST) From: John Baldwin To: Ed Schouten Date: Mon, 13 Feb 2012 11:26:38 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202101340.q1ADeWDj076596@svn.freebsd.org> In-Reply-To: <201202101340.q1ADeWDj076596@svn.freebsd.org> MIME-Version: 1.0 Message-Id: <201202131126.38759.jhb@freebsd.org> Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 13 Feb 2012 11:26:40 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231383 - in head: lib/libutil usr.sbin/vipw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 16:26:41 -0000 On Friday, February 10, 2012 8:40:32 am Ed Schouten wrote: > Author: ed > Date: Fri Feb 10 13:40:32 2012 > New Revision: 231383 > URL: http://svn.freebsd.org/changeset/base/231383 > > Log: > Detect file modification properly by using tv_nsec. > > POSIX 2008 standardizes st_mtim, meaning we can simply use nanosecond > precision to detect file modification. > > MFC after: 2 weeks Eh, the BUG is still worth mentioning. By default FreeBSD only uses second granularity for VFS timestamps, so two updates within a single second is still racey. You can keep the code change, but I would revert the manual page change to put the BUG back as your change didn't remove it. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 16:48:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27219106566B; Mon, 13 Feb 2012 16:48:50 +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 161F08FC14; Mon, 13 Feb 2012 16:48:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1DGmn1x052379; Mon, 13 Feb 2012 16:48:49 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1DGmnID052377; Mon, 13 Feb 2012 16:48:49 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202131648.q1DGmnID052377@svn.freebsd.org> From: Ed Maste Date: Mon, 13 Feb 2012 16:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231589 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 16:48:50 -0000 Author: emaste Date: Mon Feb 13 16:48:49 2012 New Revision: 231589 URL: http://svn.freebsd.org/changeset/base/231589 Log: Add a sysctl to report the firmware build number. Some older firmware versions have issues that can be worked around by avoiding certain operations. Add a sysctl dev.aac.#.firmware_build to make it easy for scripts or userland tools to detect the firmware version. Modified: head/sys/dev/aac/aac.c Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Mon Feb 13 16:43:29 2012 (r231588) +++ head/sys/dev/aac/aac.c Mon Feb 13 16:48:49 2012 (r231589) @@ -292,6 +292,15 @@ aac_attach(struct aac_softc *sc) aac_describe_controller(sc); /* + * Add sysctls. + */ + SYSCTL_ADD_INT(device_get_sysctl_ctx(sc->aac_dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->aac_dev)), + OID_AUTO, "firmware_build", CTLFLAG_RD, + &sc->aac_revision.buildNumber, 0, + "firmware build number"); + + /* * Register to probe our containers later. */ sc->aac_ich.ich_func = aac_startup; From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 18:41:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4422E106564A; Mon, 13 Feb 2012 18:41:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3371B8FC0A; Mon, 13 Feb 2012 18:41:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1DIfXiD056124; Mon, 13 Feb 2012 18:41:33 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1DIfXYr056122; Mon, 13 Feb 2012 18:41:33 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202131841.q1DIfXYr056122@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 13 Feb 2012 18:41: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: r231592 - head/sys/dev/cxgbe/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 18:41:33 -0000 Author: np Date: Mon Feb 13 18:41:32 2012 New Revision: 231592 URL: http://svn.freebsd.org/changeset/base/231592 Log: Use the non-sleeping variang of t4_wr_mbox in code that can be called with locks held. MFC after: 1 day Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Feb 13 18:26:58 2012 (r231591) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Feb 13 18:41:32 2012 (r231592) @@ -4314,7 +4314,7 @@ int t4_change_mac(struct adapter *adap, V_FW_VI_MAC_CMD_IDX(idx)); memcpy(p->macaddr, addr, sizeof(p->macaddr)); - ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); + ret = t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), &c); if (ret == 0) { ret = G_FW_VI_MAC_CMD_IDX(ntohs(p->valid_to_idx)); if (ret >= FW_CLS_TCAM_NUM_ENTRIES) From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 18:43:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC1471065676; Mon, 13 Feb 2012 18:43:45 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 477568FC22; Mon, 13 Feb 2012 18:43:45 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id AC5D02A28CC5; Mon, 13 Feb 2012 19:43:41 +0100 (CET) Date: Mon, 13 Feb 2012 19:43:41 +0100 From: Ed Schouten To: John Baldwin Message-ID: <20120213184341.GY1860@hoeg.nl> References: <201202101340.q1ADeWDj076596@svn.freebsd.org> <201202131126.38759.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BN+Sv8yD/qqrpTrl" Content-Disposition: inline In-Reply-To: <201202131126.38759.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231383 - in head: lib/libutil usr.sbin/vipw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 18:43:45 -0000 --BN+Sv8yD/qqrpTrl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * John Baldwin , 20120213 17:26: > Eh, the BUG is still worth mentioning. By default FreeBSD only uses > second granularity for VFS timestamps, so two updates within a single > second is still racey. You can keep the code change, but I would > revert the manual page change to put the BUG back as your change > didn't remove it. I'll re-add it tomorrow. I do think I will extend the message a bit, stating that this is only a problem if your file system doesn't do fine-grained timestamps. --=20 Ed Schouten WWW: http://80386.nl/ --BN+Sv8yD/qqrpTrl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iQIcBAEBAgAGBQJPOVndAAoJEG5e2P40kaK72NgQAJEkMmtiTBMUJXnYAkdavl2j 70ufjZeOhOXu5LzqAZgaS3dQ7Zb+CbkO6EH5U6AgIWCL49rbZeJcuu6wMrNr0n2Q sqsefAPqZcZpI4SzNygJtYLl14FJUMyCTOPKjAXSaQEpgnCLHdfGBGHoyoBpEyf1 50/68yLQNWW0/JnvYiGaUdDdtJAOifHBdWHKcNuZQIqlW3q7zn2NPOaBFW0rupWH eHkm2+HcfNsxvUZshpE/JBYiWhHUbdQr788mhVFRaD3MERntrQ7hG6z+0jq3mR5q Sd7Hazcl4UYGSxkfttqFWtmgQZewB5Z0fMAyCItK55X7Xt7Thk568BTRjNICDCoE 7etj8Jk7rxlq24ub+kal1WOBlFLX1hjoKIsa6h1ztdJiFrtjN1o6+ka9Mob1Hkjp wIKy6BRobbvo0c0n5jG9LbKB5avH8HU5GjdC71s6MF6hotcLIIqvb7S6HFHfR6UM vXW/Wx+8dsaODxNYqmGNabPxZWUa2dg4CNhZ4Qsvp6mgVfYVOPARBb82m3c45hxj jkH6y+jcpAO9g2cXLOAWl1HSx+zycqiOvkO46AxgCy9b0uF4QZf7Nb2BK2OW9jli Zn54ZkgwbF5a0AenoyqujvPBmOg3m6hZRf8bf8TTGMbNXdbR+tfhS8t9RO6+QgB2 jTOAxdiiH/q3omrjxpcD =gfzD -----END PGP SIGNATURE----- --BN+Sv8yD/qqrpTrl-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 18:56:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D622106566C; Mon, 13 Feb 2012 18:56:35 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B88D8FC12; Mon, 13 Feb 2012 18:56:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1DIuYA7056769; Mon, 13 Feb 2012 18:56:34 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1DIuYCo056761; Mon, 13 Feb 2012 18:56:34 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201202131856.q1DIuYCo056761@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 13 Feb 2012 18: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: r231594 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 18:56:35 -0000 Author: luigi Date: Mon Feb 13 18:56:34 2012 New Revision: 231594 URL: http://svn.freebsd.org/changeset/base/231594 Log: - use struct ifnet as explicit type of the argument to the txsync() and rxsync() callbacks, removing some variables made useless by this change; - add generic lock and irq handling routines. These can be useful in case there are no driver locks that we can reuse; - add a few macros to reduce differences with the Linux version. Modified: head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Mon Feb 13 18:54:15 2012 (r231593) +++ head/sys/dev/netmap/if_em_netmap.h Mon Feb 13 18:56:34 2012 (r231594) @@ -42,9 +42,9 @@ static void em_netmap_block_tasks(struct adapter *); static void em_netmap_unblock_tasks(struct adapter *); static int em_netmap_reg(struct ifnet *, int onoff); -static int em_netmap_txsync(void *, u_int, int); -static int em_netmap_rxsync(void *, u_int, int); -static void em_netmap_lock_wrapper(void *, int, u_int); +static int em_netmap_txsync(struct ifnet *, u_int, int); +static int em_netmap_rxsync(struct ifnet *, u_int, int); +static void em_netmap_lock_wrapper(struct ifnet *, int, u_int); static void em_netmap_attach(struct adapter *adapter) @@ -69,9 +69,9 @@ em_netmap_attach(struct adapter *adapter * wrapper to export locks to the generic code */ static void -em_netmap_lock_wrapper(void *_a, int what, u_int queueid) +em_netmap_lock_wrapper(struct ifnet *ifp, int what, u_int queueid) { - struct adapter *adapter = _a; + struct adapter *adapter = ifp->if_softc; ASSERT(queueid < adapter->num_queues); switch (what) { @@ -183,9 +183,9 @@ fail: * Reconcile hardware and user view of the transmit ring. */ static int -em_netmap_txsync(void *a, u_int ring_nr, int do_lock) +em_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock) { - struct adapter *adapter = a; + struct adapter *adapter = ifp->if_softc; struct tx_ring *txr = &adapter->tx_rings[ring_nr]; struct netmap_adapter *na = NA(adapter->ifp); struct netmap_kring *kring = &na->tx_rings[ring_nr]; @@ -289,9 +289,9 @@ em_netmap_txsync(void *a, u_int ring_nr, * Reconcile kernel and user view of the receive ring. */ static int -em_netmap_rxsync(void *a, u_int ring_nr, int do_lock) +em_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int do_lock) { - struct adapter *adapter = a; + struct adapter *adapter = ifp->if_softc; struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; struct netmap_adapter *na = NA(adapter->ifp); struct netmap_kring *kring = &na->rx_rings[ring_nr]; Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Mon Feb 13 18:54:15 2012 (r231593) +++ head/sys/dev/netmap/if_igb_netmap.h Mon Feb 13 18:56:34 2012 (r231594) @@ -38,9 +38,9 @@ #include static int igb_netmap_reg(struct ifnet *, int onoff); -static int igb_netmap_txsync(void *, u_int, int); -static int igb_netmap_rxsync(void *, u_int, int); -static void igb_netmap_lock_wrapper(void *, int, u_int); +static int igb_netmap_txsync(struct ifnet *, u_int, int); +static int igb_netmap_rxsync(struct ifnet *, u_int, int); +static void igb_netmap_lock_wrapper(struct ifnet *, int, u_int); static void @@ -66,9 +66,9 @@ igb_netmap_attach(struct adapter *adapte * wrapper to export locks to the generic code */ static void -igb_netmap_lock_wrapper(void *_a, int what, u_int queueid) +igb_netmap_lock_wrapper(struct ifnet *ifp, int what, u_int queueid) { - struct adapter *adapter = _a; + struct adapter *adapter = ifp->if_softc; ASSERT(queueid < adapter->num_queues); switch (what) { @@ -140,9 +140,9 @@ fail: * Reconcile kernel and user view of the transmit ring. */ static int -igb_netmap_txsync(void *a, u_int ring_nr, int do_lock) +igb_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock) { - struct adapter *adapter = a; + struct adapter *adapter = ifp->if_softc; struct tx_ring *txr = &adapter->tx_rings[ring_nr]; struct netmap_adapter *na = NA(adapter->ifp); struct netmap_kring *kring = &na->tx_rings[ring_nr]; @@ -258,9 +258,9 @@ igb_netmap_txsync(void *a, u_int ring_nr * Reconcile kernel and user view of the receive ring. */ static int -igb_netmap_rxsync(void *a, u_int ring_nr, int do_lock) +igb_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int do_lock) { - struct adapter *adapter = a; + struct adapter *adapter = ifp->if_softc; struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; struct netmap_adapter *na = NA(adapter->ifp); struct netmap_kring *kring = &na->rx_rings[ring_nr]; Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Mon Feb 13 18:54:15 2012 (r231593) +++ head/sys/dev/netmap/if_lem_netmap.h Mon Feb 13 18:56:34 2012 (r231594) @@ -40,9 +40,9 @@ #include static int lem_netmap_reg(struct ifnet *, int onoff); -static int lem_netmap_txsync(void *, u_int, int); -static int lem_netmap_rxsync(void *, u_int, int); -static void lem_netmap_lock_wrapper(void *, int, u_int); +static int lem_netmap_txsync(struct ifnet *, u_int, int); +static int lem_netmap_rxsync(struct ifnet *, u_int, int); +static void lem_netmap_lock_wrapper(struct ifnet *, int, u_int); SYSCTL_NODE(_dev, OID_AUTO, lem, CTLFLAG_RW, 0, "lem card"); @@ -67,9 +67,9 @@ lem_netmap_attach(struct adapter *adapte static void -lem_netmap_lock_wrapper(void *_a, int what, u_int ringid) +lem_netmap_lock_wrapper(struct ifnet *ifp, int what, u_int ringid) { - struct adapter *adapter = _a; + struct adapter *adapter = ifp->if_softc; /* only one ring here so ignore the ringid */ switch (what) { @@ -153,9 +153,9 @@ fail: * Reconcile kernel and user view of the transmit ring. */ static int -lem_netmap_txsync(void *a, u_int ring_nr, int do_lock) +lem_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock) { - struct adapter *adapter = a; + struct adapter *adapter = ifp->if_softc; struct netmap_adapter *na = NA(adapter->ifp); struct netmap_kring *kring = &na->tx_rings[0]; struct netmap_ring *ring = kring->ring; @@ -257,9 +257,9 @@ lem_netmap_txsync(void *a, u_int ring_nr * Reconcile kernel and user view of the receive ring. */ static int -lem_netmap_rxsync(void *a, u_int ring_nr, int do_lock) +lem_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int do_lock) { - struct adapter *adapter = a; + struct adapter *adapter = ifp->if_softc; struct netmap_adapter *na = NA(adapter->ifp); struct netmap_kring *kring = &na->rx_rings[0]; struct netmap_ring *ring = kring->ring; Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Mon Feb 13 18:54:15 2012 (r231593) +++ head/sys/dev/netmap/if_re_netmap.h Mon Feb 13 18:56:34 2012 (r231594) @@ -37,9 +37,9 @@ #include static int re_netmap_reg(struct ifnet *, int onoff); -static int re_netmap_txsync(void *, u_int, int); -static int re_netmap_rxsync(void *, u_int, int); -static void re_netmap_lock_wrapper(void *, int, u_int); +static int re_netmap_txsync(struct ifnet *, u_int, int); +static int re_netmap_rxsync(struct ifnet *, u_int, int); +static void re_netmap_lock_wrapper(struct ifnet *, int, u_int); static void re_netmap_attach(struct rl_softc *sc) @@ -65,9 +65,9 @@ re_netmap_attach(struct rl_softc *sc) * We should not use the tx/rx locks */ static void -re_netmap_lock_wrapper(void *_a, int what, u_int queueid) +re_netmap_lock_wrapper(struct ifnet *ifp, int what, u_int queueid) { - struct rl_softc *adapter = _a; + struct rl_softc *adapter = ifp->if_softc; switch (what) { case NETMAP_CORE_LOCK: @@ -133,9 +133,9 @@ fail: * Reconcile kernel and user view of the transmit ring. */ static int -re_netmap_txsync(void *a, u_int ring_nr, int do_lock) +re_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock) { - struct rl_softc *sc = a; + struct rl_softc *sc = ifp->if_softc; struct rl_txdesc *txd = sc->rl_ldata.rl_tx_desc; struct netmap_adapter *na = NA(sc->rl_ifp); struct netmap_kring *kring = &na->tx_rings[ring_nr]; @@ -236,9 +236,9 @@ re_netmap_txsync(void *a, u_int ring_nr, * Reconcile kernel and user view of the receive ring. */ static int -re_netmap_rxsync(void *a, u_int ring_nr, int do_lock) +re_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int do_lock) { - struct rl_softc *sc = a; + struct rl_softc *sc = ifp->if_softc; struct rl_rxdesc *rxd = sc->rl_ldata.rl_rx_desc; struct netmap_adapter *na = NA(sc->rl_ifp); struct netmap_kring *kring = &na->rx_rings[ring_nr]; Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Mon Feb 13 18:54:15 2012 (r231593) +++ head/sys/dev/netmap/ixgbe_netmap.h Mon Feb 13 18:56:34 2012 (r231594) @@ -55,9 +55,9 @@ * *_netmap_attach() routine. */ static int ixgbe_netmap_reg(struct ifnet *, int onoff); -static int ixgbe_netmap_txsync(void *, u_int, int); -static int ixgbe_netmap_rxsync(void *, u_int, int); -static void ixgbe_netmap_lock_wrapper(void *, int, u_int); +static int ixgbe_netmap_txsync(struct ifnet *, u_int, int); +static int ixgbe_netmap_rxsync(struct ifnet *, u_int, int); +static void ixgbe_netmap_lock_wrapper(struct ifnet *, int, u_int); /* @@ -90,9 +90,9 @@ ixgbe_netmap_attach(struct adapter *adap * wrapper to export locks to the generic netmap code. */ static void -ixgbe_netmap_lock_wrapper(void *_a, int what, u_int queueid) +ixgbe_netmap_lock_wrapper(struct ifnet *_a, int what, u_int queueid) { - struct adapter *adapter = _a; + struct adapter *adapter = _a->if_softc; ASSERT(queueid < adapter->num_queues); switch (what) { @@ -190,9 +190,9 @@ fail: * buffers irrespective of interrupt mitigation. */ static int -ixgbe_netmap_txsync(void *a, u_int ring_nr, int do_lock) +ixgbe_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock) { - struct adapter *adapter = a; + struct adapter *adapter = ifp->if_softc; struct tx_ring *txr = &adapter->tx_rings[ring_nr]; struct netmap_adapter *na = NA(adapter->ifp); struct netmap_kring *kring = &na->tx_rings[ring_nr]; @@ -418,9 +418,9 @@ ring_reset: * do_lock has a special meaning: please refer to txsync. */ static int -ixgbe_netmap_rxsync(void *a, u_int ring_nr, int do_lock) +ixgbe_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int do_lock) { - struct adapter *adapter = a; + struct adapter *adapter = ifp->if_softc; struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; struct netmap_adapter *na = NA(adapter->ifp); struct netmap_kring *kring = &na->rx_rings[ring_nr]; Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Mon Feb 13 18:54:15 2012 (r231593) +++ head/sys/dev/netmap/netmap.c Mon Feb 13 18:56:34 2012 (r231594) @@ -749,7 +749,7 @@ netmap_dtor_locked(void *data) D("deleting last netmap instance for %s", ifp->if_xname); /* * there is a race here with *_netmap_task() and - * netmap_poll(), which don't run under NETMAP_CORE_LOCK. + * netmap_poll(), which don't run under NETMAP_REG_LOCK. * na->refcount == 0 && na->ifp->if_capenable & IFCAP_NETMAP * (aka NETMAP_DELETING(na)) are a unique marker that the * device is dying. @@ -759,9 +759,9 @@ netmap_dtor_locked(void *data) * should check the condition at entry and quit if * they cannot run. */ - na->nm_lock(ifp->if_softc, NETMAP_CORE_UNLOCK, 0); + na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); tsleep(na, 0, "NIOCUNREG", 4); - na->nm_lock(ifp->if_softc, NETMAP_CORE_LOCK, 0); + na->nm_lock(ifp, NETMAP_REG_LOCK, 0); na->nm_register(ifp, 0); /* off, clear IFCAP_NETMAP */ /* Wake up any sleeping threads. netmap_poll will * then return POLLERR @@ -803,9 +803,9 @@ netmap_dtor(void *data) struct ifnet *ifp = priv->np_ifp; struct netmap_adapter *na = NA(ifp); - na->nm_lock(ifp->if_softc, NETMAP_CORE_LOCK, 0); + na->nm_lock(ifp, NETMAP_REG_LOCK, 0); netmap_dtor_locked(data); - na->nm_lock(ifp->if_softc, NETMAP_CORE_UNLOCK, 0); + na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); if_rele(ifp); bzero(priv, sizeof(*priv)); /* XXX for safety */ @@ -863,7 +863,7 @@ netmap_sync_to_host(struct netmap_adapte netmap_ring_reinit(kring); return; } - // na->nm_lock(na->ifp->if_softc, NETMAP_CORE_LOCK, 0); + // na->nm_lock(na->ifp, NETMAP_CORE_LOCK, 0); /* Take packets from hwcur to cur and pass them up. * In case of no buffers we give up. At the end of the loop, @@ -890,16 +890,15 @@ netmap_sync_to_host(struct netmap_adapte } kring->nr_hwcur = k; kring->nr_hwavail = ring->avail = lim; - // na->nm_lock(na->ifp->if_softc, NETMAP_CORE_UNLOCK, 0); + // na->nm_lock(na->ifp, NETMAP_CORE_UNLOCK, 0); /* send packets up, outside the lock */ while ((m = head) != NULL) { head = head->m_nextpkt; m->m_nextpkt = NULL; - m->m_pkthdr.rcvif = na->ifp; if (netmap_verbose & NM_VERB_HOST) - D("sending up pkt %p size %d", m, m->m_pkthdr.len); - (na->ifp->if_input)(na->ifp, m); + D("sending up pkt %p size %d", m, MBUF_LEN(m)); + NM_SEND_UP(na->ifp, m); } } @@ -919,7 +918,7 @@ netmap_sync_from_host(struct netmap_adap int error = 1, delta; u_int k = ring->cur, lim = kring->nkr_num_slots; - na->nm_lock(na->ifp->if_softc, NETMAP_CORE_LOCK, 0); + na->nm_lock(na->ifp, NETMAP_CORE_LOCK, 0); if (k >= lim) /* bad value */ goto done; delta = k - kring->nr_hwcur; @@ -936,7 +935,7 @@ netmap_sync_from_host(struct netmap_adap if (k && (netmap_verbose & NM_VERB_HOST)) D("%d pkts from stack", k); done: - na->nm_lock(na->ifp->if_softc, NETMAP_CORE_UNLOCK, 0); + na->nm_lock(na->ifp, NETMAP_CORE_UNLOCK, 0); if (error) netmap_ring_reinit(kring); } @@ -1028,7 +1027,6 @@ netmap_set_ringid(struct netmap_priv_d * { struct ifnet *ifp = priv->np_ifp; struct netmap_adapter *na = NA(ifp); - void *adapter = na->ifp->if_softc; /* shorthand */ u_int i = ringid & NETMAP_RING_MASK; /* first time we don't lock */ int need_lock = (priv->np_qfirst != priv->np_qlast); @@ -1038,7 +1036,7 @@ netmap_set_ringid(struct netmap_priv_d * return (EINVAL); } if (need_lock) - na->nm_lock(adapter, NETMAP_CORE_LOCK, 0); + na->nm_lock(ifp, NETMAP_CORE_LOCK, 0); priv->np_ringid = ringid; if (ringid & NETMAP_SW_RING) { priv->np_qfirst = na->num_queues; @@ -1052,7 +1050,7 @@ netmap_set_ringid(struct netmap_priv_d * } priv->np_txpoll = (ringid & NETMAP_NO_TX_POLL) ? 0 : 1; if (need_lock) - na->nm_lock(adapter, NETMAP_CORE_UNLOCK, 0); + na->nm_lock(ifp, NETMAP_CORE_UNLOCK, 0); if (ringid & NETMAP_SW_RING) D("ringid %s set to SW RING", ifp->if_xname); else if (ringid & NETMAP_HW_RING) @@ -1085,7 +1083,6 @@ netmap_ioctl(__unused struct cdev *dev, struct ifnet *ifp; struct nmreq *nmr = (struct nmreq *) data; struct netmap_adapter *na; - void *adapter; int error; u_int i; struct netmap_if *nifp; @@ -1127,7 +1124,6 @@ netmap_ioctl(__unused struct cdev *dev, if (error) break; na = NA(ifp); /* retrieve netmap adapter */ - adapter = na->ifp->if_softc; /* shorthand */ /* * Allocate the private per-thread structure. * XXX perhaps we can use a blocking malloc ? @@ -1141,10 +1137,10 @@ netmap_ioctl(__unused struct cdev *dev, } for (i = 10; i > 0; i--) { - na->nm_lock(adapter, NETMAP_CORE_LOCK, 0); + na->nm_lock(ifp, NETMAP_REG_LOCK, 0); if (!NETMAP_DELETING(na)) break; - na->nm_lock(adapter, NETMAP_CORE_UNLOCK, 0); + na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); tsleep(na, 0, "NIOCREGIF", hz/10); } if (i == 0) { @@ -1175,14 +1171,14 @@ netmap_ioctl(__unused struct cdev *dev, if (error) { /* reg. failed, release priv and ref */ error: - na->nm_lock(adapter, NETMAP_CORE_UNLOCK, 0); + na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); if_rele(ifp); /* return the refcount */ bzero(priv, sizeof(*priv)); free(priv, M_DEVBUF); break; } - na->nm_lock(adapter, NETMAP_CORE_UNLOCK, 0); + na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); error = devfs_set_cdevpriv(priv, netmap_dtor); if (error != 0) { @@ -1219,7 +1215,6 @@ error: } ifp = priv->np_ifp; /* we have a reference */ na = NA(ifp); /* retrieve netmap adapter */ - adapter = ifp->if_softc; /* shorthand */ if (priv->np_qfirst == na->num_queues) { /* queues to/from host */ @@ -1237,13 +1232,13 @@ error: D("sync tx ring %d cur %d hwcur %d", i, kring->ring->cur, kring->nr_hwcur); - na->nm_txsync(adapter, i, 1 /* do lock */); + na->nm_txsync(ifp, i, 1 /* do lock */); if (netmap_verbose & NM_VERB_TXSYNC) D("after sync tx ring %d cur %d hwcur %d", i, kring->ring->cur, kring->nr_hwcur); } else { - na->nm_rxsync(adapter, i, 1 /* do lock */); + na->nm_rxsync(ifp, i, 1 /* do lock */); microtime(&na->rx_rings[i].ring->ts); } } @@ -1297,7 +1292,6 @@ netmap_poll(__unused struct cdev *dev, i struct ifnet *ifp; struct netmap_kring *kring; u_int core_lock, i, check_all, want_tx, want_rx, revents = 0; - void *adapter; enum {NO_CL, NEED_CL, LOCKED_CL }; /* see below */ if (devfs_get_cdevpriv((void **)&priv) != 0 || priv == NULL) @@ -1313,7 +1307,6 @@ netmap_poll(__unused struct cdev *dev, i want_tx = events & (POLLOUT | POLLWRNORM); want_rx = events & (POLLIN | POLLRDNORM); - adapter = ifp->if_softc; na = NA(ifp); /* retrieve netmap adapter */ /* how many queues we are scanning */ @@ -1411,16 +1404,16 @@ netmap_poll(__unused struct cdev *dev, i if (!want_tx && kring->ring->cur == kring->nr_hwcur) continue; if (core_lock == NEED_CL) { - na->nm_lock(adapter, NETMAP_CORE_LOCK, 0); + na->nm_lock(ifp, NETMAP_CORE_LOCK, 0); core_lock = LOCKED_CL; } if (na->separate_locks) - na->nm_lock(adapter, NETMAP_TX_LOCK, i); + na->nm_lock(ifp, NETMAP_TX_LOCK, i); if (netmap_verbose & NM_VERB_TXSYNC) D("send %d on %s %d", kring->ring->cur, ifp->if_xname, i); - if (na->nm_txsync(adapter, i, 0 /* no lock */)) + if (na->nm_txsync(ifp, i, 0 /* no lock */)) revents |= POLLERR; /* Check avail/call selrecord only if called with POLLOUT */ @@ -1435,7 +1428,7 @@ netmap_poll(__unused struct cdev *dev, i selrecord(td, &kring->si); } if (na->separate_locks) - na->nm_lock(adapter, NETMAP_TX_UNLOCK, i); + na->nm_lock(ifp, NETMAP_TX_UNLOCK, i); } } @@ -1447,13 +1440,13 @@ netmap_poll(__unused struct cdev *dev, i for (i = priv->np_qfirst; i < priv->np_qlast; i++) { kring = &na->rx_rings[i]; if (core_lock == NEED_CL) { - na->nm_lock(adapter, NETMAP_CORE_LOCK, 0); + na->nm_lock(ifp, NETMAP_CORE_LOCK, 0); core_lock = LOCKED_CL; } if (na->separate_locks) - na->nm_lock(adapter, NETMAP_RX_LOCK, i); + na->nm_lock(ifp, NETMAP_RX_LOCK, i); - if (na->nm_rxsync(adapter, i, 0 /* no lock */)) + if (na->nm_rxsync(ifp, i, 0 /* no lock */)) revents |= POLLERR; if (netmap_no_timestamp == 0 || kring->ring->flags & NR_TIMESTAMP) { @@ -1465,7 +1458,7 @@ netmap_poll(__unused struct cdev *dev, i else if (!check_all) selrecord(td, &kring->si); if (na->separate_locks) - na->nm_lock(adapter, NETMAP_RX_UNLOCK, i); + na->nm_lock(ifp, NETMAP_RX_UNLOCK, i); } } if (check_all && revents == 0) { @@ -1476,7 +1469,7 @@ netmap_poll(__unused struct cdev *dev, i selrecord(td, &na->rx_rings[i].si); } if (core_lock == LOCKED_CL) - na->nm_lock(adapter, NETMAP_CORE_UNLOCK, 0); + na->nm_lock(ifp, NETMAP_CORE_UNLOCK, 0); return (revents); } @@ -1484,6 +1477,48 @@ netmap_poll(__unused struct cdev *dev, i /*------- driver support routines ------*/ /* + * default lock wrapper. On linux we use mostly netmap-specific locks. + */ +static void +netmap_lock_wrapper(struct ifnet *_a, int what, u_int queueid) +{ + struct netmap_adapter *na = NA(_a); + + switch (what) { +#ifndef __FreeBSD__ /* some system do not need lock on register */ + case NETMAP_REG_LOCK: + case NETMAP_REG_UNLOCK: + break; +#endif + + case NETMAP_CORE_LOCK: + mtx_lock(&na->core_lock); + break; + + case NETMAP_CORE_UNLOCK: + mtx_unlock(&na->core_lock); + break; + + case NETMAP_TX_LOCK: + mtx_lock(&na->tx_rings[queueid].q_lock); + break; + + case NETMAP_TX_UNLOCK: + mtx_unlock(&na->tx_rings[queueid].q_lock); + break; + + case NETMAP_RX_LOCK: + mtx_lock(&na->rx_rings[queueid].q_lock); + break; + + case NETMAP_RX_UNLOCK: + mtx_unlock(&na->rx_rings[queueid].q_lock); + break; + } +} + + +/* * Initialize a ``netmap_adapter`` object created by driver on attach. * We allocate a block of memory with room for a struct netmap_adapter * plus two sets of N+2 struct netmap_kring (where N is the number @@ -1500,6 +1535,7 @@ netmap_attach(struct netmap_adapter *na, int size = sizeof(*na) + 2 * n * sizeof(struct netmap_kring); void *buf; struct ifnet *ifp = na->ifp; + int i; if (ifp == NULL) { D("ifp not set, giving up"); @@ -1516,6 +1552,15 @@ netmap_attach(struct netmap_adapter *na, na->buff_size = NETMAP_BUF_SIZE; bcopy(na, buf, sizeof(*na)); ifp->if_capabilities |= IFCAP_NETMAP; + + na = buf; + if (na->nm_lock == NULL) + na->nm_lock = netmap_lock_wrapper; + mtx_init(&na->core_lock, "netmap core lock", NULL, MTX_DEF); + for (i = 0 ; i < num_queues; i++) + mtx_init(&na->tx_rings[i].q_lock, "netmap txq lock", NULL, MTX_DEF); + for (i = 0 ; i < num_queues; i++) + mtx_init(&na->rx_rings[i].q_lock, "netmap rxq lock", NULL, MTX_DEF); } D("%s for %s", buf ? "ok" : "failed", ifp->if_xname); @@ -1556,14 +1601,14 @@ netmap_start(struct ifnet *ifp, struct m { struct netmap_adapter *na = NA(ifp); struct netmap_kring *kring = &na->rx_rings[na->num_queues]; - u_int i, len = m->m_pkthdr.len; + u_int i, len = MBUF_LEN(m); int error = EBUSY, lim = kring->nkr_num_slots - 1; struct netmap_slot *slot; if (netmap_verbose & NM_VERB_HOST) D("%s packet %d len %d from the stack", ifp->if_xname, kring->nr_hwcur + kring->nr_hwavail, len); - na->nm_lock(ifp->if_softc, NETMAP_CORE_LOCK, 0); + na->nm_lock(ifp, NETMAP_CORE_LOCK, 0); if (kring->nr_hwavail >= lim) { D("stack ring %s full\n", ifp->if_xname); goto done; /* no space */ @@ -1586,7 +1631,7 @@ netmap_start(struct ifnet *ifp, struct m selwakeuppri(&kring->si, PI_NET); error = 0; done: - na->nm_lock(ifp->if_softc, NETMAP_CORE_UNLOCK, 0); + na->nm_lock(ifp, NETMAP_CORE_UNLOCK, 0); /* release the mbuf in either cases of success or failure. As an * alternative, put the mbuf in a free list and free the list @@ -1645,6 +1690,48 @@ netmap_reset(struct netmap_adapter *na, /* + * Default functions to handle rx/tx interrupts + * we have 4 cases: + * 1 ring, single lock: + * lock(core); wake(i=0); unlock(core) + * N rings, single lock: + * lock(core); wake(i); wake(N+1) unlock(core) + * 1 ring, separate locks: (i=0) + * lock(i); wake(i); unlock(i) + * N rings, separate locks: + * lock(i); wake(i); unlock(i); lock(core) wake(N+1) unlock(core) + */ +int netmap_rx_irq(struct ifnet *ifp, int q, int *work_done) +{ + struct netmap_adapter *na; + struct netmap_kring *r; + + if (!(ifp->if_capenable & IFCAP_NETMAP)) + return 0; + na = NA(ifp); + r = work_done ? na->rx_rings : na->tx_rings; + if (na->separate_locks) { + mtx_lock(&r[q].q_lock); + selwakeuppri(&r[q].si, PI_NET); + mtx_unlock(&r[q].q_lock); + if (na->num_queues > 1) { + mtx_lock(&na->core_lock); + selwakeuppri(&r[na->num_queues + 1].si, PI_NET); + mtx_unlock(&na->core_lock); + } + } else { + mtx_lock(&na->core_lock); + selwakeuppri(&r[q].si, PI_NET); + if (na->num_queues > 1) + selwakeuppri(&r[na->num_queues + 1].si, PI_NET); + mtx_unlock(&na->core_lock); + } + if (work_done) + *work_done = 1; /* do not fire napi again */ + return 1; +} + +/* * Module loader. * * Create the /dev/netmap device and initialize all global Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Mon Feb 13 18:54:15 2012 (r231593) +++ head/sys/dev/netmap/netmap_kern.h Mon Feb 13 18:56:34 2012 (r231594) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Matteo Landi, Luigi Rizzo. All rights reserved. + * Copyright (C) 2011-2012 Matteo Landi, Luigi Rizzo. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,6 +34,20 @@ #ifndef _NET_NETMAP_KERN_H_ #define _NET_NETMAP_KERN_H_ +#if defined(__FreeBSD__) +#define NM_LOCK_T struct mtx +#define NM_SELINFO_T struct selinfo +#define MBUF_LEN(m) ((m)->m_pkthdr.len) +#define NM_SEND_UP(ifp, m) ((ifp)->if_input)(ifp, m) +#elif defined (__linux__) +#define NM_LOCK_T spinlock_t +#define NM_SELINFO_T wait_queue_head_t +#define MBUF_LEN(m) ((m)->len) +#define NM_SEND_UP(ifp, m) netif_rx(m) +#else +#error unsupported platform +#endif + #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_NETMAP); #endif @@ -53,11 +67,10 @@ struct netmap_adapter; /* * private, kernel view of a ring. * - * XXX 20110627-todo - * The index in the NIC and netmap ring is offset by nkr_hwofs slots. + * The indexes in the NIC and netmap rings are offset by nkr_hwofs slots. * This is so that, on a reset, buffers owned by userspace are not * modified by the kernel. In particular: - * RX rings: the next empty buffer (hwcur + hwavail + hwofs) coincides + * RX rings: the next empty buffer (hwcur + hwavail + hwofs) coincides with * the next empty buffer as known by the hardware (next_to_check or so). * TX rings: hwcur + hwofs coincides with next_to_send */ @@ -70,12 +83,13 @@ struct netmap_kring { u_int nkr_num_slots; int nkr_hwofs; /* offset between NIC and netmap ring */ - struct netmap_adapter *na; // debugging - struct selinfo si; /* poll/select wait queue */ + struct netmap_adapter *na; + NM_SELINFO_T si; /* poll/select wait queue */ + NM_LOCK_T q_lock; /* used if no device lock available */ } __attribute__((__aligned__(64))); /* - * This struct is part of and extends the 'struct adapter' (or + * This struct extends the 'struct adapter' (or * equivalent) device descriptor. It contains all fields needed to * support netmap operation. */ @@ -93,9 +107,9 @@ struct netmap_adapter { u_int num_tx_desc; /* number of descriptor in each queue */ u_int num_rx_desc; - u_int buff_size; + u_int buff_size; - u_int flags; + //u_int flags; // XXX unused /* tx_rings and rx_rings are private but allocated * as a contiguous chunk of memory. Each array has * N+1 entries, for the adapter queues and for the host queue. @@ -107,7 +121,7 @@ struct netmap_adapter { * packets from the network stack when netmap is active. * XXX probably if_qflush is not necessary. */ - void (*if_qflush)(struct ifnet *); + //void (*if_qflush)(struct ifnet *); // XXX unused int (*if_transmit)(struct ifnet *, struct mbuf *); /* references to the ifnet and device routines, used by @@ -115,10 +129,12 @@ struct netmap_adapter { */ struct ifnet *ifp; /* adapter is ifp->if_softc */ + NM_LOCK_T core_lock; /* used if no device lock available */ + int (*nm_register)(struct ifnet *, int onoff); - void (*nm_lock)(void *, int what, u_int ringid); - int (*nm_txsync)(void *, u_int ring, int lock); - int (*nm_rxsync)(void *, u_int ring, int lock); + void (*nm_lock)(struct ifnet *, int what, u_int ringid); + int (*nm_txsync)(struct ifnet *, u_int ring, int lock); + int (*nm_rxsync)(struct ifnet *, u_int ring, int lock); }; /* @@ -144,6 +160,12 @@ enum { NETMAP_CORE_LOCK, NETMAP_CORE_UNLOCK, NETMAP_TX_LOCK, NETMAP_TX_UNLOCK, NETMAP_RX_LOCK, NETMAP_RX_UNLOCK, +#ifdef __FreeBSD__ +#define NETMAP_REG_LOCK NETMAP_CORE_LOCK +#define NETMAP_REG_UNLOCK NETMAP_CORE_UNLOCK +#else + NETMAP_REG_LOCK, NETMAP_REG_UNLOCK +#endif }; /* @@ -251,4 +273,11 @@ PNMB(struct netmap_slot *slot, uint64_t return ret; } +/* default functions to handle rx/tx interrupts */ +int netmap_rx_irq(struct ifnet *, int, int *); +#define netmap_tx_irq(_n, _q) netmap_rx_irq(_n, _q, NULL) +#ifdef __linux__ +#define bus_dmamap_sync(_a, _b, _c) // wmb() or rmb() ? +netdev_tx_t netmap_start_linux(struct sk_buff *skb, struct net_device *dev); +#endif #endif /* _NET_NETMAP_KERN_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 19:35:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67BB61065674; Mon, 13 Feb 2012 19:35:36 +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 574228FC18; Mon, 13 Feb 2012 19:35:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1DJZaa1058471; Mon, 13 Feb 2012 19:35:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1DJZaQX058469; Mon, 13 Feb 2012 19:35:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202131935.q1DJZaQX058469@svn.freebsd.org> From: John Baldwin Date: Mon, 13 Feb 2012 19:35: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: r231603 - head/sys/dev/oce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 19:35:36 -0000 Author: jhb Date: Mon Feb 13 19:35:35 2012 New Revision: 231603 URL: http://svn.freebsd.org/changeset/base/231603 Log: Use if_maddr_*lock() routines to lock the per-interface multicast address list rather than manipulating the lock directly. Modified: head/sys/dev/oce/oce_hw.c Modified: head/sys/dev/oce/oce_hw.c ============================================================================== --- head/sys/dev/oce/oce_hw.c Mon Feb 13 19:31:32 2012 (r231602) +++ head/sys/dev/oce/oce_hw.c Mon Feb 13 19:35:35 2012 (r231603) @@ -558,7 +558,7 @@ oce_hw_update_multicast(POCE_SOFTC sc) bzero(req, sizeof(struct mbx_set_common_iface_multicast)); #if __FreeBSD_version > 800000 - IF_ADDR_RLOCK(ifp); + if_maddr_rlock(ifp); #endif TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -578,7 +578,7 @@ oce_hw_update_multicast(POCE_SOFTC sc) req->params.req.num_mac = req->params.req.num_mac + 1; } #if __FreeBSD_version > 800000 - IF_ADDR_RUNLOCK(ifp); + if_maddr_runlock(ifp); #endif req->params.req.if_id = sc->if_id; rc = oce_update_multicast(sc, &dma); From owner-svn-src-head@FreeBSD.ORG Mon Feb 13 23:02:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B13A106567C; Mon, 13 Feb 2012 23:02:51 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 762888FC12; Mon, 13 Feb 2012 23:02:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1DN2pm2066314; Mon, 13 Feb 2012 23:02:51 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1DN2pWw066312; Mon, 13 Feb 2012 23:02:51 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201202132302.q1DN2pWw066312@svn.freebsd.org> From: Christian Brueffer Date: Mon, 13 Feb 2012 23:02: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: r231615 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 23:02:51 -0000 Author: brueffer Date: Mon Feb 13 23:02:51 2012 New Revision: 231615 URL: http://svn.freebsd.org/changeset/base/231615 Log: Minor cleanup and added missing svn keywords. Modified: head/share/man/man4/isci.4 (contents, props changed) Modified: head/share/man/man4/isci.4 ============================================================================== --- head/share/man/man4/isci.4 Mon Feb 13 21:07:48 2012 (r231614) +++ head/share/man/man4/isci.4 Mon Feb 13 23:02:51 2012 (r231615) @@ -57,7 +57,7 @@ The .Nm driver provides support for Intel C600 .Tn SAS -controller. +controllers. .Sh CONFIGURATION To force legacy interrupts for all .Nm @@ -77,9 +77,11 @@ hw.isci.debug_level variable to a value between 1 and 4 in .Xr loader.conf 5 . .Pp -The hardware layer in the isci driver has extensive logging capabilities -which are disabled by default for performance reasons. These can be enabled -by adding +The hardware layer in the +.Nm +driver has extensive logging capabilities +which are disabled by default for performance reasons. +These can be enabled by adding .Bd -literal -offset indent options ISCI_LOGGING .Ed @@ -91,7 +93,7 @@ to the kernel configuration file. .Xr da 4 , .Xr pci 4 , .Xr sa 4 , -.Xr scsi 4 . +.Xr scsi 4 .Sh HISTORY The .Nm From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 00:12:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D2E81065670; Tue, 14 Feb 2012 00:12:15 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BC938FC14; Tue, 14 Feb 2012 00:12:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1E0CFiG068614; Tue, 14 Feb 2012 00:12:15 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1E0CFVx068611; Tue, 14 Feb 2012 00:12:15 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202140012.q1E0CFVx068611@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 14 Feb 2012 00:12: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: r231616 - head/lib/libc/arm/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 00:12:15 -0000 Author: gonzo Date: Tue Feb 14 00:12:15 2012 New Revision: 231616 URL: http://svn.freebsd.org/changeset/base/231616 Log: Add __aeabi_read_tp function required for thread-local storage Reviewed by: cognet Added: head/lib/libc/arm/gen/__aeabi_read_tp.c (contents, props changed) Modified: head/lib/libc/arm/gen/Makefile.inc Modified: head/lib/libc/arm/gen/Makefile.inc ============================================================================== --- head/lib/libc/arm/gen/Makefile.inc Mon Feb 13 23:02:51 2012 (r231615) +++ head/lib/libc/arm/gen/Makefile.inc Tue Feb 14 00:12:15 2012 (r231616) @@ -3,4 +3,4 @@ SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \ getcontextx.c infinity.c ldexp.c makecontext.c \ - setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c + __aeabi_read_tp.c setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c Added: head/lib/libc/arm/gen/__aeabi_read_tp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/gen/__aeabi_read_tp.c Tue Feb 14 00:12:15 2012 (r231616) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "machine/sysarch.h" + +void * +__aeabi_read_tp() +{ + void **_tp = (void **)ARM_TP_ADDRESS; + + return (*_tp); +} From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 00:12:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7979F106566B; Tue, 14 Feb 2012 00:12:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 644768FC1C; Tue, 14 Feb 2012 00:12:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1E0CtFk068668; Tue, 14 Feb 2012 00:12:55 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1E0Ctr8068666; Tue, 14 Feb 2012 00:12:55 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202140012.q1E0Ctr8068666@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 14 Feb 2012 00: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: r231617 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 00:12:55 -0000 Author: gonzo Date: Tue Feb 14 00:12:55 2012 New Revision: 231617 URL: http://svn.freebsd.org/changeset/base/231617 Log: Add ARM relocations types used for thread-local storage Reviewed by: cognet Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Tue Feb 14 00:12:15 2012 (r231616) +++ head/sys/sys/elf_common.h Tue Feb 14 00:12:55 2012 (r231617) @@ -633,6 +633,10 @@ typedef struct { #define R_ARM_THM_SWI8 14 #define R_ARM_XPC25 15 #define R_ARM_THM_XPC22 16 +/* TLS relocations */ +#define R_ARM_TLS_DTPMOD32 17 /* ID of module containing symbol */ +#define R_ARM_TLS_DTPOFF32 18 /* Offset in TLS block */ +#define R_ARM_TLS_TPOFF32 19 /* Offset in static TLS block */ #define R_ARM_COPY 20 /* Copy data from shared object. */ #define R_ARM_GLOB_DAT 21 /* Set GOT entry to data address. */ #define R_ARM_JUMP_SLOT 22 /* Set GOT entry to code address. */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 00:16:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D54C31065675; Tue, 14 Feb 2012 00:16:34 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF9E28FC15; Tue, 14 Feb 2012 00:16:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1E0GYuB068826; Tue, 14 Feb 2012 00:16:34 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1E0GYVQ068822; Tue, 14 Feb 2012 00:16:34 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202140016.q1E0GYVQ068822@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 14 Feb 2012 00:16: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: r231618 - in head/libexec/rtld-elf: . arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 00:16:34 -0000 Author: gonzo Date: Tue Feb 14 00:16:34 2012 New Revision: 231618 URL: http://svn.freebsd.org/changeset/base/231618 Log: Add thread-local storage support for ARM to rtld-elf Reviewed by: cognet Obtained from: NetBSD Modified: head/libexec/rtld-elf/arm/reloc.c head/libexec/rtld-elf/arm/rtld_machdep.h head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/arm/reloc.c ============================================================================== --- head/libexec/rtld-elf/arm/reloc.c Tue Feb 14 00:12:55 2012 (r231617) +++ head/libexec/rtld-elf/arm/reloc.c Tue Feb 14 00:16:34 2012 (r231618) @@ -10,6 +10,9 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include "machine/sysarch.h" + #include "debug.h" #include "rtld.h" @@ -233,6 +236,63 @@ reloc_nonplt_object(Obj_Entry *obj, cons dbg("COPY (avoid in main)"); break; + case R_ARM_TLS_DTPOFF32: + def = find_symdef(symnum, obj, &defobj, false, cache, + lockstate); + if (def == NULL) + return -1; + + tmp = (Elf_Addr)(def->st_value); + if (__predict_true(RELOC_ALIGNED_P(where))) + *where = tmp; + else + store_ptr(where, tmp); + + dbg("TLS_DTPOFF32 %s in %s --> %p", + obj->strtab + obj->symtab[symnum].st_name, + obj->path, (void *)tmp); + + break; + case R_ARM_TLS_DTPMOD32: + def = find_symdef(symnum, obj, &defobj, false, cache, + lockstate); + if (def == NULL) + return -1; + + tmp = (Elf_Addr)(defobj->tlsindex); + if (__predict_true(RELOC_ALIGNED_P(where))) + *where = tmp; + else + store_ptr(where, tmp); + + dbg("TLS_DTPMOD32 %s in %s --> %p", + obj->strtab + obj->symtab[symnum].st_name, + obj->path, (void *)tmp); + + break; + + case R_ARM_TLS_TPOFF32: + def = find_symdef(symnum, obj, &defobj, false, cache, + lockstate); + if (def == NULL) + return -1; + + if (!defobj->tls_done && allocate_tls_offset(obj)) + return -1; + + /* XXX: FIXME */ + tmp = (Elf_Addr)def->st_value + defobj->tlsoffset + + TLS_TCB_SIZE; + if (__predict_true(RELOC_ALIGNED_P(where))) + *where = tmp; + else + store_ptr(where, tmp); + dbg("TLS_TPOFF32 %s in %s --> %p", + obj->strtab + obj->symtab[symnum].st_name, + obj->path, (void *)tmp); + break; + + default: dbg("sym = %lu, type = %lu, offset = %p, " "contents = %p, symbol = %s", @@ -369,11 +429,26 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr void allocate_initial_tls(Obj_Entry *objs) { - + void **_tp = (void **)ARM_TP_ADDRESS; + + /* + * Fix the size of the static TLS block by using the maximum + * offset allocated so far and adding a bit for dynamic modules to + * use. + */ + + tls_static_space = tls_last_offset + tls_last_size + RTLD_STATIC_TLS_EXTRA; + + (*_tp) = (void *) allocate_tls(objs, NULL, TLS_TCB_SIZE, 8); } void * __tls_get_addr(tls_index* ti) { - return (NULL); + void **_tp = (void **)ARM_TP_ADDRESS; + char *p; + + p = tls_get_addr_common((Elf_Addr **)(*_tp), ti->ti_module, ti->ti_offset); + + return (p); } Modified: head/libexec/rtld-elf/arm/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/arm/rtld_machdep.h Tue Feb 14 00:12:55 2012 (r231617) +++ head/libexec/rtld-elf/arm/rtld_machdep.h Tue Feb 14 00:16:34 2012 (r231618) @@ -48,20 +48,20 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, #define call_initfini_pointer(obj, target) \ (((InitFunc)(target))()) +#define TLS_TCB_SIZE 8 typedef struct { unsigned long ti_module; unsigned long ti_offset; } tls_index; #define round(size, align) \ - (((size) + (align) - 1) & ~((align) - 1)) + (((size) + (align) - 1) & ~((align) - 1)) #define calculate_first_tls_offset(size, align) \ - round(size, align) + round(8, align) #define calculate_tls_offset(prev_offset, prev_size, size, align) \ - round(prev_offset + prev_size, align) + round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) - /* * Lazy binding entry point, called via PLT. */ Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Feb 14 00:12:55 2012 (r231617) +++ head/libexec/rtld-elf/rtld.c Tue Feb 14 00:16:34 2012 (r231618) @@ -3542,9 +3542,7 @@ tls_get_addr_common(Elf_Addr** dtvp, int return (void*) (dtv[index + 1] + offset); } -/* XXX not sure what variants to use for arm. */ - -#if defined(__ia64__) || defined(__powerpc__) || defined(__mips__) +#if defined(__arm__) || defined(__ia64__) || defined(__mips__) || defined(__powerpc__) /* * Allocate Static TLS using the Variant I method. @@ -3625,8 +3623,7 @@ free_tls(void *tcb, size_t tcbsize, size #endif -#if defined(__i386__) || defined(__amd64__) || defined(__sparc64__) || \ - defined(__arm__) +#if defined(__i386__) || defined(__amd64__) || defined(__sparc64__) /* * Allocate Static TLS using the Variant II method. From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 00:17:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A39601065674; Tue, 14 Feb 2012 00:17:43 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2A68FC16; Tue, 14 Feb 2012 00:17:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1E0HhKa068899; Tue, 14 Feb 2012 00:17:43 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1E0Hh0k068896; Tue, 14 Feb 2012 00:17:43 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202140017.q1E0Hh0k068896@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 14 Feb 2012 00:17: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: r231619 - in head/lib/libthr/arch/arm: arm include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 00:17:43 -0000 Author: gonzo Date: Tue Feb 14 00:17:43 2012 New Revision: 231619 URL: http://svn.freebsd.org/changeset/base/231619 Log: Add thread-local storage support for arm: - Switch to Variant I TCB layout - Use function from rtld for TCB allocation/deallocation Modified: head/lib/libthr/arch/arm/arm/pthread_md.c head/lib/libthr/arch/arm/include/pthread_md.h Modified: head/lib/libthr/arch/arm/arm/pthread_md.c ============================================================================== --- head/lib/libthr/arch/arm/arm/pthread_md.c Tue Feb 14 00:16:34 2012 (r231618) +++ head/lib/libthr/arch/arm/arm/pthread_md.c Tue Feb 14 00:17:43 2012 (r231619) @@ -37,14 +37,17 @@ _tcb_ctor(struct pthread *thread, int in { struct tcb *tcb; - tcb = malloc(sizeof(struct tcb)); + tcb = _rtld_allocate_tls((initial) ? _tcb_get() : NULL, + sizeof(struct tcb), 16); if (tcb) tcb->tcb_thread = thread; + return (tcb); } void _tcb_dtor(struct tcb *tcb) { - free(tcb); + + _rtld_free_tls(tcb, sizeof(struct tcb), 16); } Modified: head/lib/libthr/arch/arm/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/arm/include/pthread_md.h Tue Feb 14 00:16:34 2012 (r231618) +++ head/lib/libthr/arch/arm/include/pthread_md.h Tue Feb 14 00:17:43 2012 (r231619) @@ -43,10 +43,8 @@ * Variant II tcb, first two members are required by rtld. */ struct tcb { - struct tcb *tcb_self; /* required by rtld */ void *tcb_dtv; /* required by rtld */ struct pthread *tcb_thread; /* our hook */ - void *tcb_spare[1]; }; /* From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 00:18:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A21CE106567D; Tue, 14 Feb 2012 00:18:18 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CB228FC17; Tue, 14 Feb 2012 00:18:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1E0II3b068962; Tue, 14 Feb 2012 00:18:18 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1E0IIdu068960; Tue, 14 Feb 2012 00:18:18 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202140018.q1E0IIdu068960@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 14 Feb 2012 00:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231620 - head/gnu/usr.bin/cc/cc_tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 00:18:18 -0000 Author: gonzo Date: Tue Feb 14 00:18:18 2012 New Revision: 231620 URL: http://svn.freebsd.org/changeset/base/231620 Log: Enable TLS support for ARM toolchain Reviewed by: cognet Modified: head/gnu/usr.bin/cc/cc_tools/auto-host.h Modified: head/gnu/usr.bin/cc/cc_tools/auto-host.h ============================================================================== --- head/gnu/usr.bin/cc/cc_tools/auto-host.h Tue Feb 14 00:17:43 2012 (r231619) +++ head/gnu/usr.bin/cc/cc_tools/auto-host.h Tue Feb 14 00:18:18 2012 (r231620) @@ -287,10 +287,8 @@ /* Define if your assembler supports thread-local storage. */ #ifndef USED_FOR_TARGET -#if !defined(__arm__) #define HAVE_AS_TLS 1 #endif -#endif /* Define to 1 if you have the `atoll' function. */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 00:18:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED10F106564A; Tue, 14 Feb 2012 00:18:35 +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 D7B178FC12; Tue, 14 Feb 2012 00:18:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1E0IZHk069008; Tue, 14 Feb 2012 00:18:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1E0IZW2069006; Tue, 14 Feb 2012 00:18:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202140018.q1E0IZW2069006@svn.freebsd.org> From: Marius Strobl Date: Tue, 14 Feb 2012 00:18: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: r231621 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 00:18:36 -0000 Author: marius Date: Tue Feb 14 00:18:35 2012 New Revision: 231621 URL: http://svn.freebsd.org/changeset/base/231621 Log: - As it turns out, MSI-X is broken for at least LSI SAS1068E when passed through by VMware so blacklist their PCI-PCI bridge for MSI/MSI-X here. Note that besides currently there not being a quirk type that disables MSI-X only and there's no evidence that MSI doesn't work with the VMware pass-through, it's really questionable whether MSI generally works in that setup as VMware only mention three know working devices [1, p. 4]. Also not that this quirk entry currently doesn't affect the devices emulated by VMware in any way as these don't claim support MSI/MSI-X to begin with. [2] While at it, make the PCI quirk table const and static. - Remove some duplicated empty lines. - Use DEVMETHOD_END. PR: 163812, http://forums.freebsd.org/showthread.php?t=27899 [2] Reviewed by: jhb MFC after: 3 days Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Feb 14 00:18:18 2012 (r231620) +++ head/sys/dev/pci/pci.c Tue Feb 14 00:18:35 2012 (r231621) @@ -73,7 +73,6 @@ __FBSDID("$FreeBSD$"); #define PCIR_IS_BIOS(cfg, reg) \ (((cfg)->hdrtype == PCIM_HDRTYPE_NORMAL && reg == PCIR_BIOS) || \ ((cfg)->hdrtype == PCIM_HDRTYPE_BRIDGE && reg == PCIR_BIOS_1)) - static pci_addr_t pci_mapbase(uint64_t mapreg); static const char *pci_maptype(uint64_t mapreg); @@ -171,7 +170,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(pci_msi_count, pci_msi_count_method), DEVMETHOD(pci_msix_count, pci_msix_count_method), - { 0, 0 } + DEVMETHOD_END }; DEFINE_CLASS_0(pci, pci_driver, pci_methods, 0); @@ -183,7 +182,6 @@ MODULE_VERSION(pci, 1); static char *pci_vendordata; static size_t pci_vendordata_size; - struct pci_quirk { uint32_t devid; /* Vendor/device of the card */ int type; @@ -194,7 +192,7 @@ struct pci_quirk { int arg2; }; -struct pci_quirk pci_quirks[] = { +static const struct pci_quirk const pci_quirks[] = { /* The Intel 82371AB and 82443MX has a map register at offset 0x90. */ { 0x71138086, PCI_QUIRK_MAP_REG, 0x90, 0 }, { 0x719b8086, PCI_QUIRK_MAP_REG, 0x90, 0 }, @@ -227,6 +225,12 @@ struct pci_quirk pci_quirks[] = { { 0x74501022, PCI_QUIRK_DISABLE_MSI, 0, 0 }, /* + * MSI-X doesn't work with at least LSI SAS1068E passed through by + * VMware. + */ + { 0x079015ad, PCI_QUIRK_DISABLE_MSI, 0, 0 }, + + /* * Some virtualization environments emulate an older chipset * but support MSI just fine. QEMU uses the Intel 82440. */ @@ -724,7 +728,6 @@ pci_read_cap(device_t pcib, pcicfgregs * } } - #if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) /* * Enable the MSI mapping window for all HyperTransport @@ -1873,7 +1876,7 @@ pci_remap_intr_method(device_t bus, devi int pci_msi_device_blacklisted(device_t dev) { - struct pci_quirk *q; + const struct pci_quirk *q; if (!pci_honor_msi_blacklist) return (0); @@ -1893,7 +1896,7 @@ pci_msi_device_blacklisted(device_t dev) static int pci_msi_vm_chipset(device_t dev) { - struct pci_quirk *q; + const struct pci_quirk *q; for (q = &pci_quirks[0]; q->devid; q++) { if (q->devid == pci_get_devid(dev) && @@ -3023,7 +3026,7 @@ pci_add_resources(device_t bus, device_t struct pci_devinfo *dinfo = device_get_ivars(dev); pcicfgregs *cfg = &dinfo->cfg; struct resource_list *rl = &dinfo->resources; - struct pci_quirk *q; + const struct pci_quirk *q; int i; /* ATA devices needs special map treatment */ @@ -3864,7 +3867,6 @@ pci_write_ivar(device_t dev, device_t ch } } - #include "opt_ddb.h" #ifdef DDB #include @@ -4021,7 +4023,6 @@ out:; return (res); } - struct resource * pci_alloc_resource(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 00:40:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F808106566B; Tue, 14 Feb 2012 00:40:08 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 76BB08FC13; Tue, 14 Feb 2012 00:40:07 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q1E0e6CY019542; Tue, 14 Feb 2012 01:40:06 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q1E0e5Pn019541; Tue, 14 Feb 2012 01:40:05 +0100 (CET) (envelope-from marius) Date: Tue, 14 Feb 2012 01:40:05 +0100 From: Marius Strobl To: Oleksandr Tymoshenko Message-ID: <20120214004005.GC18227@alchemy.franken.de> References: <201202140018.q1E0IIdu068960@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201202140018.q1E0IIdu068960@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231620 - head/gnu/usr.bin/cc/cc_tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 00:40:08 -0000 On Tue, Feb 14, 2012 at 12:18:18AM +0000, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Tue Feb 14 00:18:18 2012 > New Revision: 231620 > URL: http://svn.freebsd.org/changeset/base/231620 > > Log: > Enable TLS support for ARM toolchain > FYI, for the toolchain TLS support apparently should also be enabled in gnu/lib/libgomp/config.h and gnu/lib/libstdc++/config.h. Marius From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 00:54:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E219106564A; Tue, 14 Feb 2012 00:54: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 585BA8FC08; Tue, 14 Feb 2012 00:54:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1E0secg070200; Tue, 14 Feb 2012 00:54:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1E0sejK070198; Tue, 14 Feb 2012 00:54:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201202140054.q1E0sejK070198@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 14 Feb 2012 00:54: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: r231622 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 00:54:40 -0000 Author: yongari Date: Tue Feb 14 00:54:40 2012 New Revision: 231622 URL: http://svn.freebsd.org/changeset/base/231622 Log: For RTL8168/8111D controller, make sure to wake PHY from power down mode. Otherwise, PHY access times out under certain conditions. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Feb 14 00:18:35 2012 (r231621) +++ head/sys/dev/re/if_re.c Tue Feb 14 00:54:40 2012 (r231622) @@ -1433,11 +1433,16 @@ re_attach(device_t dev) sc->rl_flags |= RL_FLAG_MACSLEEP; /* FALLTHROUGH */ case RL_HWREV_8168CP: - case RL_HWREV_8168D: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 | RL_FLAG_WOL_MANLINK; break; + case RL_HWREV_8168D: + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | + RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | + RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 | + RL_FLAG_WOL_MANLINK; + break; case RL_HWREV_8168DP: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_AUTOPAD | From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 02:03:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 653691065677; Tue, 14 Feb 2012 02:03:17 +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 4FAD68FC1A; Tue, 14 Feb 2012 02:03:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1E23HU2072835; Tue, 14 Feb 2012 02:03:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1E23HYv072833; Tue, 14 Feb 2012 02:03:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202140203.q1E23HYv072833@svn.freebsd.org> From: Xin LI Date: Tue, 14 Feb 2012 02:03: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: r231632 - head/lib/libc/locale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 02:03:17 -0000 Author: delphij Date: Tue Feb 14 02:03:17 2012 New Revision: 231632 URL: http://svn.freebsd.org/changeset/base/231632 Log: wctob() returns EOF and not WEOF. Noticed by: Zhihao Yuan MFC after: 1 week Modified: head/lib/libc/locale/btowc.3 Modified: head/lib/libc/locale/btowc.3 ============================================================================== --- head/lib/libc/locale/btowc.3 Tue Feb 14 01:15:46 2012 (r231631) +++ head/lib/libc/locale/btowc.3 Tue Feb 14 02:03:17 2012 (r231632) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 3, 2002 +.Dd February 13, 2012 .Dt BTOWC 3 .Os .Sh NAME @@ -58,7 +58,7 @@ If the wide character is or not able to be represented as a single byte in the initial shift state, .Fn wctob returns -.Dv WEOF . +.Dv EOF . .Sh SEE ALSO .Xr mbrtowc 3 , .Xr multibyte 3 , From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 04:19:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F254106566B; Tue, 14 Feb 2012 04:19:00 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3ED428FC14; Tue, 14 Feb 2012 04:19:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1E4J0gk077287; Tue, 14 Feb 2012 04:19:00 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1E4J0Hx077286; Tue, 14 Feb 2012 04:19:00 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201202140419.q1E4J0Hx077286@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 14 Feb 2012 04:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231634 - head/tools/test/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 04:19:00 -0000 Author: gnn Date: Tue Feb 14 04:18:59 2012 New Revision: 231634 URL: http://svn.freebsd.org/changeset/base/231634 Log: Add a rudimentary test to run through all the available counters on a system and then execute a program with pmcstat in counting mode. The program will verify that all counters fire and that the code neither panics the system nor locks it up. This should be considered a first pass conformance test for new sets of counters being added to hwpmc(4). Added: head/tools/test/hwpmc/ head/tools/test/hwpmc/pmctest.py (contents, props changed) Added: head/tools/test/hwpmc/pmctest.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/hwpmc/pmctest.py Tue Feb 14 04:18:59 2012 (r231634) @@ -0,0 +1,79 @@ +#!/usr/bin/env python +# Copyright (c) 2012, Neville-Neil Consulting +# 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 Neville-Neil Consulting 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 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. +# +# Author: George V. Neville-Neil +# +# $FreeBSD$ + +# Description: A program to run a simple program against every available +# pmc counter present in a system. +# +# To use: +# +# pmctest.py ls > /dev/null +# +# This should result in ls being run with every available counter +# and the system should neither lock up nor panic. + +import sys +import subprocess +from subprocess import PIPE + +# A list of strings that are not really counters, just +# name tags that are output by pmccontrol -L +notcounter = ["IAF", "IAP", "TSC", "UNC", "UCF"] + +def main(): + + if (len(sys.argv) != 2): + print ("usage: pmctest.py program") + + program = sys.argv[1] + + p = subprocess.Popen(["pmccontrol", "-L"], stdout=PIPE) + counters = p.communicate()[0] + + if len(counters) <= 0: + print "no counters found" + sys.exit() + + for counter in counters.split(): + if counter in notcounter: + continue + p = subprocess.Popen(["pmcstat", "-p", counter, program], stdout=PIPE) + result = p.communicate()[0] + print result + +# The canonical way to make a python module into a script. +# Remove if unnecessary. + +if __name__ == "__main__": + main() From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 07:14:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7737106566C; Tue, 14 Feb 2012 07:14:42 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1D758FC08; Tue, 14 Feb 2012 07:14:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1E7Eg71083744; Tue, 14 Feb 2012 07:14:42 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1E7Egm9083740; Tue, 14 Feb 2012 07:14:42 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201202140714.q1E7Egm9083740@svn.freebsd.org> From: Robert Millan Date: Tue, 14 Feb 2012 07:14: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: r231642 - in head: rescue/rescue sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 07:14:43 -0000 Author: rmh Date: Tue Feb 14 07:14:42 2012 New Revision: 231642 URL: http://svn.freebsd.org/changeset/base/231642 Log: Disable jail support in ifconfig when either building a rescue image or MK_JAIL knob has been set to "no". Reviewed by: bz Approved by: adrian (mentor) Modified: head/rescue/rescue/Makefile head/sbin/ifconfig/Makefile head/sbin/ifconfig/ifconfig.c Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Tue Feb 14 07:13:09 2012 (r231641) +++ head/rescue/rescue/Makefile Tue Feb 14 07:14:42 2012 (r231642) @@ -125,7 +125,7 @@ CRUNCH_LIBS+= -lipx .if ${MK_ZFS} != "no" CRUNCH_LIBS+= -lavl -lnvpair -lzfs -lpthread -luutil -lumem .endif -CRUNCH_LIBS+= -lgeom -lbsdxml -ljail -lkiconv -lmd -lsbuf -lufs -lz +CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lsbuf -lufs -lz .if ${MACHINE_CPUARCH} == "i386" CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Tue Feb 14 07:13:09 2012 (r231641) +++ head/sbin/ifconfig/Makefile Tue Feb 14 07:14:42 2012 (r231642) @@ -35,8 +35,8 @@ SRCS+= ifgre.c # GRE keys etc SRCS+= ifgif.c # GIF reversed header workaround SRCS+= ifieee80211.c regdomain.c # SIOC[GS]IEEE80211 support -DPADD+= ${LIBBSDXML} ${LIBJAIL} ${LIBSBUF} -LDADD+= -lbsdxml -ljail -lsbuf +DPADD+= ${LIBBSDXML} ${LIBSBUF} +LDADD+= -lbsdxml -lsbuf SRCS+= carp.c # SIOC[GS]VH support SRCS+= ifgroup.c # ... @@ -56,6 +56,11 @@ SRCS+= af_ipx.c # IPX support DPADD+= ${LIBIPX} LDADD+= -lipx .endif +.if ${MK_JAIL} != "no" && !defined(RELEASE_CRUNCH) && !defined(RESCUE) +CFLAGS+= -DJAIL +DPADD+= ${LIBJAIL} +LDADD+= -ljail +.endif MAN= ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Tue Feb 14 07:13:09 2012 (r231641) +++ head/sbin/ifconfig/ifconfig.c Tue Feb 14 07:14:42 2012 (r231642) @@ -66,7 +66,9 @@ static const char rcsid[] = #include #include #include +#ifdef JAIL #include +#endif #include #include #include @@ -255,6 +257,7 @@ main(int argc, char *argv[]) ifconfig(argc, argv, 1, NULL); exit(0); } +#ifdef JAIL /* * NOTE: We have to special-case the `-vnet' command * right here as we would otherwise fail when trying @@ -268,6 +271,7 @@ main(int argc, char *argv[]) ifconfig(argc, argv, 0, NULL); exit(0); } +#endif errx(1, "interface %s does not exist", ifname); } } @@ -688,6 +692,7 @@ deletetunnel(const char *vname, int para err(1, "SIOCDIFPHYADDR"); } +#ifdef JAIL static void setifvnet(const char *jname, int dummy __unused, int s, const struct afswtch *afp) @@ -715,6 +720,7 @@ setifrvnet(const char *jname, int dummy if (ioctl(s, SIOCSIFRVNET, &my_ifr) < 0) err(1, "SIOCSIFRVNET(%d, %s)", my_ifr.ifr_jid, my_ifr.ifr_name); } +#endif static void setifnetmask(const char *addr, int dummy __unused, int s, @@ -1173,8 +1179,10 @@ static struct cmd basic_cmds[] = { DEF_CMD_ARG2("tunnel", settunnel), DEF_CMD("-tunnel", 0, deletetunnel), DEF_CMD("deletetunnel", 0, deletetunnel), +#ifdef JAIL DEF_CMD_ARG("vnet", setifvnet), DEF_CMD_ARG("-vnet", setifrvnet), +#endif DEF_CMD("link0", IFF_LINK0, setifflags), DEF_CMD("-link0", -IFF_LINK0, setifflags), DEF_CMD("link1", IFF_LINK1, setifflags), From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 09:19:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A06E1065754; Tue, 14 Feb 2012 09:19:31 +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 03E898FC15; Tue, 14 Feb 2012 09:19:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1E9JU27088203; Tue, 14 Feb 2012 09:19:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1E9JUPm088201; Tue, 14 Feb 2012 09:19:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202140919.q1E9JUPm088201@svn.freebsd.org> From: Alexander Motin Date: Tue, 14 Feb 2012 09:19: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: r231647 - head/sys/dev/sound/pcm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 09:19:31 -0000 Author: mav Date: Tue Feb 14 09:19:30 2012 New Revision: 231647 URL: http://svn.freebsd.org/changeset/base/231647 Log: Do not handle MOD_SHUTDOWN equally to MOD_UNLOAD in sound kernel module. MOD_SHUTDOWN is not an end of existence, and there is a life after it. In particular, code previously called on MOD_SHUTDOWN grabbed lock and deallocated unit numbering. That caused infinite wait loop if snd_uaudio tried to destroy its PCM device after that point. MFC after: 3 days Modified: head/sys/dev/sound/pcm/sound.c Modified: head/sys/dev/sound/pcm/sound.c ============================================================================== --- head/sys/dev/sound/pcm/sound.c Tue Feb 14 09:12:08 2012 (r231646) +++ head/sys/dev/sound/pcm/sound.c Tue Feb 14 09:19:30 2012 (r231647) @@ -1415,7 +1415,6 @@ sound_modevent(module_t mod, int type, v pcmsg_unrhdr = new_unrhdr(1, INT_MAX, NULL); break; case MOD_UNLOAD: - case MOD_SHUTDOWN: ret = sndstat_acquire(curthread); if (ret != 0) break; @@ -1424,6 +1423,8 @@ sound_modevent(module_t mod, int type, v pcmsg_unrhdr = NULL; } break; + case MOD_SHUTDOWN: + break; default: ret = ENOTSUP; } From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 09:29:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A31A106566B; Tue, 14 Feb 2012 09:29:38 +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 55B748FC1B; Tue, 14 Feb 2012 09:29:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1E9TcBr088556; Tue, 14 Feb 2012 09:29:38 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1E9TcOa088554; Tue, 14 Feb 2012 09:29:38 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202140929.q1E9TcOa088554@svn.freebsd.org> From: Ed Schouten Date: Tue, 14 Feb 2012 09:29: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: r231648 - head/usr.sbin/vipw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 09:29:38 -0000 Author: ed Date: Tue Feb 14 09:29:37 2012 New Revision: 231648 URL: http://svn.freebsd.org/changeset/base/231648 Log: Restore message in man page on VFS timestamp precision. Requested by: bde, jhb Modified: head/usr.sbin/vipw/vipw.8 Modified: head/usr.sbin/vipw/vipw.8 ============================================================================== --- head/usr.sbin/vipw/vipw.8 Tue Feb 14 09:19:30 2012 (r231647) +++ head/usr.sbin/vipw/vipw.8 Tue Feb 14 09:29:37 2012 (r231648) @@ -28,7 +28,7 @@ .\" @(#)vipw.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 10, 2012 +.Dd February 14, 2012 .Dt VIPW 8 .Os .Sh NAME @@ -110,3 +110,13 @@ The .Nm utility appeared in .Bx 4.0 . +.Sh BUGS +The mechanism for checking for password file modifications requires that +the modification time of the password file changes. +This means that in a default configuration where file system timestamps +are not calculated with sub-second precision, +.Ev EDITOR +has to run for at least one second. +Non-interactive editor scripts should invoke +.Xr sleep 1 +or equivalent to ensure this happens. From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 10:11:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0183106564A; Tue, 14 Feb 2012 10:11:46 +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 83A018FC1F; Tue, 14 Feb 2012 10:11:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EABk5Q091895; Tue, 14 Feb 2012 10:11:46 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EABk4W091892; Tue, 14 Feb 2012 10:11:46 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202141011.q1EABk4W091892@svn.freebsd.org> From: Kevin Lo Date: Tue, 14 Feb 2012 10:11: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: r231651 - in head/usr.bin: chpass login X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 10:11:47 -0000 Author: kevlo Date: Tue Feb 14 10:11:45 2012 New Revision: 231651 URL: http://svn.freebsd.org/changeset/base/231651 Log: Remove unnecessary cast Modified: head/usr.bin/chpass/util.c head/usr.bin/login/login_fbtab.c Modified: head/usr.bin/chpass/util.c ============================================================================== --- head/usr.bin/chpass/util.c Tue Feb 14 09:42:02 2012 (r231650) +++ head/usr.bin/chpass/util.c Tue Feb 14 10:11:45 2012 (r231651) @@ -110,10 +110,10 @@ atot(char *p, time_t *store) } } } - if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t)) + if (!(t = strtok(NULL, " \t,")) || !isdigit(*t)) goto bad; day = atoi(t); - if (!(t = strtok((char *)NULL, " \t,")) || !isdigit(*t)) + if (!(t = strtok(NULL, " \t,")) || !isdigit(*t)) goto bad; year = atoi(t); if (day < 1 || day > 31 || month < 1 || month > 12) Modified: head/usr.bin/login/login_fbtab.c ============================================================================== --- head/usr.bin/login/login_fbtab.c Tue Feb 14 09:42:02 2012 (r231650) +++ head/usr.bin/login/login_fbtab.c Tue Feb 14 10:11:45 2012 (r231651) @@ -100,17 +100,17 @@ login_fbtab(char *tty, uid_t uid, gid_t if ((cp = devname = strtok(buf, WSPACE)) == 0) continue; /* empty or comment */ if (strncmp(devname, _PATH_DEV, sizeof _PATH_DEV - 1) != 0 - || (cp = strtok((char *) 0, WSPACE)) == 0 + || (cp = strtok(NULL, WSPACE)) == 0 || *cp != '0' || sscanf(cp, "%o", &prot) == 0 || prot == 0 || (prot & 0777) != prot - || (cp = strtok((char *) 0, WSPACE)) == 0) { + || (cp = strtok(NULL, WSPACE)) == 0) { syslog(LOG_ERR, "%s: bad entry: %s", table, cp ? cp : "(null)"); continue; } if (strcmp(devname + 5, tty) == 0) { - for (cp = strtok(cp, ":"); cp; cp = strtok((char *) 0, ":")) { + for (cp = strtok(cp, ":"); cp; cp = strtok(NULL, ":")) { login_protect(table, cp, prot, uid, gid); } } From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 10:11:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23EA1106578E; Tue, 14 Feb 2012 10:11:54 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 079288FC20; Tue, 14 Feb 2012 10:11:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EABrWF091938; Tue, 14 Feb 2012 10:11:53 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EABrNh091936; Tue, 14 Feb 2012 10:11:53 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201202141011.q1EABrNh091936@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 14 Feb 2012 10:11: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: r231652 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 10:11:54 -0000 Author: luigi Date: Tue Feb 14 10:11:53 2012 New Revision: 231652 URL: http://svn.freebsd.org/changeset/base/231652 Log: properly sort dev/oce entries Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 14 10:11:45 2012 (r231651) +++ head/sys/conf/files Tue Feb 14 10:11:53 2012 (r231652) @@ -1068,12 +1068,6 @@ dev/e1000/e1000_mbx.c optional em | igb compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_osdep.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/oce/oce_hw.c optional oce pci -dev/oce/oce_if.c optional oce pci -dev/oce/oce_mbox.c optional oce pci -dev/oce/oce_queue.c optional oce pci -dev/oce/oce_sysctl.c optional oce pci -dev/oce/oce_util.c optional oce pci dev/et/if_et.c optional et dev/en/if_en_pci.c optional en pci dev/en/midway.c optional en @@ -1555,6 +1549,12 @@ dev/nmdm/nmdm.c optional nmdm dev/nsp/nsp.c optional nsp dev/nsp/nsp_pccard.c optional nsp pccard dev/null/null.c standard +dev/oce/oce_hw.c optional oce pci +dev/oce/oce_if.c optional oce pci +dev/oce/oce_mbox.c optional oce pci +dev/oce/oce_queue.c optional oce pci +dev/oce/oce_sysctl.c optional oce pci +dev/oce/oce_util.c optional oce pci dev/patm/if_patm.c optional patm pci dev/patm/if_patm_attach.c optional patm pci dev/patm/if_patm_intr.c optional patm pci From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 10:17:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9FBD106566B; Tue, 14 Feb 2012 10:17:03 +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 D4B278FC1B; Tue, 14 Feb 2012 10:17:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EAH3Sx092425; Tue, 14 Feb 2012 10:17:03 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EAH3uh092423; Tue, 14 Feb 2012 10:17:03 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202141017.q1EAH3uh092423@svn.freebsd.org> From: Kevin Lo Date: Tue, 14 Feb 2012 10:17: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: r231654 - head/usr.sbin/pw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 10:17:04 -0000 Author: kevlo Date: Tue Feb 14 10:17:03 2012 New Revision: 231654 URL: http://svn.freebsd.org/changeset/base/231654 Log: readlink len-1 Modified: head/usr.sbin/pw/cpdir.c Modified: head/usr.sbin/pw/cpdir.c ============================================================================== --- head/usr.sbin/pw/cpdir.c Tue Feb 14 10:16:56 2012 (r231653) +++ head/usr.sbin/pw/cpdir.c Tue Feb 14 10:17:03 2012 (r231654) @@ -84,7 +84,7 @@ copymkdir(char const * dir, char const * if (strcmp(e->d_name, ".") != 0 && strcmp(e->d_name, "..") != 0) copymkdir(dst, src, st.st_mode & _DEF_DIRMODE, uid, gid); chflags(dst, st.st_flags); /* propagate flags */ - } else if (S_ISLNK(st.st_mode) && (len = readlink(src, lnk, sizeof(lnk))) != -1) { + } else if (S_ISLNK(st.st_mode) && (len = readlink(src, lnk, sizeof(lnk) - 1)) != -1) { lnk[len] = '\0'; symlink(lnk, dst); lchown(dst, uid, gid); From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 10:51:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 557351065673; Tue, 14 Feb 2012 10:51:25 +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 382068FC1E; Tue, 14 Feb 2012 10:51:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EApPUi094409; Tue, 14 Feb 2012 10:51:25 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EApOWC094392; Tue, 14 Feb 2012 10:51:24 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202141051.q1EApOWC094392@svn.freebsd.org> From: Doug Barton Date: Tue, 14 Feb 2012 10:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231667 - in head: etc etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 10:51:25 -0000 Author: dougb Date: Tue Feb 14 10:51:24 2012 New Revision: 231667 URL: http://svn.freebsd.org/changeset/base/231667 Log: Fix various issues with the NFS and RPC related scripts: 1. Add new functionality to the force_depend method to incorporate the tests for whether the service is enabled and/or already running. 2. Add a new option to bypass checking only that the service is enabled at boot time, and always check if it is running. 3. Use this new functionality to greatly simplify the rc.d scripts that use force_depend. 4. Add a force_depend for statd in lockd 5. Remove the check that either nfs_server or nfs_client is _enable'd from statd and lockd. This was always overkill, and prevented using the {one|force}start options, as well as stop'ing on the command line. 6. The yp* scripts had some of their arguments in various weird orders. Bring them into line with the model. 7. If mountd fails to create /var/db/mountdtab, err out. Ideas, suggestions, and/or review from delphij and jilles. Pointy hats are completely my responsibility however. Modified: head/etc/defaults/rc.conf head/etc/rc.d/amd head/etc/rc.d/apmd head/etc/rc.d/keyserv head/etc/rc.d/lockd head/etc/rc.d/mountd head/etc/rc.d/nfsd head/etc/rc.d/statd head/etc/rc.d/ypbind head/etc/rc.d/yppasswdd head/etc/rc.d/ypserv head/etc/rc.d/ypset head/etc/rc.d/ypupdated head/etc/rc.d/ypxfrd head/etc/rc.subr head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/defaults/rc.conf Tue Feb 14 10:51:24 2012 (r231667) @@ -29,6 +29,8 @@ early_late_divider="FILESYSTEMS" # Scrip # stages of the boot process. Make sure you know # the ramifications if you change this. # See rc.conf(5) for more details. +always_force_depends="NO" # Set to check that indicated dependencies are + # running during boot (can increase boot time). swapfile="NO" # Set to name of swapfile if aux swapfile desired. apm_enable="NO" # Set to YES to enable APM BIOS functions (or NO). Modified: head/etc/rc.d/amd ============================================================================== --- head/etc/rc.d/amd Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/rc.d/amd Tue Feb 14 10:51:24 2012 (r231667) @@ -19,15 +19,8 @@ extra_commands="reload" amd_precmd() { - if ! checkyesno nfs_client_enable; then - force_depend nfsclient || return 1 - fi - - if ! checkyesno rpcbind_enable && \ - ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then - force_depend rpcbind || return 1 - fi + force_depend nfsclient nfs_client || return 1 + force_depend rpcbind || return 1 case ${amd_map_program} in [Nn][Oo] | '') @@ -49,7 +42,6 @@ amd_precmd() command_args="> /var/run/amd.pid 2> /dev/null" ;; esac - return 0 } load_rc_config $name Modified: head/etc/rc.d/apmd ============================================================================== --- head/etc/rc.d/apmd Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/rc.d/apmd Tue Feb 14 10:51:24 2012 (r231667) @@ -19,24 +19,18 @@ apmd_prestart() { case `${SYSCTL_N} hw.machine_arch` in i386) - # Enable apm if it is not already enabled - if ! checkyesno apm_enable && \ - ! /etc/rc.d/apm forcestatus 1>/dev/null 2>&1 - then - force_depend apm || return 1 - fi + force_depend apm || return 1 # Warn user about acpi apm compatibility support which # does not work with apmd. if [ ! -e /dev/apmctl ]; then - warn "/dev/apmctl not found; kernel is missing apm(4)" + warn "/dev/apmctl not found; kernel is missing apm(4)" fi ;; *) return 1 ;; esac - return 0 } load_rc_config $name Modified: head/etc/rc.d/keyserv ============================================================================== --- head/etc/rc.d/keyserv Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/rc.d/keyserv Tue Feb 14 10:51:24 2012 (r231667) @@ -19,13 +19,7 @@ start_precmd="keyserv_prestart" keyserv_prestart() { - if ! checkyesno rpcbind_enable && \ - ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then - force_depend rpcbind || return 1 - fi - - return 0 + force_depend rpcbind || return 1 } load_rc_config $name Modified: head/etc/rc.d/lockd ============================================================================== --- head/etc/rc.d/lockd Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/rc.d/lockd Tue Feb 14 10:51:24 2012 (r231667) @@ -15,28 +15,16 @@ name="lockd" rcvar=rpc_lockd_enable command="/usr/sbin/rpc.${name}" start_precmd='lockd_precmd' -stop_precmd='checkyesno nfs_server_enable || checkyesno nfs_client_enable' -status_precmd=$stop_precmd # Make sure that we are either an NFS client or server, and that we get # the correct flags from rc.conf(5). # lockd_precmd() { - local ret - ret=0 - - if ! checkyesno nfs_server_enable && ! checkyesno nfs_client_enable - then - ret=1 - fi - if ! checkyesno rpcbind_enable && \ - ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then - force_depend rpcbind || ret=1 - fi + force_depend rpcbind || return 1 + force_depend statd rpc_statd || return 1 + rc_flags=${rpc_lockd_flags} - return ${ret} } load_rc_config $name Modified: head/etc/rc.d/mountd ============================================================================== --- head/etc/rc.d/mountd Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/rc.d/mountd Tue Feb 14 10:51:24 2012 (r231667) @@ -19,11 +19,7 @@ extra_commands="reload" mountd_precmd() { - if ! checkyesno rpcbind_enable && \ - ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then - force_depend rpcbind || return 1 - fi + force_depend rpcbind || return 1 # mountd flags will differ depending on rc.conf settings # @@ -48,8 +44,8 @@ mountd_precmd() fi rm -f /var/db/mountdtab - ( umask 022 ; > /var/db/mountdtab ) - return 0 + ( umask 022 ; > /var/db/mountdtab ) || + err 1 'Cannot create /var/db/mountdtab' } load_rc_config $name Modified: head/etc/rc.d/nfsd ============================================================================== --- head/etc/rc.d/nfsd Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/rc.d/nfsd Tue Feb 14 10:51:24 2012 (r231667) @@ -48,31 +48,15 @@ nfsd_precmd() if checkyesno nfsv4_server_enable; then sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null - if ! checkyesno nfsuserd_enable && \ - ! /etc/rc.d/nfsuserd forcestatus 1>/dev/null 2>&1 - then - if ! force_depend nfsuserd; then - err 1 "Cannot run nfsuserd" - fi - fi + force_depend nfsuserd || err 1 "Cannot run nfsuserd" else echo 'NFSv4 is disabled' sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null fi fi - if ! checkyesno rpcbind_enable && \ - ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then - force_depend rpcbind || return 1 - fi - - if ! checkyesno mountd_enable && \ - ! /etc/rc.d/mountd forcestatus 1>/dev/null 2>&1 - then - force_depend mountd || return 1 - fi - return 0 + force_depend rpcbind || return 1 + force_depend mountd || return 1 } run_rc_command "$1" Modified: head/etc/rc.d/statd ============================================================================== --- head/etc/rc.d/statd Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/rc.d/statd Tue Feb 14 10:51:24 2012 (r231667) @@ -15,28 +15,15 @@ name="statd" rcvar=rpc_statd_enable command="/usr/sbin/rpc.${name}" start_precmd='statd_precmd' -stop_precmd='checkyesno nfs_server_enable || checkyesno nfs_client_enable' -status_precmd=$stop_precmd # Make sure that we are either an NFS client or server, and that we get # the correct flags from rc.conf(5). # statd_precmd() { - local ret - ret=0 - - if ! checkyesno nfs_server_enable && ! checkyesno nfs_client_enable - then - ret=1 - fi - if ! checkyesno rpcbind_enable && \ - ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then - force_depend rpcbind || ret=1 - fi + force_depend rpcbind || return 1 + rc_flags=${rpc_statd_flags} - return ${ret} } load_rc_config $name Modified: head/etc/rc.d/ypbind ============================================================================== --- head/etc/rc.d/ypbind Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/rc.d/ypbind Tue Feb 14 10:51:24 2012 (r231667) @@ -11,22 +11,20 @@ . /etc/rc.subr name="ypbind" -command="/usr/sbin/${name}" -start_precmd="ypbind_precmd" +rcvar="nis_client_enable" load_rc_config $name -rcvar="nis_client_enable" + +command="/usr/sbin/${name}" command_args="${nis_client_flags}" +start_precmd="ypbind_precmd" + ypbind_precmd() { local _domain - if ! checkyesno rpcbind_enable && \ - ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then - force_depend rpcbind || return 1 - fi + force_depend rpcbind || return 1 _domain=`domainname` if [ -z "$_domain" ]; then Modified: head/etc/rc.d/yppasswdd ============================================================================== --- head/etc/rc.d/yppasswdd Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/rc.d/yppasswdd Tue Feb 14 10:51:24 2012 (r231667) @@ -11,27 +11,22 @@ . /etc/rc.subr name="yppasswdd" -command="/usr/sbin/rpc.${name}" -start_precmd="yppasswdd_precmd" +rcvar="nis_yppasswdd_enable" load_rc_config $name -rcvar="nis_yppasswdd_enable" + +command="/usr/sbin/rpc.${name}" command_args="${nis_yppasswdd_flags}" +start_precmd="yppasswdd_precmd" + yppasswdd_precmd() { local _domain - if ! checkyesno rpcbind_enable && \ - ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then - force_depend rpcbind || return 1 - fi - if ! checkyesno nis_server_enable && \ - ! /etc/rc.d/ypserv forcestatus 1>/dev/null 2>&1 - then - force_depend ypserv || return 1 - fi + force_depend rpcbind || return 1 + force_depend ypserv nis_server || return 1 + _domain=`domainname` if [ -z "$_domain" ]; then warn "NIS domainname(1) is not set." Modified: head/etc/rc.d/ypserv ============================================================================== --- head/etc/rc.d/ypserv Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/rc.d/ypserv Tue Feb 14 10:51:24 2012 (r231667) @@ -11,21 +11,20 @@ name="ypserv" rcvar="nis_server_enable" -command="/usr/sbin/${name}" -start_precmd="ypserv_prestart" load_rc_config $name + +command="/usr/sbin/${name}" command_args="${nis_server_flags}" +start_precmd="ypserv_prestart" + ypserv_prestart() { local _domain - if ! checkyesno rpcbind_enable && \ - ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then - force_depend rpcbind || return 1 - fi + force_depend rpcbind || return 1 + _domain=`domainname` if [ -z "$_domain" ]; then warn "NIS domainname(1) is not set." Modified: head/etc/rc.d/ypset ============================================================================== --- head/etc/rc.d/ypset Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/rc.d/ypset Tue Feb 14 10:51:24 2012 (r231667) @@ -11,25 +11,20 @@ name="ypset" rcvar="nis_ypset_enable" -command="/usr/sbin/${name}" -start_precmd="ypset_precmd" + load_rc_config $name + +command="/usr/sbin/${name}" command_args="${nis_ypset_flags}" +start_precmd="ypset_precmd" + ypset_precmd() { local _domain - if ! checkyesno rpcbind_enable && \ - ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then - force_depend rpcbind || return 1 - fi - if ! checkyesno nis_client_enable && \ - ! /etc/rc.d/ypbind forcestatus 1>/dev/null 2>&1 - then - force_depend ypbind || return 1 - fi + force_depend rpcbind || return 1 + force_depend ypbind nis_client || return 1 _domain=`domainname` if [ -z "$_domain" ]; then Modified: head/etc/rc.d/ypupdated ============================================================================== --- head/etc/rc.d/ypupdated Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/rc.d/ypupdated Tue Feb 14 10:51:24 2012 (r231667) @@ -11,6 +11,9 @@ name="ypupdated" rcvar="rpc_ypupdated_enable" + +load_rc_config $name + command="/usr/sbin/rpc.${name}" start_precmd="rpc_ypupdated_precmd" @@ -18,16 +21,8 @@ rpc_ypupdated_precmd() { local _domain - if ! checkyesno rpcbind_enable && \ - ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then - force_depend rpcbind || return 1 - fi - if ! checkyesno nis_server_enable && \ - ! /etc/rc.d/ypserv forcestatus 1>/dev/null 2>&1 - then - force_depend ypserv || return 1 - fi + force_depend rpcbind || return 1 + force_depend ypserv nis_server || return 1 _domain=`domainname` if [ -z "$_domain" ]; then @@ -36,5 +31,4 @@ rpc_ypupdated_precmd() fi } -load_rc_config $name run_rc_command "$1" Modified: head/etc/rc.d/ypxfrd ============================================================================== --- head/etc/rc.d/ypxfrd Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/rc.d/ypxfrd Tue Feb 14 10:51:24 2012 (r231667) @@ -11,25 +11,20 @@ name="ypxfrd" rcvar="nis_ypxfrd_enable" -command="/usr/sbin/rpc.${name}" -start_precmd="ypxfrd_precmd" + load_rc_config $name + +command="/usr/sbin/rpc.${name}" command_args="${nis_ypxfrd_flags}" +start_precmd="ypxfrd_precmd" + ypxfrd_precmd() { local _domain - if ! checkyesno rpcbind_enable && \ - ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 - then - force_depend rpcbind || return 1 - fi - if ! checkyesno nis_server_enable && \ - ! /etc/rc.d/ypserv forcestatus 1>/dev/null 2>&1 - then - force_depend ypserv || return 1 - fi + force_depend rpcbind || return 1 + force_depend ypserv nis_server || return 1 _domain=`domainname` if [ -z "$_domain" ]; then Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Tue Feb 14 10:34:27 2012 (r231666) +++ head/etc/rc.subr Tue Feb 14 10:51:24 2012 (r231667) @@ -71,22 +71,29 @@ set_rcvar_obsolete() } # -# force_depend script +# force_depend script [rcvar] # Force a service to start. Intended for use by services -# to resolve dependency issues. It is assumed the caller -# has check to make sure this call is necessary +# to resolve dependency issues. # $1 - filename of script, in /etc/rc.d, to run +# $2 - name of the script's rcvar (minus the _enable) # force_depend() { + local _depend _dep_rcvar + _depend="$1" + _dep_rcvar="${2:-$1}_enable" + + [ -n "$rc_fast" ] && ! checkyesno always_force_depends && + checkyesno $_dep_rcvar && return 0 + + /etc/rc.d/${_depend} forcestatus >/dev/null 2>&1 && return 0 info "${name} depends on ${_depend}, which will be forced to start." if ! /etc/rc.d/${_depend} forcestart; then warn "Unable to force ${_depend}. It may already be running." return 1 fi - return 0 } # Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Tue Feb 14 10:34:27 2012 (r231666) +++ head/share/man/man5/rc.conf.5 Tue Feb 14 10:51:24 2012 (r231667) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2012 +.Dd February 11, 2012 .Dt RC.CONF 5 .Os .Sh NAME @@ -149,6 +149,19 @@ and before changing it one should ensure adequate provisions to recover from a failed boot (such as physical contact with the machine, or reliable remote console access). +.It Va always_force_depends +.Pq Vt bool +Various +.Pa rc.d +scripts use the force_depend function to check whether required +services are already running, and to start them if necessary. +By default during boot time this check is bypassed if the +required service is enabled in +.Pa /etc/rc.conf[.local] . +Setting this option will bypass that check at boot time and +always test whether or not the service is actually running. +Enabling this option is likely to increase your boot time if +services are enabled that utilize the force_depend check. .It Va swapfile .Pq Vt str If set to From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 11:24:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36B271065679; Tue, 14 Feb 2012 11:24:25 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 256D28FC18; Tue, 14 Feb 2012 11:24:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EBOPFs095842; Tue, 14 Feb 2012 11:24:25 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EBOOdE095840; Tue, 14 Feb 2012 11:24:24 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201202141124.q1EBOOdE095840@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 14 Feb 2012 11:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231669 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 11:24:25 -0000 Author: tijl Date: Tue Feb 14 11:24:24 2012 New Revision: 231669 URL: http://svn.freebsd.org/changeset/base/231669 Log: Replace PRIdMAX with "jd" in a printf call. Cast the corresponding value to intmax_t instead of uintmax_t, because the original type is off_t. Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Feb 14 11:16:13 2012 (r231668) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Tue Feb 14 11:24:24 2012 (r231669) @@ -54,8 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include @@ -1471,10 +1469,9 @@ tmpfs_print(struct vop_print_args *v) printf("tag VT_TMPFS, tmpfs_node %p, flags 0x%x, links %d\n", node, node->tn_flags, node->tn_links); - printf("\tmode 0%o, owner %d, group %d, size %" PRIdMAX - ", status 0x%x\n", + printf("\tmode 0%o, owner %d, group %d, size %jd, status 0x%x\n", node->tn_mode, node->tn_uid, node->tn_gid, - (uintmax_t)node->tn_size, node->tn_status); + (intmax_t)node->tn_size, node->tn_status); if (vp->v_type == VFIFO) fifo_printinfo(vp); From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 11:33:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 576501065677; Tue, 14 Feb 2012 11:33:14 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay006.isp.belgacom.be (mailrelay006.isp.belgacom.be [195.238.6.172]) by mx1.freebsd.org (Postfix) with ESMTP id AAF038FC17; Tue, 14 Feb 2012 11:33:13 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EADhGOk9bsYUt/2dsb2JhbABDhRCrC4EIgXIBAQUjMzMLFAQqAgI5HgeIEQanZ5IZjCEBAjQUAwECAoQrgjOBFgSoFw Received: from 45.133-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.133.45]) by relay.skynet.be with ESMTP; 14 Feb 2012 12:33:11 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q1EBXBn2002559; Tue, 14 Feb 2012 12:33:11 +0100 (CET) (envelope-from tijl@coosemans.org) From: Tijl Coosemans To: src-committers@freebsd.org, svn-src-head@freebsd.org Date: Tue, 14 Feb 2012 12:33:02 +0100 User-Agent: KMail/1.13.7 (FreeBSD/10.0-CURRENT; KDE/4.7.3; i386; ; ) References: <201202141124.q1EBOOdE095840@svn.freebsd.org> In-Reply-To: <201202141124.q1EBOOdE095840@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2148655.vcyLd7GbZY"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201202141233.08733.tijl@coosemans.org> Cc: Subject: Re: svn commit: r231669 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 11:33:14 -0000 --nextPart2148655.vcyLd7GbZY Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tuesday 14 February 2012 12:24:24 Tijl Coosemans wrote: > Author: tijl > Date: Tue Feb 14 11:24:24 2012 > New Revision: 231669 > URL: http://svn.freebsd.org/changeset/base/231669 >=20 > Log: > Replace PRIdMAX with "jd" in a printf call. Cast the corresponding valu= e to > intmax_t instead of uintmax_t, because the original type is off_t. There should really be a better way to print 64 bit numbers than (ab)using intmax_t. I'm sort of interested in adding an int128_t type and that would make intmax_t 128 bit. --nextPart2148655.vcyLd7GbZY Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk86RnQACgkQfoCS2CCgtit92AD/X+VLbRu4GZZ68H+or9oHqkg2 T1rKuMlNbnTaItwFC64A/ikt3e3PRJcHZy7DnPsjMTj5DHwENUBhwdygXaL504ti =eMY8 -----END PGP SIGNATURE----- --nextPart2148655.vcyLd7GbZY-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 12:00:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36FCE1065714; Tue, 14 Feb 2012 12:00:35 +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 255DD8FC0C; Tue, 14 Feb 2012 12:00:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EC0Z8l097099; Tue, 14 Feb 2012 12:00:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EC0YDw097097; Tue, 14 Feb 2012 12:00:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202141200.q1EC0YDw097097@svn.freebsd.org> From: Michael Tuexen Date: Tue, 14 Feb 2012 12:00: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: r231672 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 12:00:35 -0000 Author: tuexen Date: Tue Feb 14 12:00:34 2012 New Revision: 231672 URL: http://svn.freebsd.org/changeset/base/231672 Log: Fix a bug where the wrong protocol overhead was used. This can lead to a deadlock of an association when an IPv6 socket was used to communcate with IPv4 and an ICMPv4 fragmentation needed message was received. While there, simplify the code a bit. MFC after: 3 days. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue Feb 14 11:51:32 2012 (r231671) +++ head/sys/netinet/sctp_output.c Tue Feb 14 12:00:34 2012 (r231672) @@ -7612,16 +7612,22 @@ sctp_fill_outqueue(struct sctp_tcb *stcb SCTP_TCB_LOCK_ASSERT(stcb); asoc = &stcb->asoc; + switch (net->ro._l_addr.sa.sa_family) { +#ifdef INET + case AF_INET: + goal_mtu = net->mtu - SCTP_MIN_V4_OVERHEAD; + break; +#endif #ifdef INET6 - if (net->ro._l_addr.sin6.sin6_family == AF_INET6) { + case AF_INET6: goal_mtu = net->mtu - SCTP_MIN_OVERHEAD; - } else { - /* ?? not sure what else to do */ - goal_mtu = net->mtu - SCTP_MIN_V4_OVERHEAD; - } -#else - goal_mtu = net->mtu - SCTP_MIN_OVERHEAD; + break; #endif + default: + /* TSNH */ + goal_mtu = net->mtu; + break; + } /* Need an allowance for the data chunk header too */ goal_mtu -= sizeof(struct sctp_data_chunk); @@ -8180,10 +8186,21 @@ again_one_more_time: if (!no_out_cnt) *num_out += ctl_cnt; /* recalc a clean slate and setup */ - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - mtu = (net->mtu - SCTP_MIN_OVERHEAD); - } else { - mtu = (net->mtu - SCTP_MIN_V4_OVERHEAD); + switch (net->ro._l_addr.sa.sa_family) { +#ifdef INET + case AF_INET: + mtu = net->mtu - SCTP_MIN_V4_OVERHEAD; + break; +#endif +#ifdef INET6 + case AF_INET6: + mtu = net->mtu - SCTP_MIN_OVERHEAD; + break; +#endif + default: + /* TSNH */ + mtu = net->mtu; + break; } to_out = 0; no_fragmentflg = 1; @@ -8446,10 +8463,21 @@ again_one_more_time: if (!no_out_cnt) *num_out += ctl_cnt; /* recalc a clean slate and setup */ - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - mtu = (net->mtu - SCTP_MIN_OVERHEAD); - } else { - mtu = (net->mtu - SCTP_MIN_V4_OVERHEAD); + switch (net->ro._l_addr.sa.sa_family) { +#ifdef INET + case AF_INET: + mtu = net->mtu - SCTP_MIN_V4_OVERHEAD; + break; +#endif +#ifdef INET6 + case AF_INET6: + mtu = net->mtu - SCTP_MIN_OVERHEAD; + break; +#endif + default: + /* TSNH */ + mtu = net->mtu; + break; } to_out = 0; no_fragmentflg = 1; @@ -9492,10 +9520,21 @@ sctp_chunk_retransmission(struct sctp_in } /* pick up the net */ net = chk->whoTo; - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - mtu = (net->mtu - SCTP_MIN_OVERHEAD); - } else { + switch (net->ro._l_addr.sa.sa_family) { +#ifdef INET + case AF_INET: mtu = net->mtu - SCTP_MIN_V4_OVERHEAD; + break; +#endif +#ifdef INET6 + case AF_INET6: + mtu = net->mtu - SCTP_MIN_OVERHEAD; + break; +#endif + default: + /* TSNH */ + mtu = net->mtu; + break; } if ((asoc->peers_rwnd < mtu) && (asoc->total_flight > 0)) { @@ -9816,12 +9855,10 @@ one_chunk_around: return (0); } - -static int +static void sctp_timer_validation(struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct sctp_association *asoc, - int ret) + struct sctp_association *asoc) { struct sctp_nets *net; @@ -9829,7 +9866,7 @@ sctp_timer_validation(struct sctp_inpcb TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if (SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) { /* Here is a timer */ - return (ret); + return; } } SCTP_TCB_LOCK_ASSERT(stcb); @@ -9840,7 +9877,7 @@ sctp_timer_validation(struct sctp_inpcb } else { sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, asoc->primary_destination); } - return (ret); + return; } void @@ -9950,7 +9987,7 @@ sctp_chunk_output(struct sctp_inpcb *inp #ifdef SCTP_AUDITING_ENABLED sctp_auditing(8, inp, stcb, NULL); #endif - (void)sctp_timer_validation(inp, stcb, asoc, ret); + sctp_timer_validation(inp, stcb, asoc); return; } if (ret < 0) { From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 12:03:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84BDF1065696; Tue, 14 Feb 2012 12:03:24 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70FBC8FC19; Tue, 14 Feb 2012 12:03:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EC3OLm097236; Tue, 14 Feb 2012 12:03:24 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EC3NfW097214; Tue, 14 Feb 2012 12:03:23 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201202141203.q1EC3NfW097214@svn.freebsd.org> From: David Chisnall Date: Tue, 14 Feb 2012 12:03: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: r231673 - in head: etc/mtree include include/xlocale lib/libc/locale sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 12:03:24 -0000 Author: theraven Date: Tue Feb 14 12:03:23 2012 New Revision: 231673 URL: http://svn.freebsd.org/changeset/base/231673 Log: Cleanup of xlocale: - Address performance regressions encountered by das@ by caching per-thread data in TLS where available. - Add a __NO_TLS flag to cdefs.h to indicate where not available. - Reorganise the xlocale.h definitions into xlocale/*.h so that they can be included from multiple places. - Export the POSIX2008 subset of xlocale when POSIX2008 says it should be exported, independently of whether xlocale.h is included. - Fix the bug where programs using ctype functions always assumed ASCII unless recompiled. - Fix some style(9) violations. Reviewed by: brooks (mentor) Approved by: dim (mentor) Added: head/include/xlocale/ head/include/xlocale/Makefile (contents, props changed) head/include/xlocale/_ctype.h (contents, props changed) head/include/xlocale/_inttypes.h (contents, props changed) head/include/xlocale/_langinfo.h (contents, props changed) head/include/xlocale/_locale.h (contents, props changed) head/include/xlocale/_monetary.h (contents, props changed) head/include/xlocale/_stdio.h (contents, props changed) head/include/xlocale/_stdlib.h (contents, props changed) head/include/xlocale/_string.h (contents, props changed) head/include/xlocale/_time.h (contents, props changed) head/include/xlocale/_wchar.h (contents, props changed) Deleted: head/include/_xlocale_ctype.h Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/include/ctype.h head/include/langinfo.h head/include/locale.h head/include/runetype.h head/include/string.h head/include/time.h head/include/wchar.h head/include/wctype.h head/include/xlocale.h head/lib/libc/locale/Symbol.map head/lib/libc/locale/setrunelocale.c head/lib/libc/locale/table.c head/lib/libc/locale/xlocale.c head/lib/libc/locale/xlocale_private.h head/sys/sys/cdefs.h Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Tue Feb 14 12:00:34 2012 (r231672) +++ head/etc/mtree/BSD.include.dist Tue Feb 14 12:03:23 2012 (r231673) @@ -329,4 +329,6 @@ .. vm .. + xlocale + .. .. Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Tue Feb 14 12:00:34 2012 (r231672) +++ head/include/Makefile Tue Feb 14 12:03:23 2012 (r231673) @@ -6,7 +6,7 @@ .include CLEANFILES= osreldate.h version vers.c -SUBDIR= arpa gssapi protocols rpcsvc rpc +SUBDIR= arpa gssapi protocols rpcsvc rpc xlocale INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ db.h \ dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \ @@ -24,7 +24,7 @@ INCS= a.out.h ar.h assert.h bitstring.h strings.h sysexits.h tar.h termios.h tgmath.h \ time.h timeconv.h timers.h ttyent.h \ ulimit.h unistd.h utime.h utmpx.h uuid.h varargs.h vis.h \ - wchar.h wctype.h wordexp.h xlocale.h _xlocale_ctype.h + wchar.h wctype.h wordexp.h xlocale.h MHDRS= float.h floatingpoint.h stdarg.h Modified: head/include/ctype.h ============================================================================== --- head/include/ctype.h Tue Feb 14 12:00:34 2012 (r231672) +++ head/include/ctype.h Tue Feb 14 12:03:23 2012 (r231673) @@ -78,6 +78,10 @@ int isphonogram(int); int isrune(int); int isspecial(int); #endif + +#if __POSIX_VISIBLE >= 200809 +#include +#endif __END_DECLS #ifndef __cplusplus Modified: head/include/langinfo.h ============================================================================== --- head/include/langinfo.h Tue Feb 14 12:00:34 2012 (r231672) +++ head/include/langinfo.h Tue Feb 14 12:03:23 2012 (r231673) @@ -130,6 +130,10 @@ typedef __nl_item nl_item; __BEGIN_DECLS char *nl_langinfo(nl_item); + +#if __POSIX_VISIBLE >= 200809 +#include +#endif __END_DECLS #endif /* !_LANGINFO_H_ */ Modified: head/include/locale.h ============================================================================== --- head/include/locale.h Tue Feb 14 12:00:34 2012 (r231672) +++ head/include/locale.h Tue Feb 14 12:03:23 2012 (r231673) @@ -77,54 +77,11 @@ struct lconv { __BEGIN_DECLS struct lconv *localeconv(void); char *setlocale(int, const char *); -__END_DECLS #if __POSIX_VISIBLE >= 200809 - -#define LC_COLLATE_MASK (1<<0) -#define LC_CTYPE_MASK (1<<1) -#define LC_MESSAGES_MASK (1<<2) -#define LC_MONETARY_MASK (1<<3) -#define LC_NUMERIC_MASK (1<<4) -#define LC_TIME_MASK (1<<5) -#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | \ - LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK) - -#define LC_GLOBAL_LOCALE ((locale_t)-1) - -__BEGIN_DECLS - -typedef struct _xlocale *locale_t; -/** - * Creates a new locale. - */ -locale_t newlocale(int mask, const char *locale, locale_t base); - -/** - * Returns an identical duplicate of the passed locale. The returned locale - * must be freed with freelocale(). The returned locale will share components - * with the original. - */ -locale_t duplocale(locale_t base); -/* - * Free a locale_t. This is quite a poorly named function. It actually - * disclaims a reference to a locale_t, rather than freeing it. - */ -int freelocale(locale_t loc); - -/* - * Returns the name of the locale for a particular component of a locale_t. - */ -const char *querylocale(int mask, locale_t loc); - -/* - * Installs the specified locale_t as this thread's locale. - */ -locale_t uselocale(locale_t loc); - +#include +#endif __END_DECLS -#endif /* __POSIX_VISIBLE >= 200809 */ - #endif /* _LOCALE_H_ */ Modified: head/include/runetype.h ============================================================================== --- head/include/runetype.h Tue Feb 14 12:00:34 2012 (r231672) +++ head/include/runetype.h Tue Feb 14 12:03:23 2012 (r231673) @@ -85,11 +85,21 @@ typedef struct { #define _RUNE_MAGIC_1 "RuneMagi" /* Indicates version 0 of RuneLocale */ __BEGIN_DECLS extern const _RuneLocale _DefaultRuneLocale; -__attribute__((deprecated)) -extern _RuneLocale *_CurrentRuneLocale; -/* TODO: This is called quite a lot, so we should use a __thread variable when - * it's available. */ -extern _RuneLocale *__getCurrentRuneLocale(void); +extern const _RuneLocale *_CurrentRuneLocale; +extern const _Thread_local _RuneLocale *_ThreadRuneLocale; +#if defined(__NO_TLS) || defined(__RUNETYPE_INTERNAL) +extern const _RuneLocale *__getCurrentRuneLocale(void); +#else +static inline const _RuneLocale *__getCurrentRuneLocale(void) +{ + + if (_ThreadRuneLocale) + return _ThreadRuneLocale; + if (_CurrentRuneLocale) + return _CurrentRuneLocale; + return &_DefaultRuneLocale; +} +#endif /* __NO_TLS || __RUNETYPE_INTERNAL */ #define _CurrentRuneLocale (__getCurrentRuneLocale()) __END_DECLS Modified: head/include/string.h ============================================================================== --- head/include/string.h Tue Feb 14 12:00:34 2012 (r231672) +++ head/include/string.h Tue Feb 14 12:03:23 2012 (r231673) @@ -132,6 +132,10 @@ void swab(const void * __restrict, void #endif /* _SWAB_DECLARED */ #endif /* __BSD_VISIBLE */ + +#if __POSIX_VISIBLE >= 200809 +#include +#endif __END_DECLS #endif /* _STRING_H_ */ Modified: head/include/time.h ============================================================================== --- head/include/time.h Tue Feb 14 12:00:34 2012 (r231672) +++ head/include/time.h Tue Feb 14 12:03:23 2012 (r231673) @@ -183,6 +183,10 @@ void tzsetwall(void); time_t timelocal(struct tm * const); time_t timegm(struct tm * const); #endif /* __BSD_VISIBLE */ + +#if __POSIX_VISIBLE >= 200809 +#include +#endif __END_DECLS #endif /* !_TIME_H_ */ Modified: head/include/wchar.h ============================================================================== --- head/include/wchar.h Tue Feb 14 12:00:34 2012 (r231672) +++ head/include/wchar.h Tue Feb 14 12:03:23 2012 (r231673) @@ -224,6 +224,10 @@ wchar_t *fgetwln(FILE * __restrict, size size_t wcslcat(wchar_t *, const wchar_t *, size_t); size_t wcslcpy(wchar_t *, const wchar_t *, size_t); #endif + +#if __POSIX_VISIBLE >= 200809 +#include +#endif __END_DECLS #endif /* !_WCHAR_H_ */ Modified: head/include/wctype.h ============================================================================== --- head/include/wctype.h Tue Feb 14 12:00:34 2012 (r231672) +++ head/include/wctype.h Tue Feb 14 12:03:23 2012 (r231673) @@ -87,6 +87,11 @@ wint_t iswrune(wint_t); wint_t iswspecial(wint_t); wint_t nextwctype(wint_t, wctype_t); #endif + +#if __POSIX_VISIBLE >= 200809 +#define _XLOCALE_WCTYPES 1 +#include +#endif /* __POSIX_VISIBLE >= 200809 */ __END_DECLS #ifndef __cplusplus Modified: head/include/xlocale.h ============================================================================== --- head/include/xlocale.h Tue Feb 14 12:00:34 2012 (r231672) +++ head/include/xlocale.h Tue Feb 14 12:03:23 2012 (r231673) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 The FreeBSD Foundation + * Copyright (c) 2011, 2012 The FreeBSD Foundation * All rights reserved. * * This software was developed by David Chisnall under sponsorship from @@ -8,16 +8,16 @@ * 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. + * 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 + * 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) @@ -33,225 +33,52 @@ #define _XLOCALE_H_ #include - __BEGIN_DECLS +#include -/* - * Extended locale versions of the locale-aware functions from string.h. - * - * Include before to expose these. - */ #ifdef _STRING_H_ -int strcoll_l(const char *, const char *, locale_t); -size_t strxfrm_l(char *, const char *, size_t, locale_t); -int strcasecmp_l(const char *, const char *, locale_t); -char *strcasestr_l(const char *, const char *, locale_t); -int strncasecmp_l(const char *, const char *, size_t, locale_t); +#include #endif -/* - * Extended locale versions of the locale-aware functions from inttypes.h. - * - * Include before to expose these. - */ + #ifdef _INTTYPES_H_ -intmax_t -strtoimax_l(const char * __restrict, char ** __restrict, int, locale_t); -uintmax_t -strtoumax_l(const char * __restrict, char ** __restrict, int, locale_t); -intmax_t -wcstoimax_l(const wchar_t * __restrict, wchar_t ** __restrict, int , locale_t); -uintmax_t -wcstoumax_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); +#include #endif -/* - * Extended locale versions of the locale-aware functions from monetary.h. - * - * Include before to expose these. - */ + #ifdef _MONETARY_H_ -ssize_t strfmon_l(char *, size_t, locale_t, const char *, ...) -# if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 - __attribute__((__format__ (__strfmon__, 4, 5))) -# endif - ; +#include #endif -/* - * Extended locale versions of the locale-aware functions from stdlib.h. - * - * Include before to expose these. - */ #ifdef _STDLIB_H_ -double atof_l(const char *, locale_t); -int atoi_l(const char *, locale_t); -long atol_l(const char *, locale_t); -long long atoll_l(const char *, locale_t); -int mblen_l(const char *, size_t, locale_t); -size_t -mbstowcs_l(wchar_t * __restrict, const char * __restrict, size_t, locale_t); -int -mbtowc_l(wchar_t * __restrict, const char * __restrict, size_t, locale_t); -double strtod_l(const char *, char **, locale_t); -float strtof_l(const char *, char **, locale_t); -long strtol_l(const char *, char **, int, locale_t); -long double strtold_l(const char *, char **, locale_t); -long long strtoll_l(const char *, char **, int, locale_t); -unsigned long strtoul_l(const char *, char **, int, locale_t); -unsigned long long strtoull_l(const char *, char **, int, locale_t); -size_t -wcstombs_l(char * __restrict, const wchar_t * __restrict, size_t, locale_t); -int wctomb_l(char *, wchar_t, locale_t); - -int ___mb_cur_max_l(locale_t); -#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) - +#include #endif -/* - * Extended locale versions of the locale-aware functions from time.h. - * - * Include before to expose these. - */ + #ifdef _TIME_H_ -size_t -strftime_l(char * __restrict, size_t, const char * __restrict, const - struct tm * __restrict, locale_t) -# if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 - __attribute__((__format__ (__strftime__, 3, 0))) -# endif - ; -char * -strptime_l(const char * __restrict, const char * __restrict, - struct tm * __restrict, locale_t); +#include #endif + #ifdef _LANGINFO_H_ -char *nl_langinfo_l(nl_item, locale_t); +#include #endif + #ifdef _CTYPE_H_ -#include <_xlocale_ctype.h> +#include #endif + #ifdef _WCTYPE_H_ -#define XLOCALE_WCTYPES 1 -#include <_xlocale_ctype.h> +#define _XLOCALE_WCTYPES 1 +#include #endif #ifdef _STDIO_H_ -int fprintf_l(FILE * __restrict, locale_t, const char * __restrict, ...) - __printflike(3, 4); -int fscanf_l(FILE * __restrict, locale_t, const char * __restrict, ...) - __scanflike(3, 4); -int printf_l(locale_t, const char * __restrict, ...) __printflike(2, 3); -int scanf_l(locale_t, const char * __restrict, ...) __scanflike(2, 3); -int sprintf_l(char * __restrict, locale_t, const char * __restrict, ...) - __printflike(3, 4); -int sscanf_l(const char * __restrict, locale_t, const char * __restrict, ...) - __scanflike(3, 4); -int vfprintf_l(FILE * __restrict, locale_t, const char * __restrict, __va_list) - __printflike(3, 0); -int vprintf_l(locale_t, const char * __restrict, __va_list) __printflike(2, 0); -int vsprintf_l(char * __restrict, locale_t, const char * __restrict, __va_list) - __printflike(3, 0); - -int snprintf_l(char * __restrict, size_t, locale_t, const char * __restrict, - ...) __printflike(4, 5); -int vfscanf_l(FILE * __restrict, locale_t, const char * __restrict, __va_list) - __scanflike(3, 0); -int vscanf_l(locale_t, const char * __restrict, __va_list) __scanflike(2, 0); -int vsnprintf_l(char * __restrict, size_t, locale_t, const char * __restrict, - __va_list) __printflike(4, 0); -int vsscanf_l(const char * __restrict, locale_t, const char * __restrict, - __va_list) __scanflike(3, 0); -int dprintf_l(int, locale_t, const char * __restrict, ...) __printflike(3, 4); -int vdprintf_l(int, locale_t, const char * __restrict, __va_list) - __printflike(3, 0); -int asprintf_l(char **, locale_t, const char *, ...) __printflike(3, 4); -int vasprintf_l(char **, locale_t, const char *, __va_list) __printflike(3, 0); +#include #endif -#ifdef _WCHAR_H_ -wint_t btowc_l(int, locale_t); -wint_t fgetwc_l(FILE *, locale_t); -wchar_t * -fgetws_l(wchar_t * __restrict, int, FILE * __restrict, locale_t); -wint_t fputwc_l(wchar_t, FILE *, locale_t); -int -fputws_l(const wchar_t * __restrict, FILE * __restrict, locale_t); -int -fwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, - ...); -int -fwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...); -wint_t getwc_l(FILE *, locale_t); -wint_t getwchar_l(locale_t); -size_t -mbrlen_l(const char * __restrict, size_t, mbstate_t * __restrict, locale_t); -size_t -mbrtowc_l(wchar_t * __restrict, const char * __restrict, size_t, - mbstate_t * __restrict, locale_t); -int mbsinit_l(const mbstate_t *, locale_t); -size_t -mbsrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t, - mbstate_t * __restrict, locale_t); -wint_t putwc_l(wchar_t, FILE *, locale_t); -wint_t putwchar_l(wchar_t, locale_t); -int -swprintf_l(wchar_t * __restrict, size_t n, locale_t, - const wchar_t * __restrict, ...); -int -swscanf_l(const wchar_t * __restrict, locale_t, const wchar_t * __restrict, - ...); -wint_t ungetwc_l(wint_t, FILE *, locale_t); -int -vfwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, - __va_list); -int -vswprintf_l(wchar_t * __restrict, size_t n, locale_t, - const wchar_t * __restrict, __va_list); -int vwprintf_l(locale_t, const wchar_t * __restrict, __va_list); -size_t -wcrtomb_l(char * __restrict, wchar_t, mbstate_t * __restrict, locale_t); -int wcscoll_l(const wchar_t *, const wchar_t *, locale_t); -size_t -wcsftime_l(wchar_t * __restrict, size_t, const wchar_t * __restrict, - const struct tm * __restrict, locale_t); -size_t -wcsrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t, - mbstate_t * __restrict, locale_t); -double wcstod_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); -long -wcstol_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); -unsigned long -wcstoul_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); -int wcswidth_l(const wchar_t *, size_t, locale_t); -size_t -wcsxfrm_l(wchar_t * __restrict, const wchar_t * __restrict, size_t, locale_t); -int wctob_l(wint_t, locale_t); -int wcwidth_l(wchar_t, locale_t); -int wprintf_l(locale_t, const wchar_t * __restrict, ...); -int wscanf_l(locale_t, const wchar_t * __restrict, ...); - -int -vfwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, - __va_list); -int vswscanf_l(const wchar_t * __restrict, locale_t, -const wchar_t *__restrict, __va_list); -int vwscanf_l(locale_t, const wchar_t * __restrict, __va_list); -float wcstof_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); -long double -wcstold_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); -long long -wcstoll_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); -unsigned long long -wcstoull_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); -size_t -mbsnrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t, size_t, - mbstate_t * __restrict, locale_t); -int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t); -int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t); -size_t -wcsnrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t, size_t, - mbstate_t * __restrict, locale_t); +#ifdef _WCHAR_H_ +#include #endif + + struct lconv *localeconv_l(locale_t); __END_DECLS Added: head/include/xlocale/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/xlocale/Makefile Tue Feb 14 12:03:23 2012 (r231673) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +NO_OBJ= +INCS= _ctype.h _inttypes.h _langinfo.h _locale.h _monetary.h _stdio.h\ + _stdlib.h _string.h _time.h _wchar.h +INCSDIR=${INCLUDEDIR}/xlocale + +.include Added: head/include/xlocale/_ctype.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/xlocale/_ctype.h Tue Feb 14 12:03:23 2012 (r231673) @@ -0,0 +1,182 @@ +/*- + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by David Chisnall under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#if (defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_WCTYPE_H)) || \ + (!defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_CTYPE_H)) + +#ifdef _XLOCALE_WCTYPES +#define _XLOCALE_WCTYPE_H +#else +#define _XLOCALE_CTYPE_H +#endif + +#ifndef _LOCALE_T_DEFINED +#define _LOCALE_T_DEFINED +typedef struct _xlocale *locale_t; +#endif + +#ifndef _XLOCALE_CTYPE_H_ +unsigned long ___runetype_l(__ct_rune_t, locale_t) __pure; +__ct_rune_t ___tolower_l(__ct_rune_t, locale_t) __pure; +__ct_rune_t ___toupper_l(__ct_rune_t, locale_t) __pure; +_RuneLocale *__runes_for_locale(locale_t, int*); +#endif + +#ifndef _XLOCALE_INLINE +#if __GNUC__ && !__GNUC_STDC_INLINE__ +/* GNU89 inline has nonstandard semantics. */ +#define _XLOCALE_INLINE extern inline +#else +/* Hack to work around people who define inline away */ +#ifdef inline +#define _XLOCALE_INLINE __inline static +#else +/* Define with C++ / C99 compatible semantics */ +#define _XLOCALE_INLINE inline +#endif +#endif +#endif /* _XLOCALE_INLINE */ + +#ifdef _XLOCALE_WCTYPES +static __inline int +__maskrune_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (_c < 0 || _c >= _CACHED_RUNES) ? ___runetype_l(_c, locale) : + runes->__runetype[_c] & _f; +} + +static __inline int +__istype_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +{ + return (!!__maskrune_l(_c, _f, locale)); +} + +#define XLOCALE_ISCTYPE(fname, cat) \ + _XLOCALE_INLINE int isw##fname##_l(int c, locale_t l)\ + { return __istype_l(c, cat, l); } +#else +static __inline int +__sbmaskrune_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (_c < 0 || _c >= mb_sb_limit) ? 0 : + runes->__runetype[_c] & _f; +} + +static __inline int +__sbistype_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +{ + return (!!__sbmaskrune_l(_c, _f, locale)); +} + +#define XLOCALE_ISCTYPE(fname, cat) \ + _XLOCALE_INLINE int is##fname##_l(int c, locale_t l)\ + { return __sbistype_l(c, cat, l); } +#endif + +XLOCALE_ISCTYPE(alnum, _CTYPE_A|_CTYPE_D) +XLOCALE_ISCTYPE(alpha, _CTYPE_A) +XLOCALE_ISCTYPE(blank, _CTYPE_B) +XLOCALE_ISCTYPE(cntrl, _CTYPE_C) +XLOCALE_ISCTYPE(digit, _CTYPE_D) +XLOCALE_ISCTYPE(graph, _CTYPE_G) +XLOCALE_ISCTYPE(hexnumber, _CTYPE_X) +XLOCALE_ISCTYPE(ideogram, _CTYPE_I) +XLOCALE_ISCTYPE(lower, _CTYPE_L) +XLOCALE_ISCTYPE(number, _CTYPE_D) +XLOCALE_ISCTYPE(phonogram, _CTYPE_Q) +XLOCALE_ISCTYPE(print, _CTYPE_R) +XLOCALE_ISCTYPE(punct, _CTYPE_P) +XLOCALE_ISCTYPE(rune, 0xFFFFFF00L) +XLOCALE_ISCTYPE(space, _CTYPE_S) +XLOCALE_ISCTYPE(special, _CTYPE_T) +XLOCALE_ISCTYPE(upper, _CTYPE_U) +XLOCALE_ISCTYPE(xdigit, _CTYPE_X) +#undef XLOCALE_ISCTYPE + +#ifdef _XLOCALE_WCTYPES +_XLOCALE_INLINE int towlower_l(int c, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (c < 0 || c >= _CACHED_RUNES) ? ___tolower_l(c, locale) : + runes->__maplower[c]; +} +_XLOCALE_INLINE int towupper_l(int c, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (c < 0 || c >= _CACHED_RUNES) ? ___toupper_l(c, locale) : + runes->__mapupper[c]; +} +_XLOCALE_INLINE int +__wcwidth_l(__ct_rune_t _c, locale_t locale) +{ + unsigned int _x; + + if (_c == 0) + return (0); + _x = (unsigned int)__maskrune_l(_c, _CTYPE_SWM|_CTYPE_R, locale); + if ((_x & _CTYPE_SWM) != 0) + return ((_x & _CTYPE_SWM) >> _CTYPE_SWS); + return ((_x & _CTYPE_R) != 0 ? 1 : -1); +} +int iswctype_l(wint_t wc, wctype_t charclass, locale_t locale); +wctype_t wctype_l(const char *property, locale_t locale); +wint_t towctrans_l(wint_t wc, wctrans_t desc, locale_t locale); +wint_t nextwctype_l(wint_t wc, wctype_t wct, locale_t locale); +wctrans_t wctrans_l(const char *charclass, locale_t locale); +#undef _XLOCALE_WCTYPES +#else +_XLOCALE_INLINE int digittoint_l(int c, locale_t locale) +{ return __sbmaskrune_l((c), 0xFF, locale); } + +_XLOCALE_INLINE int tolower_l(int c, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (c < 0 || c >= mb_sb_limit) ? c : + runes->__maplower[c]; +} +_XLOCALE_INLINE int toupper_l(int c, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (c < 0 || c >= mb_sb_limit) ? c : + runes->__mapupper[c]; +} +#endif +#endif /* (defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_WCTYPE_H)) || \ + (!defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_CTYPE_H)) */ Added: head/include/xlocale/_inttypes.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/xlocale/_inttypes.h Tue Feb 14 12:03:23 2012 (r231673) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2011, 2012 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by David Chisnall under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +/* + * Extended locale versions of the locale-aware functions from inttypes.h. + * Include before to expose these. + */ +intmax_t strtoimax_l(const char * __restrict, char ** __restrict, + int, locale_t); +uintmax_t strtoumax_l(const char * __restrict, char ** __restrict, int, + locale_t); +intmax_t wcstoimax_l(const wchar_t * __restrict, wchar_t ** __restrict, + int , locale_t); +uintmax_t wcstoumax_l(const wchar_t * __restrict, wchar_t ** __restrict, + int, locale_t); Added: head/include/xlocale/_langinfo.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/xlocale/_langinfo.h Tue Feb 14 12:03:23 2012 (r231673) @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2011, 2012 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by David Chisnall under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _XLOCALE_LANGINFO_H +#define _XLOCALE_LANGINFO_H + +#ifndef _LOCALE_T_DEFINED +#define _LOCALE_T_DEFINED +typedef struct _xlocale *locale_t; +#endif + +char *nl_langinfo_l(nl_item, locale_t); + +#endif /* _XLOCALE_LANGINFO_H */ Added: head/include/xlocale/_locale.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/xlocale/_locale.h Tue Feb 14 12:03:23 2012 (r231673) @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2011, 2012 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by David Chisnall under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _XLOCALE_LOCALE_H +#define _XLOCALE_LOCALE_H + +#define LC_COLLATE_MASK (1<<0) +#define LC_CTYPE_MASK (1<<1) +#define LC_MESSAGES_MASK (1<<2) +#define LC_MONETARY_MASK (1<<3) +#define LC_NUMERIC_MASK (1<<4) +#define LC_TIME_MASK (1<<5) +#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | \ + LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK) +#define LC_GLOBAL_LOCALE ((locale_t)-1) + +#ifndef _LOCALE_T_DEFINED +#define _LOCALE_T_DEFINED +typedef struct _xlocale *locale_t; +#endif + +locale_t duplocale(locale_t base); +int freelocale(locale_t loc); +locale_t newlocale(int mask, const char *locale, locale_t base); +const char *querylocale(int mask, locale_t loc); +locale_t uselocale(locale_t loc); + +#endif /* _XLOCALE_LOCALE_H */ Added: head/include/xlocale/_monetary.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/xlocale/_monetary.h Tue Feb 14 12:03:23 2012 (r231673) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2011, 2012 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by David Chisnall under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LOCALE_T_DEFINED +#define _LOCALE_T_DEFINED +typedef struct _xlocale *locale_t; +#endif + +#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) +#ifndef _XLOCALE_MONETARY_H +#define _XLOCALE_MONETARY_H + +ssize_t strfmon_l(char *, size_t, locale_t, const char *, ...) + __strfmonlike(4, 5); + +#endif /* _XLOCALE_MONETARY_H */ +#endif /* __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) */ Added: head/include/xlocale/_stdio.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/xlocale/_stdio.h Tue Feb 14 12:03:23 2012 (r231673) @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 2011, 2012 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by David Chisnall under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +int asprintf_l(char **, locale_t, const char *, ...) __printflike(3, 4); +int dprintf_l(int, locale_t, const char * __restrict, ...) + __printflike(3, 4); +int fprintf_l(FILE * __restrict, locale_t, const char * __restrict, ...) + __printflike(3, 4); +int fscanf_l(FILE * __restrict, locale_t, const char * __restrict, ...) + __scanflike(3, 4); +int printf_l(locale_t, const char * __restrict, ...) __printflike(2, 3); +int scanf_l(locale_t, const char * __restrict, ...) __scanflike(2, 3); +int snprintf_l(char * __restrict, size_t, locale_t, + const char * __restrict, ...) __printflike(4, 5); +int sprintf_l(char * __restrict, locale_t, const char * __restrict, ...) + __printflike(3, 4); +int sscanf_l(const char * __restrict, locale_t, const char * __restrict, + ...) __scanflike(3, 4); +int vfprintf_l(FILE * __restrict, locale_t, const char * __restrict, + __va_list) __printflike(3, 0); +int vprintf_l(locale_t, const char * __restrict, __va_list) + __printflike(2, 0); +int vsprintf_l(char * __restrict, locale_t, const char * __restrict, + __va_list) __printflike(3, 0); +int vfscanf_l(FILE * __restrict, locale_t, const char * __restrict, + __va_list) __scanflike(3, 0); +int vscanf_l(locale_t, const char * __restrict, __va_list) + __scanflike(2, 0); +int vsnprintf_l(char * __restrict, size_t, locale_t, + const char * __restrict, __va_list) __printflike(4, 0); +int vsscanf_l(const char * __restrict, locale_t, const char * __restrict, + __va_list) __scanflike(3, 0); +int vdprintf_l(int, locale_t, const char * __restrict, __va_list) + __printflike(3, 0); +int vasprintf_l(char **, locale_t, const char *, __va_list) + __printflike(3, 0); Added: head/include/xlocale/_stdlib.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/xlocale/_stdlib.h Tue Feb 14 12:03:23 2012 (r231673) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2011, 2012 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by David Chisnall under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Extended locale versions of the locale-aware functions from stdlib.h. + * + * Include before to expose these. + */ +double atof_l(const char *, locale_t); +int atoi_l(const char *, locale_t); +long atol_l(const char *, locale_t); +long long atoll_l(const char *, locale_t); +int mblen_l(const char *, size_t, locale_t); +size_t mbstowcs_l(wchar_t * __restrict, + const char * __restrict, size_t, locale_t); +int mbtowc_l(wchar_t * __restrict, + const char * __restrict, size_t, locale_t); +double strtod_l(const char *, char **, locale_t); +float strtof_l(const char *, char **, locale_t); +long strtol_l(const char *, char **, int, locale_t); +long double strtold_l(const char *, char **, locale_t); +long long strtoll_l(const char *, char **, int, locale_t); +unsigned long strtoul_l(const char *, char **, int, locale_t); +unsigned long long strtoull_l(const char *, char **, int, locale_t); +size_t wcstombs_l(char * __restrict, + const wchar_t * __restrict, size_t, locale_t); +int wctomb_l(char *, wchar_t, locale_t); + +int ___mb_cur_max_l(locale_t); +#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) + Added: head/include/xlocale/_string.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 12:50:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32FAC10656B5; Tue, 14 Feb 2012 12:50:21 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17B3A8FC0A; Tue, 14 Feb 2012 12:50:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1ECoKvn099092; Tue, 14 Feb 2012 12:50:20 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ECoKYQ099088; Tue, 14 Feb 2012 12:50:20 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201202141250.q1ECoKYQ099088@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 14 Feb 2012 12:50: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: r231678 - in head: include/rpc sys/dev/mpt/mpilib sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 12:50:21 -0000 Author: tijl Date: Tue Feb 14 12:50:20 2012 New Revision: 231678 URL: http://svn.freebsd.org/changeset/base/231678 Log: Change some headers such that lang/gcc* ports no longer patch them. The lang/gcc* ports patch headers where they think something is non-standard. These patched headers override the system headers which means you have to rebuild these ports whenever you do installworld to make sure they contain the latest changes. Modified: head/include/rpc/svc.h head/sys/dev/mpt/mpilib/mpi_type.h head/sys/net/zlib.h Modified: head/include/rpc/svc.h ============================================================================== --- head/include/rpc/svc.h Tue Feb 14 12:47:57 2012 (r231677) +++ head/include/rpc/svc.h Tue Feb 14 12:50:20 2012 (r231678) @@ -226,7 +226,7 @@ struct svc_req { * const SVCXPRT *xprt; * const rpcprog_t prog; * const rpcvers_t vers; - * const void (*dispatch)(); + * const void (*dispatch)(struct svc_req *, SVCXPRT *); * const struct netconfig *nconf; */ @@ -376,7 +376,7 @@ __BEGIN_DECLS extern int svc_create(void (*)(struct svc_req *, SVCXPRT *), const rpcprog_t, const rpcvers_t, const char *); /* - * void (*dispatch)(); -- dispatch routine + * void (*dispatch)(struct svc_req *, SVCXPRT *); * const rpcprog_t prognum; -- program number * const rpcvers_t versnum; -- version number * const char *nettype; -- network type @@ -392,7 +392,7 @@ extern SVCXPRT *svc_tp_create(void (*)(s const rpcprog_t, const rpcvers_t, const struct netconfig *); /* - * void (*dispatch)(); -- dispatch routine + * void (*dispatch)(struct svc_req *, SVCXPRT *); * const rpcprog_t prognum; -- program number * const rpcvers_t versnum; -- version number * const struct netconfig *nconf; -- netconfig structure Modified: head/sys/dev/mpt/mpilib/mpi_type.h ============================================================================== --- head/sys/dev/mpt/mpilib/mpi_type.h Tue Feb 14 12:47:57 2012 (r231677) +++ head/sys/dev/mpt/mpilib/mpi_type.h Tue Feb 14 12:50:20 2012 (r231678) @@ -84,7 +84,7 @@ typedef uint32_t U32; #else -#if defined(unix) || defined(__arm) || defined(ALPHA) || defined(__PPC__) || defined(__ppc) +#if defined(__unix__) || defined(__arm) || defined(ALPHA) || defined(__PPC__) || defined(__ppc) typedef signed int S32; typedef unsigned int U32; Modified: head/sys/net/zlib.h ============================================================================== --- head/sys/net/zlib.h Tue Feb 14 12:47:57 2012 (r231677) +++ head/sys/net/zlib.h Tue Feb 14 12:50:20 2012 (r231678) @@ -109,7 +109,7 @@ extern "C" { #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) # define WIN32 #endif -#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) +#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(__i386__) # ifndef __32BIT__ # define __32BIT__ # endif From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 14:24:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14DDB1065674; Tue, 14 Feb 2012 14:24:38 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD66F8FC1F; Tue, 14 Feb 2012 14:24:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EEObfE002485; Tue, 14 Feb 2012 14:24:37 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EEObiH002481; Tue, 14 Feb 2012 14:24:37 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201202141424.q1EEObiH002481@svn.freebsd.org> From: David Chisnall Date: Tue, 14 Feb 2012 14:24: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: r231682 - in head: include lib/libc/locale X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 14:24:38 -0000 Author: theraven Date: Tue Feb 14 14:24:37 2012 New Revision: 231682 URL: http://svn.freebsd.org/changeset/base/231682 Log: Fix a misplaced __NO_TLS locations, and change a GNUism to a C11ism for consistency. Approved by: brooks (mentor) Modified: head/include/runetype.h head/lib/libc/locale/setrunelocale.c head/lib/libc/locale/xlocale_private.h Modified: head/include/runetype.h ============================================================================== --- head/include/runetype.h Tue Feb 14 14:19:53 2012 (r231681) +++ head/include/runetype.h Tue Feb 14 14:24:37 2012 (r231682) @@ -86,10 +86,10 @@ typedef struct { __BEGIN_DECLS extern const _RuneLocale _DefaultRuneLocale; extern const _RuneLocale *_CurrentRuneLocale; -extern const _Thread_local _RuneLocale *_ThreadRuneLocale; #if defined(__NO_TLS) || defined(__RUNETYPE_INTERNAL) extern const _RuneLocale *__getCurrentRuneLocale(void); #else +extern const _Thread_local _RuneLocale *_ThreadRuneLocale; static inline const _RuneLocale *__getCurrentRuneLocale(void) { Modified: head/lib/libc/locale/setrunelocale.c ============================================================================== --- head/lib/libc/locale/setrunelocale.c Tue Feb 14 14:19:53 2012 (r231681) +++ head/lib/libc/locale/setrunelocale.c Tue Feb 14 14:24:37 2012 (r231682) @@ -183,6 +183,8 @@ __wrap_setrunelocale(const char *locale) _CurrentRuneLocale = __xlocale_global_ctype.runes; return (_LDP_LOADED); } + +#ifndef __NO_TLS void __set_thread_rune_locale(locale_t loc) { @@ -192,10 +194,11 @@ __set_thread_rune_locale(locale_t loc) { _ThreadRuneLocale = XLOCALE_CTYPE(loc)->runes; } } +#endif + void * __ctype_load(const char *locale, locale_t unused) { -#ifndef __NO_TLS struct xlocale_ctype *l = calloc(sizeof(struct xlocale_ctype), 1); l->header.header.destructor = destruct_ctype; if (__setrunelocale(l, locale)) @@ -204,5 +207,4 @@ __ctype_load(const char *locale, locale_ return NULL; } return l; -#endif } Modified: head/lib/libc/locale/xlocale_private.h ============================================================================== --- head/lib/libc/locale/xlocale_private.h Tue Feb 14 14:19:53 2012 (r231681) +++ head/lib/libc/locale/xlocale_private.h Tue Feb 14 14:24:37 2012 (r231682) @@ -183,7 +183,7 @@ extern int __has_thread_locale; * The per-thread locale. Avoids the need to use pthread lookup functions when * getting the per-thread locale. */ -extern __thread locale_t __thread_locale; +extern _Thread_local locale_t __thread_locale; /** * Returns the current locale for this thread, or the global locale if none is From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 14:50:46 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C937D1065670; Tue, 14 Feb 2012 14:50:46 +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 673A38FC16; Tue, 14 Feb 2012 14:50:46 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1EEocn9032432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Feb 2012 01:50:40 +1100 Date: Wed, 15 Feb 2012 01:50:38 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Tijl Coosemans In-Reply-To: <201202141233.08733.tijl@coosemans.org> Message-ID: <20120215012213.M2798@besplex.bde.org> References: <201202141124.q1EBOOdE095840@svn.freebsd.org> <201202141233.08733.tijl@coosemans.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231669 - head/sys/fs/tmpfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 14:50:46 -0000 On Tue, 14 Feb 2012, Tijl Coosemans wrote: > On Tuesday 14 February 2012 12:24:24 Tijl Coosemans wrote: >> Log: >> Replace PRIdMAX with "jd" in a printf call. Cast the corresponding value to >> intmax_t instead of uintmax_t, because the original type is off_t. > > There should really be a better way to print 64 bit numbers than (ab)using > intmax_t. I'm sort of interested in adding an int128_t type and that would > make intmax_t 128 bit. off_t isn't necessarily a 64-bit number. It needs to be 65 bits just to work without hacks for /dev/kmem on 64-bit machines. It might use your 128-bit type for that :-). This would be too wasteful for just that of course. The right way to print N-bit numbers is %I[AaeEFgGxX], where the compiler replaces %I in the string literal by the correct format for the arg (this might be %d, %u, %ld, ..., %ju, %f) instead of complaining that the format doesn't match the arg. Hex formats need and floating point formats other than %f need an extra letter. Floating point variadic args can only be double or long double IIRC, so %I is less needed for them (it lets the compiler handle the 'L's that specify long doubles). Field widths and precisions that separate the % from the I don't effect the meaning of the I. This only works if the types can be checked at compile time. Message catalogues can have more limited simplifications which I haven't thought about much. Language extensions that are not as standard as -Wformat seem to be needed even to detect type mismatches. Once they are detected, they can be fixed up by rewriting the format non-literal. The compiler can help a bit by rewriting the initial string literal and subsequent args in a form that is easier to rewrite. Bruce From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 17:11:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C56731065672; Tue, 14 Feb 2012 17:11:34 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B46BA8FC15; Tue, 14 Feb 2012 17:11:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EHBYIG009278; Tue, 14 Feb 2012 17:11:34 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EHBYps009276; Tue, 14 Feb 2012 17:11:34 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201202141711.q1EHBYps009276@svn.freebsd.org> From: Jim Harris Date: Tue, 14 Feb 2012 17:11: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: r231693 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 17:11:34 -0000 Author: jimharris Date: Tue Feb 14 17:11:34 2012 New Revision: 231693 URL: http://svn.freebsd.org/changeset/base/231693 Log: Update HISTORY for isci.4 man page. Sponsored by: Intel Approved by: scottl Modified: head/share/man/man4/isci.4 Modified: head/share/man/man4/isci.4 ============================================================================== --- head/share/man/man4/isci.4 Tue Feb 14 17:09:20 2012 (r231692) +++ head/share/man/man4/isci.4 Tue Feb 14 17:11:34 2012 (r231693) @@ -98,7 +98,7 @@ to the kernel configuration file. The .Nm driver first appeared in -.Fx 10.0 . +.Fx 8.3 and 9.1 . .Sh AUTHORS .An -nosplit The From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 18:51:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AEA71065680; Tue, 14 Feb 2012 18:51:22 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F4F98FC08; Tue, 14 Feb 2012 18:51:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EIpM6T012836; Tue, 14 Feb 2012 18:51:22 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EIpLPX012834; Tue, 14 Feb 2012 18:51:21 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201202141851.q1EIpLPX012834@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 14 Feb 2012 18:51:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231698 - head/tools/test/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 18:51:22 -0000 Author: gnn Date: Tue Feb 14 18:51:21 2012 New Revision: 231698 URL: http://svn.freebsd.org/changeset/base/231698 Log: Add options for program (-p) and to turn off waiting (-w) which is now on by default. The default is to wait after each counter is tested. Since the prompt would go to stdout you won't see it if you're redirecting the output of the executed sub-program to /dev/null, so just press return to continue or Ctrl-D to stop. Modified: head/tools/test/hwpmc/pmctest.py Modified: head/tools/test/hwpmc/pmctest.py ============================================================================== --- head/tools/test/hwpmc/pmctest.py Tue Feb 14 18:00:37 2012 (r231697) +++ head/tools/test/hwpmc/pmctest.py Tue Feb 14 18:51:21 2012 (r231698) @@ -38,10 +38,14 @@ # # To use: # -# pmctest.py ls > /dev/null +# pmctest.py -p ls > /dev/null # # This should result in ls being run with every available counter # and the system should neither lock up nor panic. +# +# The default is to wait after each counter is tested. Since the +# prompt would go to stdout you won't see it, just press return +# to continue or Ctrl-D to stop. import sys import subprocess @@ -53,10 +57,15 @@ notcounter = ["IAF", "IAP", "TSC", "UNC" def main(): - if (len(sys.argv) != 2): - print ("usage: pmctest.py program") + from optparse import OptionParser + + parser = OptionParser() + parser.add_option("-p", "--program", dest="program", + help="program to execute") + parser.add_option("-w", "--wait", action="store_true", dest="wait", + default=True, help="wait after each execution") - program = sys.argv[1] + (options, args) = parser.parse_args() p = subprocess.Popen(["pmccontrol", "-L"], stdout=PIPE) counters = p.communicate()[0] @@ -68,9 +77,15 @@ def main(): for counter in counters.split(): if counter in notcounter: continue - p = subprocess.Popen(["pmcstat", "-p", counter, program], stdout=PIPE) + p = subprocess.Popen(["pmcstat", "-p", counter, options.program], + stdout=PIPE) result = p.communicate()[0] print result + if (options.wait == True): + try: + value = raw_input("next?") + except EOFError: + sys.exit() # The canonical way to make a python module into a script. # Remove if unnecessary. From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 18:57:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19E531065678; Tue, 14 Feb 2012 18:57:11 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0914D8FC18; Tue, 14 Feb 2012 18:57:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EIvA6E013166; Tue, 14 Feb 2012 18:57:10 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EIvAjs013163; Tue, 14 Feb 2012 18:57:10 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201202141857.q1EIvAjs013163@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 14 Feb 2012 18:57: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: r231699 - head/tools/test/hwpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 18:57:11 -0000 Author: gnn Date: Tue Feb 14 18:57:10 2012 New Revision: 231699 URL: http://svn.freebsd.org/changeset/base/231699 Log: Remove UCP from the list of counters Modified: head/tools/test/hwpmc/pmctest.py Modified: head/tools/test/hwpmc/pmctest.py ============================================================================== --- head/tools/test/hwpmc/pmctest.py Tue Feb 14 18:51:21 2012 (r231698) +++ head/tools/test/hwpmc/pmctest.py Tue Feb 14 18:57:10 2012 (r231699) @@ -53,7 +53,7 @@ from subprocess import PIPE # A list of strings that are not really counters, just # name tags that are output by pmccontrol -L -notcounter = ["IAF", "IAP", "TSC", "UNC", "UCF"] +notcounter = ["IAF", "IAP", "TSC", "UNC", "UCF", "UCP"] def main(): From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 20:05:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75C0B10656A4; Tue, 14 Feb 2012 20:05:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCF4E8FC1A; Tue, 14 Feb 2012 20:05:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EK5Svw016005; Tue, 14 Feb 2012 20:05:28 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EK5Sac016002; Tue, 14 Feb 2012 20:05:28 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202142005.q1EK5Sac016002@svn.freebsd.org> From: Adrian Chadd Date: Tue, 14 Feb 2012 20:05: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: r231708 - in head/sys/dev/ath/ath_hal: . ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 20:05:29 -0000 Author: adrian Date: Tue Feb 14 20:05:28 2012 New Revision: 231708 URL: http://svn.freebsd.org/changeset/base/231708 Log: Improve the radar register config API. * Fix the "enabled" flag to actually reflect whether radar detection is enabled or not. * Add flags for the relstep/relpwr checks. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue Feb 14 19:58:00 2012 (r231707) +++ head/sys/dev/ath/ath_hal/ah.h Tue Feb 14 20:05:28 2012 (r231708) @@ -733,10 +733,11 @@ typedef struct { */ int32_t pe_extchannel; /* Enable DFS on ext channel */ int32_t pe_enabled; /* Whether radar detection is enabled */ + int32_t pe_enrelpwr; + int32_t pe_en_relstep_check; } HAL_PHYERR_PARAM; #define HAL_PHYERR_PARAM_NOVAL 65535 -#define HAL_PHYERR_PARAM_ENABLE 0x8000 /* Enable/Disable if applicable */ /* * DFS operating mode flags. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Tue Feb 14 19:58:00 2012 (r231707) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Tue Feb 14 20:05:28 2012 (r231708) @@ -740,19 +740,12 @@ ar5416GetDfsThresh(struct ath_hal *ah, H pe->pe_prssi = MS(val, AR_PHY_RADAR_0_PRSSI); pe->pe_inband = MS(val, AR_PHY_RADAR_0_INBAND); + /* RADAR_1 values */ val = OS_REG_READ(ah, AR_PHY_RADAR_1); - temp = val & AR_PHY_RADAR_1_RELPWR_ENA; pe->pe_relpwr = MS(val, AR_PHY_RADAR_1_RELPWR_THRESH); - if (temp) - pe->pe_relpwr |= HAL_PHYERR_PARAM_ENABLE; - temp = val & AR_PHY_RADAR_1_RELSTEP_CHECK; pe->pe_relstep = MS(val, AR_PHY_RADAR_1_RELSTEP_THRESH); - if (temp) - pe->pe_enabled = 1; - else - pe->pe_enabled = 0; - pe->pe_maxlen = MS(val, AR_PHY_RADAR_1_MAXLEN); + pe->pe_extchannel = !! (OS_REG_READ(ah, AR_PHY_RADAR_EXT) & AR_PHY_RADAR_EXT_ENA); @@ -762,6 +755,12 @@ ar5416GetDfsThresh(struct ath_hal *ah, H AR_PHY_RADAR_1_BLOCK_CHECK); pe->pe_enmaxrssi = !! (OS_REG_READ(ah, AR_PHY_RADAR_1) & AR_PHY_RADAR_1_MAX_RRSSI); + pe->pe_enabled = !! + (OS_REG_READ(ah, AR_PHY_RADAR_0) & AR_PHY_RADAR_0_ENA); + pe->pe_enrelpwr = !! (OS_REG_READ(ah, AR_PHY_RADAR_1) & + AR_PHY_RADAR_1_RELPWR_ENA); + pe->pe_en_relstep_check = !! (OS_REG_READ(ah, AR_PHY_RADAR_1) & + AR_PHY_RADAR_1_RELSTEP_CHECK); } /* @@ -798,9 +797,15 @@ ar5416EnableDfs(struct ath_hal *ah, HAL_ /*Enable FFT data*/ val |= AR_PHY_RADAR_0_FFT_ENA; + OS_REG_WRITE(ah, AR_PHY_RADAR_0, val); - OS_REG_WRITE(ah, AR_PHY_RADAR_0, val | AR_PHY_RADAR_0_ENA); + /* Implicitly enable */ + if (pe->pe_enabled == 1) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_0, AR_PHY_RADAR_0_ENA); + else if (pe->pe_enabled == 0) + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_0, AR_PHY_RADAR_0_ENA); + /* XXX is this around the correct way?! */ if (pe->pe_usefir128 == 1) OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_USE_FIR128); else if (pe->pe_usefir128 == 0) @@ -816,6 +821,33 @@ ar5416EnableDfs(struct ath_hal *ah, HAL_ else if (pe->pe_blockradar == 0) OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_BLOCK_CHECK); + if (pe->pe_relstep != HAL_PHYERR_PARAM_NOVAL) { + val = OS_REG_READ(ah, AR_PHY_RADAR_1); + val &= ~AR_PHY_RADAR_1_RELSTEP_THRESH; + val |= SM(pe->pe_relstep, AR_PHY_RADAR_1_RELSTEP_THRESH); + OS_REG_WRITE(ah, AR_PHY_RADAR_1, val); + } + if (pe->pe_relpwr != HAL_PHYERR_PARAM_NOVAL) { + val = OS_REG_READ(ah, AR_PHY_RADAR_1); + val &= ~AR_PHY_RADAR_1_RELPWR_THRESH; + val |= SM(pe->pe_relpwr, AR_PHY_RADAR_1_RELPWR_THRESH); + OS_REG_WRITE(ah, AR_PHY_RADAR_1, val); + } + + if (pe->pe_en_relstep_check == 1) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_1, + AR_PHY_RADAR_1_RELSTEP_CHECK); + else if (pe->pe_en_relstep_check == 0) + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, + AR_PHY_RADAR_1_RELSTEP_CHECK); + + if (pe->pe_enrelpwr == 1) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_1, + AR_PHY_RADAR_1_RELPWR_ENA); + else if (pe->pe_enrelpwr == 0) + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, + AR_PHY_RADAR_1_RELPWR_ENA); + if (pe->pe_maxlen != HAL_PHYERR_PARAM_NOVAL) { val = OS_REG_READ(ah, AR_PHY_RADAR_1); val &= ~AR_PHY_RADAR_1_MAXLEN; @@ -832,19 +864,6 @@ ar5416EnableDfs(struct ath_hal *ah, HAL_ OS_REG_SET_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA); else if (pe->pe_extchannel == 0) OS_REG_CLR_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA); - - if (pe->pe_relstep != HAL_PHYERR_PARAM_NOVAL) { - val = OS_REG_READ(ah, AR_PHY_RADAR_1); - val &= ~AR_PHY_RADAR_1_RELSTEP_THRESH; - val |= SM(pe->pe_relstep, AR_PHY_RADAR_1_RELSTEP_THRESH); - OS_REG_WRITE(ah, AR_PHY_RADAR_1, val); - } - if (pe->pe_relpwr != HAL_PHYERR_PARAM_NOVAL) { - val = OS_REG_READ(ah, AR_PHY_RADAR_1); - val &= ~AR_PHY_RADAR_1_RELPWR_THRESH; - val |= SM(pe->pe_relpwr, AR_PHY_RADAR_1_RELPWR_THRESH); - OS_REG_WRITE(ah, AR_PHY_RADAR_1, val); - } } /* From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 20:06:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 367621065670; Tue, 14 Feb 2012 20:06:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 258408FC1B; Tue, 14 Feb 2012 20:06:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EK6Tdb016076; Tue, 14 Feb 2012 20:06:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EK6ShY016074; Tue, 14 Feb 2012 20:06:28 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202142006.q1EK6ShY016074@svn.freebsd.org> From: Adrian Chadd Date: Tue, 14 Feb 2012 20:06: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: r231709 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 20:06:29 -0000 Author: adrian Date: Tue Feb 14 20:06:28 2012 New Revision: 231709 URL: http://svn.freebsd.org/changeset/base/231709 Log: Fix the usefir128 config bit flipping. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Tue Feb 14 20:05:28 2012 (r231708) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Tue Feb 14 20:06:28 2012 (r231709) @@ -805,11 +805,10 @@ ar5416EnableDfs(struct ath_hal *ah, HAL_ else if (pe->pe_enabled == 0) OS_REG_CLR_BIT(ah, AR_PHY_RADAR_0, AR_PHY_RADAR_0_ENA); - /* XXX is this around the correct way?! */ if (pe->pe_usefir128 == 1) - OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_USE_FIR128); - else if (pe->pe_usefir128 == 0) OS_REG_SET_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_USE_FIR128); + else if (pe->pe_usefir128 == 0) + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_USE_FIR128); if (pe->pe_enmaxrssi == 1) OS_REG_SET_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_MAX_RRSSI); From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 20:08:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03D891065676; Tue, 14 Feb 2012 20:08:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBAA18FC13; Tue, 14 Feb 2012 20:08:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EK8oL4016179; Tue, 14 Feb 2012 20:08:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EK8ocj016177; Tue, 14 Feb 2012 20:08:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202142008.q1EK8ocj016177@svn.freebsd.org> From: Adrian Chadd Date: Tue, 14 Feb 2012 20:08: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: r231710 - head/tools/tools/ath/athradar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 20:08:51 -0000 Author: adrian Date: Tue Feb 14 20:08:50 2012 New Revision: 231710 URL: http://svn.freebsd.org/changeset/base/231710 Log: Add some missing radar config parameters. Modified: head/tools/tools/ath/athradar/athradar.c Modified: head/tools/tools/ath/athradar/athradar.c ============================================================================== --- head/tools/tools/ath/athradar/athradar.c Tue Feb 14 20:06:28 2012 (r231709) +++ head/tools/tools/ath/athradar/athradar.c Tue Feb 14 20:08:50 2012 (r231710) @@ -101,6 +101,8 @@ radarset(struct radarhandler *radar, int pe.pe_enmaxrssi = HAL_PHYERR_PARAM_NOVAL; pe.pe_extchannel = HAL_PHYERR_PARAM_NOVAL; + pe.pe_enrelpwr = HAL_PHYERR_PARAM_NOVAL; + pe.pe_en_relstep_check = HAL_PHYERR_PARAM_NOVAL; switch (op) { case DFS_PARAM_ENABLE: @@ -142,7 +144,14 @@ radarset(struct radarhandler *radar, int case DFS_PARAM_EN_EXTCH: pe.pe_extchannel = param; break; + case DFS_PARAM_RELPWR_EN: + pe.pe_enrelpwr = param; + break; + case DFS_PARAM_RELSTEP_EN: + pe.pe_en_relstep_check = param; + break; } + radar->atd.ad_id = DFS_SET_THRESH | ATH_DIAG_IN; radar->atd.ad_out_data = NULL; radar->atd.ad_out_size = 0; @@ -182,16 +191,21 @@ radar_get(struct radarhandler *radar) printf(" pe_blockradar: %d\n", pe.pe_blockradar); printf(" pe_enmaxrssi: %d\n", pe.pe_enmaxrssi); printf(" pe_extchannel: %d\n", pe.pe_extchannel); + printf(" pe_enrelpwr: %d\n", pe.pe_enrelpwr); + printf(" pe_en_relstep_check: %d\n", pe.pe_en_relstep_check); } static int -radar_set_param(struct radarhandler *radar, const char *param, const char *val) +radar_set_param(struct radarhandler *radar, const char *param, + const char *val) { int v; v = atoi(val); - if (strcmp(param, "firpwr") == 0) { + if (strcmp(param, "enabled") == 0) { + radarset(radar, DFS_PARAM_ENABLE, v); + } else if (strcmp(param, "firpwr") == 0) { radarset(radar, DFS_PARAM_FIRPWR, v); } else if (strcmp(param, "rrssi") == 0) { radarset(radar, DFS_PARAM_RRSSI, v); @@ -215,6 +229,10 @@ radar_set_param(struct radarhandler *rad radarset(radar, DFS_PARAM_MAXRSSI_EN, v); } else if (strcmp(param, "extchannel") == 0) { radarset(radar, DFS_PARAM_EN_EXTCH, v); + } else if (strcmp(param, "enrelpwr") == 0) { + radarset(radar, DFS_PARAM_RELPWR_EN, v); + } else if (strcmp(param, "en_relstep_check") == 0) { + radarset(radar, DFS_PARAM_RELSTEP_EN, v); } else { return 0; } From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 20:34:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AF9F106566C; Tue, 14 Feb 2012 20:34:25 +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 79E668FC1C; Tue, 14 Feb 2012 20:34:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EKYPxj017228; Tue, 14 Feb 2012 20:34:25 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EKYPxd017226; Tue, 14 Feb 2012 20:34:25 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201202142034.q1EKYPxd017226@svn.freebsd.org> From: Robert Watson Date: Tue, 14 Feb 2012 20:34: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: r231712 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 20:34:25 -0000 Author: rwatson Date: Tue Feb 14 20:34:25 2012 New Revision: 231712 URL: http://svn.freebsd.org/changeset/base/231712 Log: When initialising the CP0 status register during boot on 64-bit MIPS, set all three of the kernel, supervisor, and user-mode 64-bit mode flags. While FreeBSD does not currently use the supervisor ring (and hence this is effectively a NOP on most systems), doing this avoids triggering an exception on 64-bit MIPS CPUs that don't support 32-bit compatibility mode, and therefore don't allow clearing the SX bit. Reviewed by: gonzo MFC after: 3 days Sponsored by: DARPA, SRI International Modified: head/sys/mips/mips/locore.S Modified: head/sys/mips/mips/locore.S ============================================================================== --- head/sys/mips/mips/locore.S Tue Feb 14 20:12:16 2012 (r231711) +++ head/sys/mips/mips/locore.S Tue Feb 14 20:34:25 2012 (r231712) @@ -118,7 +118,7 @@ VECTOR(_locore, unknown) */ li t1, MIPS_SR_COP_1_BIT #ifdef __mips_n64 - or t1, MIPS_SR_KX | MIPS_SR_UX + or t1, MIPS_SR_KX | MIPS_SR_SX | MIPS_SR_UX #endif #endif /* From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 21:36:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 331AF10656B3; Tue, 14 Feb 2012 21:36:56 +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 21CDE8FC1C; Tue, 14 Feb 2012 21:36:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1ELaumA020156; Tue, 14 Feb 2012 21:36:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ELauR8020153; Tue, 14 Feb 2012 21:36:56 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201202142136.q1ELauR8020153@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 14 Feb 2012 21:36: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: r231713 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 21:36:56 -0000 Author: hselasky Date: Tue Feb 14 21:36:55 2012 New Revision: 231713 URL: http://svn.freebsd.org/changeset/base/231713 Log: Add new USB device ID. MFC after: 3 days PR: usb/165154 Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Tue Feb 14 20:34:25 2012 (r231712) +++ head/sys/dev/usb/serial/u3g.c Tue Feb 14 21:36:55 2012 (r231713) @@ -433,6 +433,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUANTA, Q111, 0), U3G_DEV(SIERRA, AC402, 0), U3G_DEV(SIERRA, AC595U, 0), + U3G_DEV(SIERRA, AC313U, 0), U3G_DEV(SIERRA, AC597E, 0), U3G_DEV(SIERRA, AC875E, 0), U3G_DEV(SIERRA, AC875U, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Feb 14 20:34:25 2012 (r231712) +++ head/sys/dev/usb/usbdevs Tue Feb 14 21:36:55 2012 (r231713) @@ -3005,6 +3005,7 @@ product SIERRA E6892 0x6892 E6892 product SIERRA E6893 0x6893 E6893 product SIERRA MC8700 0x68A3 MC8700 product SIERRA AIRCARD875 0x6820 Aircard 875 HSDPA +product SIERRA AC313U 0x68aa Sierra Wireless AirCard 313U product SIERRA TRUINSTALL 0x0fff Aircard Tru Installer /* Sigmatel products */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 21:48:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8EA11065676; Tue, 14 Feb 2012 21:48:46 +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 A5BD18FC1F; Tue, 14 Feb 2012 21:48:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1ELmktq020650; Tue, 14 Feb 2012 21:48:46 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ELmksT020631; Tue, 14 Feb 2012 21:48:46 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202142148.q1ELmksT020631@svn.freebsd.org> From: Dimitry Andric Date: Tue, 14 Feb 2012 21:48: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: r231714 - in head: etc/mtree include include/xlocale lib/libc/locale sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 21:48:46 -0000 Author: dim Date: Tue Feb 14 21:48:46 2012 New Revision: 231714 URL: http://svn.freebsd.org/changeset/base/231714 Log: Revert r231673 and r231682 for now, until we can run a full make universe with them. Sorry for the breakage. Pointy hat to: me and brooks Added: head/include/_xlocale_ctype.h - copied unchanged from r231672, head/include/_xlocale_ctype.h Deleted: head/include/xlocale/ Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/include/ctype.h head/include/langinfo.h head/include/locale.h head/include/runetype.h head/include/string.h head/include/time.h head/include/wchar.h head/include/wctype.h head/include/xlocale.h head/lib/libc/locale/Symbol.map head/lib/libc/locale/setrunelocale.c head/lib/libc/locale/table.c head/lib/libc/locale/xlocale.c head/lib/libc/locale/xlocale_private.h head/sys/sys/cdefs.h Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Tue Feb 14 21:36:55 2012 (r231713) +++ head/etc/mtree/BSD.include.dist Tue Feb 14 21:48:46 2012 (r231714) @@ -329,6 +329,4 @@ .. vm .. - xlocale - .. .. Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Tue Feb 14 21:36:55 2012 (r231713) +++ head/include/Makefile Tue Feb 14 21:48:46 2012 (r231714) @@ -6,7 +6,7 @@ .include CLEANFILES= osreldate.h version vers.c -SUBDIR= arpa gssapi protocols rpcsvc rpc xlocale +SUBDIR= arpa gssapi protocols rpcsvc rpc INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ db.h \ dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \ @@ -24,7 +24,7 @@ INCS= a.out.h ar.h assert.h bitstring.h strings.h sysexits.h tar.h termios.h tgmath.h \ time.h timeconv.h timers.h ttyent.h \ ulimit.h unistd.h utime.h utmpx.h uuid.h varargs.h vis.h \ - wchar.h wctype.h wordexp.h xlocale.h + wchar.h wctype.h wordexp.h xlocale.h _xlocale_ctype.h MHDRS= float.h floatingpoint.h stdarg.h Copied: head/include/_xlocale_ctype.h (from r231672, head/include/_xlocale_ctype.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/_xlocale_ctype.h Tue Feb 14 21:48:46 2012 (r231714, copy of r231672, head/include/_xlocale_ctype.h) @@ -0,0 +1,162 @@ +/*- + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by David Chisnall under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions * are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _XLOCALE_H_ +#error This header should only be included by , never directly. +#endif + +#ifndef _XLOCALE_CTYPE_H_ +__BEGIN_DECLS +unsigned long ___runetype_l(__ct_rune_t, locale_t) __pure; +__ct_rune_t ___tolower_l(__ct_rune_t, locale_t) __pure; +__ct_rune_t ___toupper_l(__ct_rune_t, locale_t) __pure; +_RuneLocale *__runes_for_locale(locale_t, int*); +__END_DECLS +#endif + +#ifndef _XLOCALE_INLINE +#if __GNUC__ && !__GNUC_STDC_INLINE__ +#define _XLOCALE_INLINE extern inline +#else +#define _XLOCALE_INLINE inline +#endif +#endif + +#ifdef XLOCALE_WCTYPES +static __inline int +__maskrune_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (_c < 0 || _c >= _CACHED_RUNES) ? ___runetype_l(_c, locale) : + runes->__runetype[_c] & _f; +} + +static __inline int +__istype_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +{ + return (!!__maskrune_l(_c, _f, locale)); +} + +#define XLOCALE_ISCTYPE(fname, cat) \ + _XLOCALE_INLINE int isw##fname##_l(int c, locale_t l)\ + { return __istype_l(c, cat, l); } +#else +static __inline int +__sbmaskrune_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (_c < 0 || _c >= mb_sb_limit) ? 0 : + runes->__runetype[_c] & _f; +} + +static __inline int +__sbistype_l(__ct_rune_t _c, unsigned long _f, locale_t locale) +{ + return (!!__sbmaskrune_l(_c, _f, locale)); +} + +#define XLOCALE_ISCTYPE(fname, cat) \ + _XLOCALE_INLINE int is##fname##_l(int c, locale_t l)\ + { return __sbistype_l(c, cat, l); } +#endif + +XLOCALE_ISCTYPE(alnum, _CTYPE_A|_CTYPE_D) +XLOCALE_ISCTYPE(alpha, _CTYPE_A) +XLOCALE_ISCTYPE(blank, _CTYPE_B) +XLOCALE_ISCTYPE(cntrl, _CTYPE_C) +XLOCALE_ISCTYPE(digit, _CTYPE_D) +XLOCALE_ISCTYPE(graph, _CTYPE_G) +XLOCALE_ISCTYPE(hexnumber, _CTYPE_X) +XLOCALE_ISCTYPE(ideogram, _CTYPE_I) +XLOCALE_ISCTYPE(lower, _CTYPE_L) +XLOCALE_ISCTYPE(number, _CTYPE_D) +XLOCALE_ISCTYPE(phonogram, _CTYPE_Q) +XLOCALE_ISCTYPE(print, _CTYPE_R) +XLOCALE_ISCTYPE(punct, _CTYPE_P) +XLOCALE_ISCTYPE(rune, 0xFFFFFF00L) +XLOCALE_ISCTYPE(space, _CTYPE_S) +XLOCALE_ISCTYPE(special, _CTYPE_T) +XLOCALE_ISCTYPE(upper, _CTYPE_U) +XLOCALE_ISCTYPE(xdigit, _CTYPE_X) +#undef XLOCALE_ISCTYPE + +#ifdef XLOCALE_WCTYPES +_XLOCALE_INLINE int towlower_l(int c, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (c < 0 || c >= _CACHED_RUNES) ? ___tolower_l(c, locale) : + runes->__maplower[c]; +} +_XLOCALE_INLINE int towupper_l(int c, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (c < 0 || c >= _CACHED_RUNES) ? ___toupper_l(c, locale) : + runes->__mapupper[c]; +} +_XLOCALE_INLINE int +__wcwidth_l(__ct_rune_t _c, locale_t locale) +{ + unsigned int _x; + + if (_c == 0) + return (0); + _x = (unsigned int)__maskrune_l(_c, _CTYPE_SWM|_CTYPE_R, locale); + if ((_x & _CTYPE_SWM) != 0) + return ((_x & _CTYPE_SWM) >> _CTYPE_SWS); + return ((_x & _CTYPE_R) != 0 ? 1 : -1); +} +int iswctype_l(wint_t wc, wctype_t charclass, locale_t locale); +wctype_t wctype_l(const char *property, locale_t locale); +wint_t towctrans_l(wint_t wc, wctrans_t desc, locale_t locale); +wint_t nextwctype_l(wint_t wc, wctype_t wct, locale_t locale); +wctrans_t wctrans_l(const char *charclass, locale_t locale); +#undef XLOCALE_WCTYPES +#else +_XLOCALE_INLINE int digittoint_l(int c, locale_t locale) +{ return __sbmaskrune_l((c), 0xFF, locale); } + +_XLOCALE_INLINE int tolower_l(int c, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (c < 0 || c >= mb_sb_limit) ? c : + runes->__maplower[c]; +} +_XLOCALE_INLINE int toupper_l(int c, locale_t locale) +{ + int mb_sb_limit; + _RuneLocale *runes = __runes_for_locale(locale, &mb_sb_limit); + return (c < 0 || c >= mb_sb_limit) ? c : + runes->__mapupper[c]; +} +#endif Modified: head/include/ctype.h ============================================================================== --- head/include/ctype.h Tue Feb 14 21:36:55 2012 (r231713) +++ head/include/ctype.h Tue Feb 14 21:48:46 2012 (r231714) @@ -78,10 +78,6 @@ int isphonogram(int); int isrune(int); int isspecial(int); #endif - -#if __POSIX_VISIBLE >= 200809 -#include -#endif __END_DECLS #ifndef __cplusplus Modified: head/include/langinfo.h ============================================================================== --- head/include/langinfo.h Tue Feb 14 21:36:55 2012 (r231713) +++ head/include/langinfo.h Tue Feb 14 21:48:46 2012 (r231714) @@ -130,10 +130,6 @@ typedef __nl_item nl_item; __BEGIN_DECLS char *nl_langinfo(nl_item); - -#if __POSIX_VISIBLE >= 200809 -#include -#endif __END_DECLS #endif /* !_LANGINFO_H_ */ Modified: head/include/locale.h ============================================================================== --- head/include/locale.h Tue Feb 14 21:36:55 2012 (r231713) +++ head/include/locale.h Tue Feb 14 21:48:46 2012 (r231714) @@ -77,11 +77,54 @@ struct lconv { __BEGIN_DECLS struct lconv *localeconv(void); char *setlocale(int, const char *); +__END_DECLS #if __POSIX_VISIBLE >= 200809 -#include -#endif + +#define LC_COLLATE_MASK (1<<0) +#define LC_CTYPE_MASK (1<<1) +#define LC_MESSAGES_MASK (1<<2) +#define LC_MONETARY_MASK (1<<3) +#define LC_NUMERIC_MASK (1<<4) +#define LC_TIME_MASK (1<<5) +#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | \ + LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK) + +#define LC_GLOBAL_LOCALE ((locale_t)-1) + +__BEGIN_DECLS + +typedef struct _xlocale *locale_t; +/** + * Creates a new locale. + */ +locale_t newlocale(int mask, const char *locale, locale_t base); + +/** + * Returns an identical duplicate of the passed locale. The returned locale + * must be freed with freelocale(). The returned locale will share components + * with the original. + */ +locale_t duplocale(locale_t base); +/* + * Free a locale_t. This is quite a poorly named function. It actually + * disclaims a reference to a locale_t, rather than freeing it. + */ +int freelocale(locale_t loc); + +/* + * Returns the name of the locale for a particular component of a locale_t. + */ +const char *querylocale(int mask, locale_t loc); + +/* + * Installs the specified locale_t as this thread's locale. + */ +locale_t uselocale(locale_t loc); + __END_DECLS +#endif /* __POSIX_VISIBLE >= 200809 */ + #endif /* _LOCALE_H_ */ Modified: head/include/runetype.h ============================================================================== --- head/include/runetype.h Tue Feb 14 21:36:55 2012 (r231713) +++ head/include/runetype.h Tue Feb 14 21:48:46 2012 (r231714) @@ -85,21 +85,11 @@ typedef struct { #define _RUNE_MAGIC_1 "RuneMagi" /* Indicates version 0 of RuneLocale */ __BEGIN_DECLS extern const _RuneLocale _DefaultRuneLocale; -extern const _RuneLocale *_CurrentRuneLocale; -#if defined(__NO_TLS) || defined(__RUNETYPE_INTERNAL) -extern const _RuneLocale *__getCurrentRuneLocale(void); -#else -extern const _Thread_local _RuneLocale *_ThreadRuneLocale; -static inline const _RuneLocale *__getCurrentRuneLocale(void) -{ - - if (_ThreadRuneLocale) - return _ThreadRuneLocale; - if (_CurrentRuneLocale) - return _CurrentRuneLocale; - return &_DefaultRuneLocale; -} -#endif /* __NO_TLS || __RUNETYPE_INTERNAL */ +__attribute__((deprecated)) +extern _RuneLocale *_CurrentRuneLocale; +/* TODO: This is called quite a lot, so we should use a __thread variable when + * it's available. */ +extern _RuneLocale *__getCurrentRuneLocale(void); #define _CurrentRuneLocale (__getCurrentRuneLocale()) __END_DECLS Modified: head/include/string.h ============================================================================== --- head/include/string.h Tue Feb 14 21:36:55 2012 (r231713) +++ head/include/string.h Tue Feb 14 21:48:46 2012 (r231714) @@ -132,10 +132,6 @@ void swab(const void * __restrict, void #endif /* _SWAB_DECLARED */ #endif /* __BSD_VISIBLE */ - -#if __POSIX_VISIBLE >= 200809 -#include -#endif __END_DECLS #endif /* _STRING_H_ */ Modified: head/include/time.h ============================================================================== --- head/include/time.h Tue Feb 14 21:36:55 2012 (r231713) +++ head/include/time.h Tue Feb 14 21:48:46 2012 (r231714) @@ -183,10 +183,6 @@ void tzsetwall(void); time_t timelocal(struct tm * const); time_t timegm(struct tm * const); #endif /* __BSD_VISIBLE */ - -#if __POSIX_VISIBLE >= 200809 -#include -#endif __END_DECLS #endif /* !_TIME_H_ */ Modified: head/include/wchar.h ============================================================================== --- head/include/wchar.h Tue Feb 14 21:36:55 2012 (r231713) +++ head/include/wchar.h Tue Feb 14 21:48:46 2012 (r231714) @@ -224,10 +224,6 @@ wchar_t *fgetwln(FILE * __restrict, size size_t wcslcat(wchar_t *, const wchar_t *, size_t); size_t wcslcpy(wchar_t *, const wchar_t *, size_t); #endif - -#if __POSIX_VISIBLE >= 200809 -#include -#endif __END_DECLS #endif /* !_WCHAR_H_ */ Modified: head/include/wctype.h ============================================================================== --- head/include/wctype.h Tue Feb 14 21:36:55 2012 (r231713) +++ head/include/wctype.h Tue Feb 14 21:48:46 2012 (r231714) @@ -87,11 +87,6 @@ wint_t iswrune(wint_t); wint_t iswspecial(wint_t); wint_t nextwctype(wint_t, wctype_t); #endif - -#if __POSIX_VISIBLE >= 200809 -#define _XLOCALE_WCTYPES 1 -#include -#endif /* __POSIX_VISIBLE >= 200809 */ __END_DECLS #ifndef __cplusplus Modified: head/include/xlocale.h ============================================================================== --- head/include/xlocale.h Tue Feb 14 21:36:55 2012 (r231713) +++ head/include/xlocale.h Tue Feb 14 21:48:46 2012 (r231714) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, 2012 The FreeBSD Foundation + * Copyright (c) 2011 The FreeBSD Foundation * All rights reserved. * * This software was developed by David Chisnall under sponsorship from @@ -8,16 +8,16 @@ * 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. + * 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 + * 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) @@ -33,51 +33,224 @@ #define _XLOCALE_H_ #include + __BEGIN_DECLS -#include +/* + * Extended locale versions of the locale-aware functions from string.h. + * + * Include before to expose these. + */ #ifdef _STRING_H_ -#include +int strcoll_l(const char *, const char *, locale_t); +size_t strxfrm_l(char *, const char *, size_t, locale_t); +int strcasecmp_l(const char *, const char *, locale_t); +char *strcasestr_l(const char *, const char *, locale_t); +int strncasecmp_l(const char *, const char *, size_t, locale_t); #endif - +/* + * Extended locale versions of the locale-aware functions from inttypes.h. + * + * Include before to expose these. + */ #ifdef _INTTYPES_H_ -#include +intmax_t +strtoimax_l(const char * __restrict, char ** __restrict, int, locale_t); +uintmax_t +strtoumax_l(const char * __restrict, char ** __restrict, int, locale_t); +intmax_t +wcstoimax_l(const wchar_t * __restrict, wchar_t ** __restrict, int , locale_t); +uintmax_t +wcstoumax_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); #endif - +/* + * Extended locale versions of the locale-aware functions from monetary.h. + * + * Include before to expose these. + */ #ifdef _MONETARY_H_ -#include +ssize_t strfmon_l(char *, size_t, locale_t, const char *, ...) +# if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 + __attribute__((__format__ (__strfmon__, 4, 5))) +# endif + ; #endif +/* + * Extended locale versions of the locale-aware functions from stdlib.h. + * + * Include before to expose these. + */ #ifdef _STDLIB_H_ -#include -#endif +double atof_l(const char *, locale_t); +int atoi_l(const char *, locale_t); +long atol_l(const char *, locale_t); +long long atoll_l(const char *, locale_t); +int mblen_l(const char *, size_t, locale_t); +size_t +mbstowcs_l(wchar_t * __restrict, const char * __restrict, size_t, locale_t); +int +mbtowc_l(wchar_t * __restrict, const char * __restrict, size_t, locale_t); +double strtod_l(const char *, char **, locale_t); +float strtof_l(const char *, char **, locale_t); +long strtol_l(const char *, char **, int, locale_t); +long double strtold_l(const char *, char **, locale_t); +long long strtoll_l(const char *, char **, int, locale_t); +unsigned long strtoul_l(const char *, char **, int, locale_t); +unsigned long long strtoull_l(const char *, char **, int, locale_t); +size_t +wcstombs_l(char * __restrict, const wchar_t * __restrict, size_t, locale_t); +int wctomb_l(char *, wchar_t, locale_t); +int ___mb_cur_max_l(locale_t); +#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x)) + +#endif +/* + * Extended locale versions of the locale-aware functions from time.h. + * + * Include before to expose these. + */ #ifdef _TIME_H_ -#include +size_t +strftime_l(char * __restrict, size_t, const char * __restrict, const + struct tm * __restrict, locale_t) +# if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7 + __attribute__((__format__ (__strftime__, 3, 0))) +# endif + ; +char * +strptime_l(const char * __restrict, const char * __restrict, + struct tm * __restrict, locale_t); #endif - #ifdef _LANGINFO_H_ -#include +char *nl_langinfo_l(nl_item, locale_t); #endif - #ifdef _CTYPE_H_ -#include +#include <_xlocale_ctype.h> #endif - #ifdef _WCTYPE_H_ -#define _XLOCALE_WCTYPES 1 -#include +#define XLOCALE_WCTYPES 1 +#include <_xlocale_ctype.h> #endif #ifdef _STDIO_H_ -#include +int fprintf_l(FILE * __restrict, locale_t, const char * __restrict, ...) + __printflike(3, 4); +int fscanf_l(FILE * __restrict, locale_t, const char * __restrict, ...) + __scanflike(3, 4); +int printf_l(locale_t, const char * __restrict, ...) __printflike(2, 3); +int scanf_l(locale_t, const char * __restrict, ...) __scanflike(2, 3); +int sprintf_l(char * __restrict, locale_t, const char * __restrict, ...) + __printflike(3, 4); +int sscanf_l(const char * __restrict, locale_t, const char * __restrict, ...) + __scanflike(3, 4); +int vfprintf_l(FILE * __restrict, locale_t, const char * __restrict, __va_list) + __printflike(3, 0); +int vprintf_l(locale_t, const char * __restrict, __va_list) __printflike(2, 0); +int vsprintf_l(char * __restrict, locale_t, const char * __restrict, __va_list) + __printflike(3, 0); + +int snprintf_l(char * __restrict, size_t, locale_t, const char * __restrict, + ...) __printflike(4, 5); +int vfscanf_l(FILE * __restrict, locale_t, const char * __restrict, __va_list) + __scanflike(3, 0); +int vscanf_l(locale_t, const char * __restrict, __va_list) __scanflike(2, 0); +int vsnprintf_l(char * __restrict, size_t, locale_t, const char * __restrict, + __va_list) __printflike(4, 0); +int vsscanf_l(const char * __restrict, locale_t, const char * __restrict, + __va_list) __scanflike(3, 0); +int dprintf_l(int, locale_t, const char * __restrict, ...) __printflike(3, 4); +int vdprintf_l(int, locale_t, const char * __restrict, __va_list) + __printflike(3, 0); +int asprintf_l(char **, locale_t, const char *, ...) __printflike(3, 4); +int vasprintf_l(char **, locale_t, const char *, __va_list) __printflike(3, 0); #endif - #ifdef _WCHAR_H_ -#include -#endif - +wint_t btowc_l(int, locale_t); +wint_t fgetwc_l(FILE *, locale_t); +wchar_t * +fgetws_l(wchar_t * __restrict, int, FILE * __restrict, locale_t); +wint_t fputwc_l(wchar_t, FILE *, locale_t); +int +fputws_l(const wchar_t * __restrict, FILE * __restrict, locale_t); +int +fwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, + ...); +int +fwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, ...); +wint_t getwc_l(FILE *, locale_t); +wint_t getwchar_l(locale_t); +size_t +mbrlen_l(const char * __restrict, size_t, mbstate_t * __restrict, locale_t); +size_t +mbrtowc_l(wchar_t * __restrict, const char * __restrict, size_t, + mbstate_t * __restrict, locale_t); +int mbsinit_l(const mbstate_t *, locale_t); +size_t +mbsrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t, + mbstate_t * __restrict, locale_t); +wint_t putwc_l(wchar_t, FILE *, locale_t); +wint_t putwchar_l(wchar_t, locale_t); +int +swprintf_l(wchar_t * __restrict, size_t n, locale_t, + const wchar_t * __restrict, ...); +int +swscanf_l(const wchar_t * __restrict, locale_t, const wchar_t * __restrict, + ...); +wint_t ungetwc_l(wint_t, FILE *, locale_t); +int +vfwprintf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, + __va_list); +int +vswprintf_l(wchar_t * __restrict, size_t n, locale_t, + const wchar_t * __restrict, __va_list); +int vwprintf_l(locale_t, const wchar_t * __restrict, __va_list); +size_t +wcrtomb_l(char * __restrict, wchar_t, mbstate_t * __restrict, locale_t); +int wcscoll_l(const wchar_t *, const wchar_t *, locale_t); +size_t +wcsftime_l(wchar_t * __restrict, size_t, const wchar_t * __restrict, + const struct tm * __restrict, locale_t); +size_t +wcsrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t, + mbstate_t * __restrict, locale_t); +double wcstod_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); +long +wcstol_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); +unsigned long +wcstoul_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); +int wcswidth_l(const wchar_t *, size_t, locale_t); +size_t +wcsxfrm_l(wchar_t * __restrict, const wchar_t * __restrict, size_t, locale_t); +int wctob_l(wint_t, locale_t); +int wcwidth_l(wchar_t, locale_t); +int wprintf_l(locale_t, const wchar_t * __restrict, ...); +int wscanf_l(locale_t, const wchar_t * __restrict, ...); + +int +vfwscanf_l(FILE * __restrict, locale_t, const wchar_t * __restrict, + __va_list); +int vswscanf_l(const wchar_t * __restrict, locale_t, +const wchar_t *__restrict, __va_list); +int vwscanf_l(locale_t, const wchar_t * __restrict, __va_list); +float wcstof_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); +long double +wcstold_l(const wchar_t * __restrict, wchar_t ** __restrict, locale_t); +long long +wcstoll_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); +unsigned long long +wcstoull_l(const wchar_t * __restrict, wchar_t ** __restrict, int, locale_t); +size_t +mbsnrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t, size_t, + mbstate_t * __restrict, locale_t); +int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t); +int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t); +size_t +wcsnrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t, size_t, + mbstate_t * __restrict, locale_t); +#endif struct lconv *localeconv_l(locale_t); __END_DECLS Modified: head/lib/libc/locale/Symbol.map ============================================================================== --- head/lib/libc/locale/Symbol.map Tue Feb 14 21:36:55 2012 (r231713) +++ head/lib/libc/locale/Symbol.map Tue Feb 14 21:48:46 2012 (r231714) @@ -194,7 +194,6 @@ FBSD_1.3 { wcstoull_l; wcstoumax_l; __runes_for_locale; - _ThreadRuneLocale; }; FBSDprivate_1.0 { Modified: head/lib/libc/locale/setrunelocale.c ============================================================================== --- head/lib/libc/locale/setrunelocale.c Tue Feb 14 21:36:55 2012 (r231713) +++ head/lib/libc/locale/setrunelocale.c Tue Feb 14 21:48:46 2012 (r231714) @@ -38,8 +38,6 @@ #include __FBSDID("$FreeBSD$"); -#define __RUNETYPE_INTERNAL 1 - #include #include #include @@ -52,15 +50,6 @@ __FBSDID("$FreeBSD$"); #include "mblocal.h" #include "setlocale.h" -#undef _CurrentRuneLocale -extern _RuneLocale const *_CurrentRuneLocale; -#ifndef __NO_TLS -/* - * A cached version of the runes for this thread. Used by ctype.h - */ -_Thread_local const _RuneLocale *_ThreadRuneLocale; -#endif - extern int __mb_sb_limit; extern _RuneLocale *_Read_RuneMagi(FILE *); @@ -83,8 +72,7 @@ static void destruct_ctype(void *v) free(l->runes); free(l); } - -const _RuneLocale *__getCurrentRuneLocale(void) +_RuneLocale *__getCurrentRuneLocale(void) { return XLOCALE_CTYPE(__get_locale())->runes; } @@ -180,24 +168,9 @@ __wrap_setrunelocale(const char *locale) } __mb_cur_max = __xlocale_global_ctype.__mb_cur_max; __mb_sb_limit = __xlocale_global_ctype.__mb_sb_limit; - _CurrentRuneLocale = __xlocale_global_ctype.runes; return (_LDP_LOADED); } - -#ifndef __NO_TLS -void -__set_thread_rune_locale(locale_t loc) { - - if (loc == NULL) { - _ThreadRuneLocale = &_DefaultRuneLocale; - } else { - _ThreadRuneLocale = XLOCALE_CTYPE(loc)->runes; - } -} -#endif - -void * -__ctype_load(const char *locale, locale_t unused) +void *__ctype_load(const char *locale, locale_t unused) { struct xlocale_ctype *l = calloc(sizeof(struct xlocale_ctype), 1); l->header.header.destructor = destruct_ctype; Modified: head/lib/libc/locale/table.c ============================================================================== --- head/lib/libc/locale/table.c Tue Feb 14 21:36:55 2012 (r231713) +++ head/lib/libc/locale/table.c Tue Feb 14 21:48:46 2012 (r231714) @@ -251,7 +251,7 @@ const _RuneLocale _DefaultRuneLocale = { }; #undef _CurrentRuneLocale -const _RuneLocale *_CurrentRuneLocale = &_DefaultRuneLocale; +_RuneLocale *_CurrentRuneLocale = (_RuneLocale*)&_DefaultRuneLocale; _RuneLocale * __runes_for_locale(locale_t locale, int *mb_sb_limit) Modified: head/lib/libc/locale/xlocale.c ============================================================================== --- head/lib/libc/locale/xlocale.c Tue Feb 14 21:36:55 2012 (r231713) +++ head/lib/libc/locale/xlocale.c Tue Feb 14 21:48:46 2012 (r231714) @@ -6,18 +6,17 @@ * the FreeBSD Foundation. * * 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. + * 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 + * 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) @@ -32,7 +31,6 @@ #include #include #include -#include #include "libc_private.h" #include "xlocale_private.h" @@ -52,17 +50,6 @@ extern struct xlocale_component __xlocal */ extern struct xlocale_component __xlocale_C_collate; extern struct xlocale_component __xlocale_C_ctype; - -#ifndef __NO_TLS -/* - * The locale for this thread. - */ -_Thread_local locale_t __thread_locale; -#endif -/* - * Flag indicating that one or more per-thread locales exist. - */ -int __has_thread_locale; /* * Private functions in setlocale.c. */ @@ -116,7 +103,6 @@ static locale_t thread_local_locale; static void init_key(void) { - pthread_key_create(&locale_info_key, xlocale_release); pthread_setspecific(locale_info_key, (void*)42); if (pthread_getspecific(locale_info_key) == (void*)42) { @@ -124,8 +110,6 @@ static void init_key(void) } else { fake_tls = 1; } - /* At least one per-thread locale has now been set. */ - __has_thread_locale = 1; __detect_path_locale(); } @@ -134,14 +118,12 @@ static pthread_once_t once_control = PTH static locale_t get_thread_locale(void) { - _once(&once_control, init_key); return (fake_tls ? thread_local_locale : pthread_getspecific(locale_info_key)); } -#ifdef __NO_TLS locale_t __get_locale(void) { @@ -149,13 +131,11 @@ __get_locale(void) return (l ? l : &__xlocale_global_locale); } -#endif static void set_thread_locale(locale_t loc) { - - _once(&once_control, init_key); + pthread_once(&once_control, init_key); if (NULL != loc) { xlocale_retain((struct xlocale_refcounted*)loc); @@ -169,10 +149,6 @@ set_thread_locale(locale_t loc) } else { pthread_setspecific(locale_info_key, loc); } -#ifndef __NO_TLS - __thread_locale = loc; - __set_thread_rune_locale(loc); -#endif } /** @@ -183,7 +159,6 @@ static void destruct_locale(void *l) { locale_t loc = l; - for (int type=0 ; typecomponents[type]) { xlocale_release(loc->components[type]); @@ -202,7 +177,6 @@ static locale_t alloc_locale(void) { locale_t new = calloc(sizeof(struct _xlocale), 1); - new->header.destructor = destruct_locale; new->monetary_locale_changed = 1; new->numeric_locale_changed = 1; @@ -219,23 +193,19 @@ copyflags(locale_t new, locale_t old) static int dupcomponent(int type, locale_t base, locale_t new) { - /* Always copy from the global locale, since it has mutable components. - */ + /* Always copy from the global locale, since it has mutable components. */ struct xlocale_component *src = base->components[type]; - if (&__xlocale_global_locale == base) { new->components[type] = constructors[type](src->locale, new); if (new->components[type]) { - strncpy(new->components[type]->locale, src->locale, - ENCODING_LEN); + strncpy(new->components[type]->locale, src->locale, ENCODING_LEN); } } else if (base->components[type]) { new->components[type] = xlocale_retain(base->components[type]); } else { - /* If the component was NULL, return success - if base is a - * valid locale then the flag indicating that this isn't - * present should be set. If it isn't a valid locale, then - * we're stuck anyway. */ + /* If the component was NULL, return success - if base is a valid + * locale then the flag indicating that this isn't present should be + * set. If it isn't a valid locale, then we're stuck anyway. */ return 1; } return (0 != new->components[type]); @@ -274,11 +244,9 @@ locale_t newlocale(int mask, const char if (useenv) { realLocale = __get_locale_env(type); } - new->components[type] = - constructors[type](realLocale, new); + new->components[type] = constructors[type](realLocale, new); if (new->components[type]) { - strncpy(new->components[type]->locale, - realLocale, ENCODING_LEN); + strncpy(new->components[type]->locale, realLocale, ENCODING_LEN); } else { success = 0; break; @@ -351,7 +319,7 @@ const char *querylocale(int mask, locale return (NULL); if (loc->components[type]) return (loc->components[type]->locale); - return ("C"); + return "C"; } /* Modified: head/lib/libc/locale/xlocale_private.h ============================================================================== --- head/lib/libc/locale/xlocale_private.h Tue Feb 14 21:36:55 2012 (r231713) +++ head/lib/libc/locale/xlocale_private.h Tue Feb 14 21:48:46 2012 (r231714) @@ -8,16 +8,16 @@ * 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. + * 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 + * 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) @@ -85,14 +85,14 @@ struct _xlocale { struct xlocale_refcounted header; /** Components for the locale. */ struct xlocale_component *components[XLC_LAST]; - /** Flag indicating if components[XLC_MONETARY] has changed since the - * last call to localeconv_l() with this locale. */ + /** Flag indicating if components[XLC_MONETARY] has changed since the last + * call to localeconv_l() with this locale. */ int monetary_locale_changed; /** Flag indicating whether this locale is actually using a locale for * LC_MONETARY (1), or if it should use the C default instead (0). */ int using_monetary_locale; - /** Flag indicating if components[XLC_NUMERIC] has changed since the - * last call to localeconv_l() with this locale. */ + /** Flag indicating if components[XLC_NUMERIC] has changed since the last + * call to localeconv_l() with this locale. */ int numeric_locale_changed; /** Flag indicating whether this locale is actually using a locale for * LC_NUMERIC (1), or if it should use the C default instead (0). */ @@ -170,38 +170,12 @@ extern struct _xlocale __xlocale_global_ extern struct _xlocale __xlocale_C_locale; /** - * Caches the rune table in TLS for fast access. - */ -void __set_thread_rune_locale(locale_t loc); -/** - * Flag indicating whether a per-thread locale has been set. If no per-thread - * locale has ever been set, then we always use the global locale. - */ -extern int __has_thread_locale; -#ifndef __NO_TLS -/** - * The per-thread locale. Avoids the need to use pthread lookup functions when - * getting the per-thread locale. - */ -extern _Thread_local locale_t __thread_locale; - -/** * Returns the current locale for this thread, or the global locale if none is * set. The caller does not have to free the locale. The return value from * this call is not guaranteed to remain valid after the locale changes. As * such, this should only be called within libc functions. */ -inline locale_t __get_locale(void) -{ - - if (!__has_thread_locale) { - return (&__xlocale_global_locale); - } - return (__thread_locale ? __thread_locale : &__xlocale_global_locale); -} -#else locale_t __get_locale(void); -#endif /** * Two magic values are allowed for locale_t objects. NULL and -1. This Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Tue Feb 14 21:36:55 2012 (r231713) +++ head/sys/sys/cdefs.h Tue Feb 14 21:48:46 2012 (r231714) @@ -230,8 +230,7 @@ #define _Alignof(e) alignof(e) #define _Noreturn [[noreturn]] #define _Static_assert(e, s) static_assert(e, s) -/* FIXME: change this to thread_local when clang in base supports it */ -#define _Thread_local __thread +#define _Thread_local thread_local #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L /* Do nothing. They are language keywords. */ #else @@ -401,18 +400,12 @@ #define __printflike(fmtarg, firstvararg) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Feb 14 22:27:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3769106566B; Tue, 14 Feb 2012 22:27:43 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B291C8FC0C; Tue, 14 Feb 2012 22:27:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1EMRhU7022038; Tue, 14 Feb 2012 22:27:43 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1EMRhst022036; Tue, 14 Feb 2012 22:27:43 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202142227.q1EMRhst022036@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 14 Feb 2012 22:27: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: r231716 - head/sys/dev/mps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2012 22:27:43 -0000 Author: ken Date: Tue Feb 14 22:27:43 2012 New Revision: 231716 URL: http://svn.freebsd.org/changeset/base/231716 Log: Set the max_lun field of the path inquiry CCB to 8. This allows LUNs greater than 0 to be probed. It can be increased later if need be. This brings back SVN rev 224973, which was inadvertently removed with the import of the LSI driver. Reported by: dwhite MFC after: 3 days Modified: head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Tue Feb 14 22:06:08 2012 (r231715) +++ head/sys/dev/mps/mps_sas.c Tue Feb 14 22:27:43 2012 (r231716) @@ -919,7 +919,7 @@ mpssas_action(struct cam_sim *sim, union cpi->hba_misc = PIM_NOBUSRESET; cpi->hba_eng_cnt = 0; cpi->max_target = sassc->sc->facts->MaxTargets - 1; - cpi->max_lun = 0; + cpi->max_lun = 8; cpi->initiator_id = 255; strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "LSILogic", HBA_IDLEN); From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 02:01:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A0EA1065670; Wed, 15 Feb 2012 02:01:24 +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 846D68FC0C; Wed, 15 Feb 2012 02:01:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1F21OWw029866; Wed, 15 Feb 2012 02:01:24 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1F21O5V029864; Wed, 15 Feb 2012 02:01:24 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202150201.q1F21O5V029864@svn.freebsd.org> From: Kevin Lo Date: Wed, 15 Feb 2012 02:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231723 - head/usr.sbin/lpr/lpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 02:01:24 -0000 Author: kevlo Date: Wed Feb 15 02:01:24 2012 New Revision: 231723 URL: http://svn.freebsd.org/changeset/base/231723 Log: - Remove some unnecessary cast when assigning NULL to a handle. - Silent a warning Modified: head/usr.sbin/lpr/lpc/cmds.c Modified: head/usr.sbin/lpr/lpc/cmds.c ============================================================================== --- head/usr.sbin/lpr/lpc/cmds.c Wed Feb 15 01:53:46 2012 (r231722) +++ head/usr.sbin/lpr/lpc/cmds.c Wed Feb 15 02:01:24 2012 (r231723) @@ -77,7 +77,7 @@ __FBSDID("$FreeBSD$"); static char *args2line(int argc, char **argv); static int doarg(char *_job); -static int doselect(struct dirent *_d); +static int doselect(const struct dirent *_d); static int kill_qtask(const char *lf); static int sortq(const void *_a, const void *_b); static int touch(struct jobqueue *_jq); @@ -376,7 +376,7 @@ upstat(struct printer *pp, const char *m return; } (void) ftruncate(fd, 0); - if (msg == (char *)NULL) + if (msg == NULL) (void) write(fd, "\n", 1); else (void) write(fd, msg, strlen(msg)); @@ -451,7 +451,7 @@ static int cln_queuecnt; /* number of static int cln_testonly; /* remove-files vs just-print-info */ static int -doselect(struct dirent *d) +doselect(const struct dirent *d) { int c = d->d_name[0]; From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 02:59:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37F2D106567B; Wed, 15 Feb 2012 02:59:18 +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 22A748FC13; Wed, 15 Feb 2012 02:59:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1F2xIU4031846; Wed, 15 Feb 2012 02:59:18 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1F2xIgE031844; Wed, 15 Feb 2012 02:59:18 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201202150259.q1F2xIgE031844@svn.freebsd.org> From: David Xu Date: Wed, 15 Feb 2012 02:59: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: r231724 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 02:59:18 -0000 Author: davidxu Date: Wed Feb 15 02:59:17 2012 New Revision: 231724 URL: http://svn.freebsd.org/changeset/base/231724 Log: Add notes about sigev_notify_kevent_flags introduced in revision 230857 which enables thread-friendly polling on same fd for AIO events. Reviewed by: delphij Modified: head/lib/libc/sys/kqueue.2 Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Wed Feb 15 02:01:24 2012 (r231723) +++ head/lib/libc/sys/kqueue.2 Wed Feb 15 02:59:17 2012 (r231724) @@ -322,6 +322,9 @@ The sigevent portion of the AIO request .Va sigev_notify_kqueue containing the descriptor of the kqueue that the event should be attached to, +.Va sigev_notify_kevent_flags +containing the kevent flags which should be EV_ONESHOT, EV_CLEAR or +EV_DISPATCH, .Va sigev_value containing the udata value, and .Va sigev_notify From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 06:45:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2DF8106566C; Wed, 15 Feb 2012 06:45:49 +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 CAA438FC12; Wed, 15 Feb 2012 06:45:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1F6jn5f041579; Wed, 15 Feb 2012 06:45:49 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1F6jnLi041573; Wed, 15 Feb 2012 06:45:49 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201202150645.q1F6jnLi041573@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 15 Feb 2012 06:45: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: r231743 - in head/sys: dev/xen/blkback dev/xen/blkfront xen/interface/io xen/xenbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 06:45:50 -0000 Author: gibbs Date: Wed Feb 15 06:45:49 2012 New Revision: 231743 URL: http://svn.freebsd.org/changeset/base/231743 Log: Enhance documentation, improve interoperability, and fix defects in FreeBSD's front and back Xen blkif interface drivers. sys/dev/xen/blkfront/block.h: sys/dev/xen/blkfront/blkfront.c: sys/dev/xen/blkback/blkback.c: Replace FreeBSD specific multi-page ring impelementation with support for both the Citrix and Amazon/RedHat versions of this extension. sys/dev/xen/blkfront/blkfront.c: o Add a per-instance sysctl tree that exposes all negotiated transport parameters (ring pages, max number of requests, max request size, max number of segments). o In blkfront_vdevice_to_unit() add a missing return statement so that we properly identify the unit number for high numbered xvd devices. sys/dev/xen/blkback/blkback.c: o Add static dtrace probes for several events in this driver. o Defer connection shutdown processing until the front-end enters the closed state. This avoids prematurely tearing down the connection when buggy front-ends transition to the closing state, even though the device is open and they veto the close request from the tool stack. o Add nodes for maximum request size and the number of active ring pages to the exising, per-instance, sysctl tree. o Miscelaneous style cleanup. sys/xen/interface/io/blkif.h: o Add extensive documentation of the XenStore nodes used to implement the blkif interface. o Document the startup sequence between a front and back driver. o Add structures and documenatation for the "discard" feature (AKA Trim). o Cleanup some definitions related to FreeBSD's request number/size/segment-limit extension. sys/dev/xen/blkfront/blkfront.c: sys/dev/xen/blkback/blkback.c: sys/xen/xenbus/xenbusvar.h: Add the convenience function xenbus_get_otherend_state() and use it to simplify some logic in both block-front and block-back. MFC after: 1 day Modified: head/sys/dev/xen/blkback/blkback.c head/sys/dev/xen/blkfront/blkfront.c head/sys/dev/xen/blkfront/block.h head/sys/xen/interface/io/blkif.h head/sys/xen/xenbus/xenbusvar.h Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Wed Feb 15 06:16:52 2012 (r231742) +++ head/sys/dev/xen/blkback/blkback.c Wed Feb 15 06:45:49 2012 (r231743) @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); * a FreeBSD domain to other domains. */ +#include "opt_kdtrace.h" + #include #include #include @@ -63,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -124,7 +127,7 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_XENBLOCKBACK, "xbbd", "Xen Block Back Driver Data"); #ifdef XBB_DEBUG -#define DPRINTF(fmt, args...) \ +#define DPRINTF(fmt, args...) \ printf("xbb(%s:%d): " fmt, __FUNCTION__, __LINE__, ##args) #else #define DPRINTF(fmt, args...) do {} while(0) @@ -134,7 +137,7 @@ static MALLOC_DEFINE(M_XENBLOCKBACK, "xb * The maximum mapped region size per request we will allow in a negotiated * block-front/back communication channel. */ -#define XBB_MAX_REQUEST_SIZE \ +#define XBB_MAX_REQUEST_SIZE \ MIN(MAXPHYS, BLKIF_MAX_SEGMENTS_PER_REQUEST * PAGE_SIZE) /** @@ -142,9 +145,9 @@ static MALLOC_DEFINE(M_XENBLOCKBACK, "xb * segment blocks) per request we will allow in a negotiated block-front/back * communication channel. */ -#define XBB_MAX_SEGMENTS_PER_REQUEST \ - (MIN(UIO_MAXIOV, \ - MIN(BLKIF_MAX_SEGMENTS_PER_REQUEST, \ +#define XBB_MAX_SEGMENTS_PER_REQUEST \ + (MIN(UIO_MAXIOV, \ + MIN(BLKIF_MAX_SEGMENTS_PER_REQUEST, \ (XBB_MAX_REQUEST_SIZE / PAGE_SIZE) + 1))) /** @@ -980,9 +983,10 @@ xbb_get_gntaddr(struct xbb_xen_reqlist * static uint8_t * xbb_get_kva(struct xbb_softc *xbb, int nr_pages) { - intptr_t first_clear, num_clear; + intptr_t first_clear; + intptr_t num_clear; uint8_t *free_kva; - int i; + int i; KASSERT(nr_pages != 0, ("xbb_get_kva of zero length")); @@ -1681,19 +1685,19 @@ xbb_dispatch_io(struct xbb_softc *xbb, s req_ring_idx++; switch (xbb->abi) { case BLKIF_PROTOCOL_NATIVE: - sg = BLKRING_GET_SG_REQUEST(&xbb->rings.native, - req_ring_idx); + sg = BLKRING_GET_SEG_BLOCK(&xbb->rings.native, + req_ring_idx); break; case BLKIF_PROTOCOL_X86_32: { - sg = BLKRING_GET_SG_REQUEST(&xbb->rings.x86_32, - req_ring_idx); + sg = BLKRING_GET_SEG_BLOCK(&xbb->rings.x86_32, + req_ring_idx); break; } case BLKIF_PROTOCOL_X86_64: { - sg = BLKRING_GET_SG_REQUEST(&xbb->rings.x86_64, - req_ring_idx); + sg = BLKRING_GET_SEG_BLOCK(&xbb->rings.x86_64, + req_ring_idx); break; } default: @@ -1817,8 +1821,8 @@ xbb_run_queue(void *context, int pending struct xbb_xen_reqlist *reqlist; - xbb = (struct xbb_softc *)context; - rings = &xbb->rings; + xbb = (struct xbb_softc *)context; + rings = &xbb->rings; /* * Work gather and dispatch loop. Note that we have a bias here @@ -2032,6 +2036,13 @@ xbb_intr(void *arg) taskqueue_enqueue(xbb->io_taskqueue, &xbb->io_task); } +SDT_PROVIDER_DEFINE(xbb); +SDT_PROBE_DEFINE1(xbb, kernel, xbb_dispatch_dev, flush, flush, "int"); +SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_dev, read, read, "int", "uint64_t", + "uint64_t"); +SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_dev, write, write, "int", + "uint64_t", "uint64_t"); + /*----------------------------- Backend Handlers -----------------------------*/ /** * Backend handler for character device access. @@ -2087,6 +2098,9 @@ xbb_dispatch_dev(struct xbb_softc *xbb, nreq->pendcnt = 1; + SDT_PROBE1(xbb, kernel, xbb_dispatch_dev, flush, + device_get_unit(xbb->dev)); + (*dev_data->csw->d_strategy)(bio); return (0); @@ -2181,6 +2195,17 @@ xbb_dispatch_dev(struct xbb_softc *xbb, bios[bio_idx]->bio_bcount); } #endif + if (operation == BIO_READ) { + SDT_PROBE3(xbb, kernel, xbb_dispatch_dev, read, + device_get_unit(xbb->dev), + bios[bio_idx]->bio_offset, + bios[bio_idx]->bio_length); + } else if (operation == BIO_WRITE) { + SDT_PROBE3(xbb, kernel, xbb_dispatch_dev, write, + device_get_unit(xbb->dev), + bios[bio_idx]->bio_offset, + bios[bio_idx]->bio_length); + } (*dev_data->csw->d_strategy)(bios[bio_idx]); } @@ -2193,6 +2218,12 @@ fail_free_bios: return (error); } +SDT_PROBE_DEFINE1(xbb, kernel, xbb_dispatch_file, flush, flush, "int"); +SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_file, read, read, "int", "uint64_t", + "uint64_t"); +SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_file, write, write, "int", + "uint64_t", "uint64_t"); + /** * Backend handler for file access. * @@ -2237,6 +2268,9 @@ xbb_dispatch_file(struct xbb_softc *xbb, case BIO_FLUSH: { struct mount *mountpoint; + SDT_PROBE1(xbb, kernel, xbb_dispatch_file, flush, + device_get_unit(xbb->dev)); + vfs_is_locked = VFS_LOCK_GIANT(xbb->vn->v_mount); (void) vn_start_write(xbb->vn, &mountpoint, V_WAIT); @@ -2336,6 +2370,10 @@ xbb_dispatch_file(struct xbb_softc *xbb, switch (operation) { case BIO_READ: + SDT_PROBE3(xbb, kernel, xbb_dispatch_file, read, + device_get_unit(xbb->dev), xuio.uio_offset, + xuio.uio_resid); + vn_lock(xbb->vn, LK_EXCLUSIVE | LK_RETRY); /* @@ -2366,6 +2404,10 @@ xbb_dispatch_file(struct xbb_softc *xbb, case BIO_WRITE: { struct mount *mountpoint; + SDT_PROBE3(xbb, kernel, xbb_dispatch_file, write, + device_get_unit(xbb->dev), xuio.uio_offset, + xuio.uio_resid); + (void)vn_start_write(xbb->vn, &mountpoint, V_WAIT); vn_lock(xbb->vn, LK_EXCLUSIVE | LK_RETRY); @@ -3028,6 +3070,8 @@ xbb_collect_frontend_info(struct xbb_sof const char *otherend_path; int error; u_int ring_idx; + u_int ring_page_order; + size_t ring_size; otherend_path = xenbus_get_otherend_path(xbb->dev); @@ -3035,23 +3079,19 @@ xbb_collect_frontend_info(struct xbb_sof * Protocol defaults valid even if all negotiation fails. */ xbb->ring_config.ring_pages = 1; - xbb->max_requests = BLKIF_MAX_RING_REQUESTS(PAGE_SIZE); xbb->max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK; xbb->max_request_size = xbb->max_request_segments * PAGE_SIZE; /* * Mandatory data (used in all versions of the protocol) first. */ - error = xs_gather(XST_NIL, otherend_path, - "ring-ref", "%" PRIu32, - &xbb->ring_config.ring_ref[0], - "event-channel", "%" PRIu32, - &xbb->ring_config.evtchn, - NULL); + error = xs_scanf(XST_NIL, otherend_path, + "event-channel", NULL, "%" PRIu32, + &xbb->ring_config.evtchn); if (error != 0) { xenbus_dev_fatal(xbb->dev, error, - "Unable to retrieve ring information from " - "frontend %s. Unable to connect.", + "Unable to retrieve event-channel information " + "from frontend %s. Unable to connect.", xenbus_get_otherend_path(xbb->dev)); return (error); } @@ -3065,10 +3105,20 @@ xbb_collect_frontend_info(struct xbb_sof * we must use independant calls in order to guarantee * we don't miss information in a sparsly populated front-end * tree. + * + * \note xs_scanf() does not update variables for unmatched + * fields. */ + ring_page_order = 0; (void)xs_scanf(XST_NIL, otherend_path, - "ring-pages", NULL, "%u", + "ring-page-order", NULL, "%u", + &ring_page_order); + xbb->ring_config.ring_pages = 1 << ring_page_order; + (void)xs_scanf(XST_NIL, otherend_path, + "num-ring-pages", NULL, "%u", &xbb->ring_config.ring_pages); + ring_size = PAGE_SIZE * xbb->ring_config.ring_pages; + xbb->max_requests = BLKIF_MAX_RING_REQUESTS(ring_size); (void)xs_scanf(XST_NIL, otherend_path, "max-requests", NULL, "%u", @@ -3116,22 +3166,39 @@ xbb_collect_frontend_info(struct xbb_sof return (EINVAL); } - /* If using a multi-page ring, pull in the remaining references. */ - for (ring_idx = 1; ring_idx < xbb->ring_config.ring_pages; ring_idx++) { - char ring_ref_name[]= "ring_refXX"; - - snprintf(ring_ref_name, sizeof(ring_ref_name), - "ring-ref%u", ring_idx); - error = xs_scanf(XST_NIL, otherend_path, - ring_ref_name, NULL, "%" PRIu32, - &xbb->ring_config.ring_ref[ring_idx]); + if (xbb->ring_config.ring_pages == 1) { + error = xs_gather(XST_NIL, otherend_path, + "ring-ref", "%" PRIu32, + &xbb->ring_config.ring_ref[0], + NULL); if (error != 0) { xenbus_dev_fatal(xbb->dev, error, - "Failed to retriev grant reference " - "for page %u of shared ring. Unable " - "to connect.", ring_idx); + "Unable to retrieve ring information " + "from frontend %s. Unable to " + "connect.", + xenbus_get_otherend_path(xbb->dev)); return (error); } + } else { + /* Multi-page ring format. */ + for (ring_idx = 0; ring_idx < xbb->ring_config.ring_pages; + ring_idx++) { + char ring_ref_name[]= "ring_refXX"; + + snprintf(ring_ref_name, sizeof(ring_ref_name), + "ring-ref%u", ring_idx); + error = xs_scanf(XST_NIL, otherend_path, + ring_ref_name, NULL, "%" PRIu32, + &xbb->ring_config.ring_ref[ring_idx]); + if (error != 0) { + xenbus_dev_fatal(xbb->dev, error, + "Failed to retriev grant " + "reference for page %u of " + "shared ring. Unable " + "to connect.", ring_idx); + return (error); + } + } } error = xs_gather(XST_NIL, otherend_path, @@ -3197,8 +3264,8 @@ xbb_alloc_requests(struct xbb_softc *xbb static int xbb_alloc_request_lists(struct xbb_softc *xbb) { - int i; struct xbb_xen_reqlist *reqlist; + int i; /* * If no requests can be merged, we need 1 request list per @@ -3318,7 +3385,7 @@ xbb_publish_backend_info(struct xbb_soft static void xbb_connect(struct xbb_softc *xbb) { - int error; + int error; if (xenbus_get_state(xbb->dev) == XenbusStateConnected) return; @@ -3399,7 +3466,8 @@ xbb_connect(struct xbb_softc *xbb) static int xbb_shutdown(struct xbb_softc *xbb) { - int error; + XenbusState frontState; + int error; DPRINTF("\n"); @@ -3413,6 +3481,20 @@ xbb_shutdown(struct xbb_softc *xbb) if ((xbb->flags & XBBF_IN_SHUTDOWN) != 0) return (EAGAIN); + xbb->flags |= XBBF_IN_SHUTDOWN; + mtx_unlock(&xbb->lock); + + if (xenbus_get_state(xbb->dev) < XenbusStateClosing) + xenbus_set_state(xbb->dev, XenbusStateClosing); + + frontState = xenbus_get_otherend_state(xbb->dev); + mtx_lock(&xbb->lock); + xbb->flags &= ~XBBF_IN_SHUTDOWN; + + /* The front can submit I/O until entering the closed state. */ + if (frontState < XenbusStateClosed) + return (EAGAIN); + DPRINTF("\n"); /* Indicate shutdown is in progress. */ @@ -3434,19 +3516,6 @@ xbb_shutdown(struct xbb_softc *xbb) DPRINTF("\n"); - /* - * Before unlocking mutex, set this flag to prevent other threads from - * getting into this function - */ - xbb->flags |= XBBF_IN_SHUTDOWN; - mtx_unlock(&xbb->lock); - - if (xenbus_get_state(xbb->dev) < XenbusStateClosing) - xenbus_set_state(xbb->dev, XenbusStateClosing); - - mtx_lock(&xbb->lock); - xbb->flags &= ~XBBF_IN_SHUTDOWN; - /* Indicate to xbb_detach() that is it safe to proceed. */ wakeup(xbb); @@ -3573,6 +3642,16 @@ xbb_setup_sysctl(struct xbb_softc *xbb) "max_request_segments", CTLFLAG_RD, &xbb->max_request_segments, 0, "maximum number of pages per requests (negotiated)"); + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "max_request_size", CTLFLAG_RD, + &xbb->max_request_size, 0, + "maximum size in bytes of a request (negotiated)"); + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "ring_pages", CTLFLAG_RD, + &xbb->ring_config.ring_pages, 0, + "communication channel pages (negotiated)"); } /** @@ -3587,6 +3666,7 @@ xbb_attach(device_t dev) { struct xbb_softc *xbb; int error; + u_int max_ring_page_order; DPRINTF("Attaching to %s\n", xenbus_get_node(dev)); @@ -3621,6 +3701,10 @@ xbb_attach(device_t dev) return (error); } + /* + * Amazon EC2 client compatility. They refer to max-ring-pages + * instead of to max-ring-page-order. + */ error = xs_printf(XST_NIL, xenbus_get_node(xbb->dev), "max-ring-pages", "%zu", XBB_MAX_RING_PAGES); if (error) { @@ -3629,6 +3713,15 @@ xbb_attach(device_t dev) return (error); } + max_ring_page_order = flsl(XBB_MAX_RING_PAGES) - 1; + error = xs_printf(XST_NIL, xenbus_get_node(xbb->dev), + "max-ring-page-order", "%u", max_ring_page_order); + if (error) { + xbb_attach_failed(xbb, error, "writing %s/max-ring-page-order", + xenbus_get_node(xbb->dev)); + return (error); + } + error = xs_printf(XST_NIL, xenbus_get_node(xbb->dev), "max-requests", "%u", XBB_MAX_REQUESTS); if (error) { @@ -3862,12 +3955,16 @@ xbb_frontend_changed(device_t dev, Xenbu xbb_connect(xbb); break; case XenbusStateClosing: + /* + * Frontend has acknowledged Closing request. + * Wait for Closed state. + */ + break; case XenbusStateClosed: mtx_lock(&xbb->lock); xbb_shutdown(xbb); mtx_unlock(&xbb->lock); - if (frontend_state == XenbusStateClosed) - xenbus_set_state(xbb->dev, XenbusStateClosed); + xenbus_set_state(xbb->dev, XenbusStateClosed); break; default: xenbus_dev_fatal(xbb->dev, EINVAL, "saw state %d at frontend", Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Wed Feb 15 06:16:52 2012 (r231742) +++ head/sys/dev/xen/blkfront/blkfront.c Wed Feb 15 06:45:49 2012 (r231743) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -139,7 +140,7 @@ static int xb_dump(void *, void *, vm_of * with blkfront as the emulated drives, easing transition slightly. */ static void -blkfront_vdevice_to_unit(int vdevice, int *unit, const char **name) +blkfront_vdevice_to_unit(uint32_t vdevice, int *unit, const char **name) { static struct vdev_info { int major; @@ -186,6 +187,7 @@ blkfront_vdevice_to_unit(int vdevice, in if (vdevice & (1 << 28)) { *unit = (vdevice & ((1 << 28) - 1)) >> 8; *name = "xbd"; + return; } for (i = 0; info[i].major; i++) { @@ -226,7 +228,7 @@ xlvbd_add(struct xb_softc *sc, blkif_sec sc->xb_disk->d_sectorsize = sector_size; sc->xb_disk->d_mediasize = sectors * sector_size; - sc->xb_disk->d_maxsize = sc->max_request_size; + sc->xb_disk->d_maxsize = sc->max_request_size - PAGE_SIZE; sc->xb_disk->d_flags = 0; disk_create(sc->xb_disk, DISK_VERSION_00); @@ -407,6 +409,40 @@ blkfront_probe(device_t dev) return (ENXIO); } +static void +xb_setup_sysctl(struct xb_softc *xb) +{ + struct sysctl_ctx_list *sysctl_ctx = NULL; + struct sysctl_oid *sysctl_tree = NULL; + + sysctl_ctx = device_get_sysctl_ctx(xb->xb_dev); + if (sysctl_ctx == NULL) + return; + + sysctl_tree = device_get_sysctl_tree(xb->xb_dev); + if (sysctl_tree == NULL) + return; + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "max_requests", CTLFLAG_RD, &xb->max_requests, -1, + "maximum outstanding requests (negotiated)"); + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "max_request_segments", CTLFLAG_RD, + &xb->max_request_segments, 0, + "maximum number of pages per requests (negotiated)"); + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "max_request_size", CTLFLAG_RD, + &xb->max_request_size, 0, + "maximum size in bytes of a request (negotiated)"); + + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, + "ring_pages", CTLFLAG_RD, + &xb->ring_pages, 0, + "communication channel pages (negotiated)"); +} + /* * Setup supplies the backend dir, virtual device. We place an event * channel and shared frame entries. We watch backend to wait if it's @@ -417,14 +453,14 @@ blkfront_attach(device_t dev) { struct xb_softc *sc; const char *name; + uint32_t vdevice; int error; - int vdevice; int i; int unit; /* FIXME: Use dynamic device id if this is not set. */ error = xs_scanf(XST_NIL, xenbus_get_node(dev), - "virtual-device", NULL, "%i", &vdevice); + "virtual-device", NULL, "%" PRIu32, &vdevice); if (error) { xenbus_dev_fatal(dev, error, "reading virtual-device"); device_printf(dev, "Couldn't determine virtual device.\n"); @@ -449,6 +485,8 @@ blkfront_attach(device_t dev) sc->vdevice = vdevice; sc->connected = BLKIF_STATE_DISCONNECTED; + xb_setup_sysctl(sc); + /* Wait for backend device to publish its protocol capabilities. */ xenbus_set_state(dev, XenbusStateInitialising); @@ -501,6 +539,7 @@ blkfront_initialize(struct xb_softc *sc) { const char *otherend_path; const char *node_path; + uint32_t max_ring_page_order; int error; int i; @@ -513,8 +552,8 @@ blkfront_initialize(struct xb_softc *sc) * Protocol defaults valid even if negotiation for a * setting fails. */ + max_ring_page_order = 0; sc->ring_pages = 1; - sc->max_requests = BLKIF_MAX_RING_REQUESTS(PAGE_SIZE); sc->max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK; sc->max_request_size = (sc->max_request_segments - 1) * PAGE_SIZE; sc->max_request_blocks = BLKIF_SEGS_TO_BLOCKS(sc->max_request_segments); @@ -526,13 +565,25 @@ blkfront_initialize(struct xb_softc *sc) * we must use independant calls in order to guarantee * we don't miss information in a sparsly populated back-end * tree. + * + * \note xs_scanf() does not update variables for unmatched + * fields. */ otherend_path = xenbus_get_otherend_path(sc->xb_dev); node_path = xenbus_get_node(sc->xb_dev); + + /* Support both backend schemes for relaying ring page limits. */ + (void)xs_scanf(XST_NIL, otherend_path, + "max-ring-page-order", NULL, "%" PRIu32, + &max_ring_page_order); + sc->ring_pages = 1 << max_ring_page_order; (void)xs_scanf(XST_NIL, otherend_path, "max-ring-pages", NULL, "%" PRIu32, &sc->ring_pages); + if (sc->ring_pages < 1) + sc->ring_pages = 1; + sc->max_requests = BLKIF_MAX_RING_REQUESTS(sc->ring_pages * PAGE_SIZE); (void)xs_scanf(XST_NIL, otherend_path, "max-requests", NULL, "%" PRIu32, &sc->max_requests); @@ -552,6 +603,16 @@ blkfront_initialize(struct xb_softc *sc) sc->ring_pages = XBF_MAX_RING_PAGES; } + if (powerof2(sc->ring_pages) == 0) { + uint32_t new_page_limit; + + new_page_limit = 0x01 << (fls(sc->ring_pages) - 1); + device_printf(sc->xb_dev, "Back-end specified ring-pages of " + "%u is not a power of 2. Limited to %u.\n", + sc->ring_pages, new_page_limit); + sc->ring_pages = new_page_limit; + } + if (sc->max_requests > XBF_MAX_REQUESTS) { device_printf(sc->xb_dev, "Back-end specified max_requests of " "%u limited to front-end limit of %u.\n", @@ -625,11 +686,20 @@ blkfront_initialize(struct xb_softc *sc) if (setup_blkring(sc) != 0) return; + /* Support both backend schemes for relaying ring page limits. */ error = xs_printf(XST_NIL, node_path, - "ring-pages","%u", sc->ring_pages); + "num-ring-pages","%u", sc->ring_pages); if (error) { xenbus_dev_fatal(sc->xb_dev, error, - "writing %s/ring-pages", + "writing %s/num-ring-pages", + node_path); + return; + } + error = xs_printf(XST_NIL, node_path, + "ring-page-order","%u", fls(sc->ring_pages) - 1); + if (error) { + xenbus_dev_fatal(sc->xb_dev, error, + "writing %s/ring-page-order", node_path); return; } @@ -711,25 +781,31 @@ setup_blkring(struct xb_softc *sc) return (error); } } - error = xs_printf(XST_NIL, xenbus_get_node(sc->xb_dev), - "ring-ref","%u", sc->ring_ref[0]); - if (error) { - xenbus_dev_fatal(sc->xb_dev, error, "writing %s/ring-ref", - xenbus_get_node(sc->xb_dev)); - return (error); - } - for (i = 1; i < sc->ring_pages; i++) { - char ring_ref_name[]= "ring_refXX"; - - snprintf(ring_ref_name, sizeof(ring_ref_name), "ring-ref%u", i); + if (sc->ring_pages == 1) { error = xs_printf(XST_NIL, xenbus_get_node(sc->xb_dev), - ring_ref_name, "%u", sc->ring_ref[i]); + "ring-ref", "%u", sc->ring_ref[0]); if (error) { - xenbus_dev_fatal(sc->xb_dev, error, "writing %s/%s", - xenbus_get_node(sc->xb_dev), - ring_ref_name); + xenbus_dev_fatal(sc->xb_dev, error, + "writing %s/ring-ref", + xenbus_get_node(sc->xb_dev)); return (error); } + } else { + for (i = 0; i < sc->ring_pages; i++) { + char ring_ref_name[]= "ring_refXX"; + + snprintf(ring_ref_name, sizeof(ring_ref_name), + "ring-ref%u", i); + error = xs_printf(XST_NIL, xenbus_get_node(sc->xb_dev), + ring_ref_name, "%u", sc->ring_ref[i]); + if (error) { + xenbus_dev_fatal(sc->xb_dev, error, + "writing %s/%s", + xenbus_get_node(sc->xb_dev), + ring_ref_name); + return (error); + } + } } error = bind_listening_port_to_irqhandler( @@ -795,7 +871,7 @@ blkfront_connect(struct xb_softc *sc) unsigned int binfo; int err, feature_barrier; - if( (sc->connected == BLKIF_STATE_CONNECTED) || + if( (sc->connected == BLKIF_STATE_CONNECTED) || (sc->connected == BLKIF_STATE_SUSPENDED) ) return; @@ -923,15 +999,13 @@ blkif_close(struct disk *dp) return (ENXIO); sc->xb_flags &= ~XB_OPEN; if (--(sc->users) == 0) { - /* Check whether we have been instructed to close. We will - have ignored this request initially, as the device was - still mounted. */ - device_t dev = sc->xb_dev; - XenbusState state = - xenbus_read_driver_state(xenbus_get_otherend_path(dev)); - - if (state == XenbusStateClosing) - blkfront_closing(dev); + /* + * Check whether we have been instructed to close. We will + * have ignored this request initially, as the device was + * still mounted. + */ + if (xenbus_get_otherend_state(sc->xb_dev) == XenbusStateClosing) + blkfront_closing(sc->xb_dev); } return (0); } @@ -1033,7 +1107,7 @@ blkif_queue_cb(void *arg, bus_dma_segmen struct xb_command *cm; blkif_request_t *ring_req; struct blkif_request_segment *sg; - struct blkif_request_segment *last_block_sg; + struct blkif_request_segment *last_block_sg; grant_ref_t *sg_ref; vm_paddr_t buffer_ma; uint64_t fsect, lsect; @@ -1104,12 +1178,12 @@ blkif_queue_cb(void *arg, bus_dma_segmen nsegs--; } block_segs = MIN(nsegs, BLKIF_MAX_SEGMENTS_PER_SEGMENT_BLOCK); - if (block_segs == 0) - break; + if (block_segs == 0) + break; - sg = BLKRING_GET_SG_REQUEST(&sc->ring, sc->ring.req_prod_pvt); + sg = BLKRING_GET_SEG_BLOCK(&sc->ring, sc->ring.req_prod_pvt); sc->ring.req_prod_pvt++; - last_block_sg = sg + block_segs; + last_block_sg = sg + block_segs; } if (cm->operation == BLKIF_OP_READ) Modified: head/sys/dev/xen/blkfront/block.h ============================================================================== --- head/sys/dev/xen/blkfront/block.h Wed Feb 15 06:16:52 2012 (r231742) +++ head/sys/dev/xen/blkfront/block.h Wed Feb 15 06:45:49 2012 (r231743) @@ -49,7 +49,7 @@ * guarantee we can handle an unaligned transfer without the need to * use a bounce buffer.. */ -#define XBF_MAX_REQUEST_SIZE \ +#define XBF_MAX_REQUEST_SIZE \ MIN(MAXPHYS, (BLKIF_MAX_SEGMENTS_PER_REQUEST - 1) * PAGE_SIZE) /** @@ -57,8 +57,8 @@ * segment blocks) per request we will allow in a negotiated block-front/back * communication channel. */ -#define XBF_MAX_SEGMENTS_PER_REQUEST \ - (MIN(BLKIF_MAX_SEGMENTS_PER_REQUEST, \ +#define XBF_MAX_SEGMENTS_PER_REQUEST \ + (MIN(BLKIF_MAX_SEGMENTS_PER_REQUEST, \ (XBF_MAX_REQUEST_SIZE / PAGE_SIZE) + 1)) /** Modified: head/sys/xen/interface/io/blkif.h ============================================================================== --- head/sys/xen/interface/io/blkif.h Wed Feb 15 06:16:52 2012 (r231742) +++ head/sys/xen/interface/io/blkif.h Wed Feb 15 06:45:49 2012 (r231743) @@ -1,8 +1,8 @@ /****************************************************************************** * blkif.h - * + * * Unified block-device I/O interface for Xen guest OSes. - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the @@ -22,6 +22,7 @@ * DEALINGS IN THE SOFTWARE. * * Copyright (c) 2003-2004, Keir Fraser + * Copyright (c) 2012, Spectra Logic Corporation */ #ifndef __XEN_PUBLIC_IO_BLKIF_H__ @@ -35,7 +36,7 @@ * notification can be made conditional on req_event (i.e., the generic * hold-off mechanism provided by the ring macros). Backends must set * req_event appropriately (e.g., using RING_FINAL_CHECK_FOR_REQUESTS()). - * + * * Back->front notifications: When enqueuing a new response, sending a * notification can be made conditional on rsp_event (i.e., the generic * hold-off mechanism provided by the ring macros). Frontends must set @@ -48,37 +49,413 @@ #define blkif_sector_t uint64_t /* + * Feature and Parameter Negotiation + * ================================= + * The two halves of a Xen block driver utilize nodes within the XenStore to + * communicate capabilities and to negotiate operating parameters. This + * section enumerates these nodes which reside in the respective front and + * backend portions of the XenStore, following the XenBus convention. + * + * All data in the XenStore is stored as strings. Nodes specifying numeric + * values are encoded in decimal. Integer value ranges listed below are + * expressed as fixed sized integer types capable of storing the conversion + * of a properly formated node string, without loss of information. + * + * Any specified default value is in effect if the corresponding XenBus node + * is not present in the XenStore. + * + * XenStore nodes in sections marked "PRIVATE" are solely for use by the + * driver side whose XenBus tree contains them. + * + * See the XenBus state transition diagram below for details on when XenBus + * nodes must be published and when they can be queried. + * + ***************************************************************************** + * Backend XenBus Nodes + ***************************************************************************** + * + *------------------ Backend Device Identification (PRIVATE) ------------------ + * + * mode + * Values: "r" (read only), "w" (writable) + * + * The read or write access permissions to the backing store to be + * granted to the frontend. + * + * params + * Values: string + * + * A free formatted string providing sufficient information for the + * backend driver to open the backing device. (e.g. the path to the + * file or block device representing the backing store.) + * + * type + * Values: "file", "phy", "tap" + * + * The type of the backing device/object. + * + *--------------------------------- Features --------------------------------- + * + * feature-barrier + * Values: 0/1 (boolean) + * Default Value: 0 + * + * A value of "1" indicates that the backend can process requests + * containing the BLKIF_OP_WRITE_BARRIER request opcode. Requests + * of this type may still be returned at any time with the + * BLKIF_RSP_EOPNOTSUPP result code. + * + * feature-flush-cache + * Values: 0/1 (boolean) + * Default Value: 0 + * + * A value of "1" indicates that the backend can process requests + * containing the BLKIF_OP_FLUSH_DISKCACHE request opcode. Requests + * of this type may still be returned at any time with the + * BLKIF_RSP_EOPNOTSUPP result code. + * + * feature-discard + * Values: 0/1 (boolean) + * Default Value: 0 + * + * A value of "1" indicates that the backend can process requests + * containing the BLKIF_OP_DISCARD request opcode. Requests + * of this type may still be returned at any time with the + * BLKIF_RSP_EOPNOTSUPP result code. + * + *----------------------- Request Transport Parameters ------------------------ + * + * max-ring-page-order + * Values: + * Default Value: 0 + * Notes: 1, 3 + * + * The maximum supported size of the request ring buffer in units of + * lb(machine pages). (e.g. 0 == 1 page, 1 = 2 pages, 2 == 4 pages, + * etc.). + * + * max-ring-pages + * Values: + * Default Value: 1 + * Notes: 2, 3 + * + * The maximum supported size of the request ring buffer in units of + * machine pages. The value must be a power of 2. + * + * max-requests + * Default Value: BLKIF_MAX_RING_REQUESTS(PAGE_SIZE) + * Maximum Value: BLKIF_MAX_RING_REQUESTS(PAGE_SIZE * max-ring-pages) + * + * The maximum number of concurrent, logical requests that will be + * issued by the backend. + * + * Note: A logical request may span multiple ring entries. + * + * max-request-segments + * Values: + * Default Value: BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK + * Maximum Value: BLKIF_MAX_SEGMENTS_PER_REQUEST + * + * The maximum value of blkif_request.nr_segments supported by + * the backend. + * + * max-request-size + * Values: + * Default Value: BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK * PAGE_SIZE + * Maximum Value: BLKIF_MAX_SEGMENTS_PER_REQUEST * PAGE_SIZE + * + * The maximum amount of data, in bytes, that can be referenced by a + * request type that accesses frontend memory (currently BLKIF_OP_READ, + * BLKIF_OP_WRITE, or BLKIF_OP_WRITE_BARRIER). + * + *------------------------- Backend Device Properties ------------------------- + * + * discard-aligment + * Values: + * Default Value: 0 + * Notes: 4, 5 + * + * The offset, in bytes from the beginning of the virtual block device, + * to the first, addressable, discard extent on the underlying device. + * + * discard-granularity + * Values: + * Default Value: <"sector-size"> + * Notes: 4 + * + * The size, in bytes, of the individually addressable discard extents + * of the underlying device. + * + * discard-secure + * Values: 0/1 (boolean) + * Default Value: 0 + * + * A value of "1" indicates that the backend can process BLKIF_OP_DISCARD + * requests with the BLKIF_DISCARD_SECURE flag set. + * + * info + * Values: (bitmap) + * + * A collection of bit flags describing attributes of the backing + * device. The VDISK_* macros define the meaning of each bit + * location. + * + * sector-size + * Values: + * + * The native sector size, in bytes, of the backend device. + * + * sectors + * Values: + * + * The size of the backend device, expressed in units of its native + * sector size ("sector-size"). + * + ***************************************************************************** + * Frontend XenBus Nodes + ***************************************************************************** + * + *----------------------- Request Transport Parameters ----------------------- + * + * event-channel + * Values: + * + * The identifier of the Xen event channel used to signal activity + * in the ring buffer. + * + * ring-ref + * Values: + * Notes: 6 + * + * The Xen grant reference granting permission for the backend to map + * the sole page in a single page sized ring buffer. + * + * ring-ref%u + * Values: + * Notes: 6 + * + * For a frontend providing a multi-page ring, a "num-ring-pages" sized + * list of nodes, each containing a Xen grant reference granting + * permission for the backend to map the page of the ring located + * at page index "%u". Page indexes are zero based. + * + * protocol + * Values: string (XEN_IO_PROTO_ABI_*) + * Default Value: XEN_IO_PROTO_ABI_NATIVE + * + * The machine ABI rules governing the format of all ring request and + * response structures. + * + * ring-page-order + * Values: + * Default Value: 0 + * Maximum Value: MAX(ffs(max-ring-pages) - 1, max-ring-page-order) + * Notes: 1, 3 + * + * The size of the frontend allocated request ring buffer in units + * of lb(machine pages). (e.g. 0 == 1 page, 1 = 2 pages, 2 == 4 pages, + * etc.). + * + * num-ring-pages + * Values: + * Default Value: 1 + * Maximum Value: MAX(max-ring-pages,(0x1 << max-ring-page-order)) + * Notes: 2, 3 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 07:30:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF5B8106566B; Wed, 15 Feb 2012 07:30:23 +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 DA4DA8FC16; Wed, 15 Feb 2012 07:30:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1F7UNCF043197; Wed, 15 Feb 2012 07:30:23 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1F7UNr4043195; Wed, 15 Feb 2012 07:30:23 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201202150730.q1F7UNr4043195@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 15 Feb 2012 07:30: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: r231745 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 07:30:24 -0000 Author: gibbs Date: Wed Feb 15 07:30:23 2012 New Revision: 231745 URL: http://svn.freebsd.org/changeset/base/231745 Log: Limit the ST3146855LW U320 drive to 55 tags to avoid command timeouts under load. Submitted by: Gelson Borsoi MFC after: 1 day Modified: head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Wed Feb 15 06:49:50 2012 (r231744) +++ head/sys/cam/scsi/scsi_xpt.c Wed Feb 15 07:30:23 2012 (r231745) @@ -295,6 +295,14 @@ static struct scsi_quirk_entry scsi_quir }, { /* + * Experiences command timeouts under load with a + * tag count higher than 55. + */ + { T_DIRECT, SIP_MEDIA_FIXED, seagate, "ST3146855LW", "*"}, + /*quirks*/0, /*mintags*/2, /*maxtags*/55 + }, + { + /* * Slow when tagged queueing is enabled. Write performance * steadily drops off with more and more concurrent * transactions. Best sequential write performance with From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 10:02:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84C921065687; Wed, 15 Feb 2012 10:02:20 +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 6EF858FC0C; Wed, 15 Feb 2012 10:02:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FA2KJj048623; Wed, 15 Feb 2012 10:02:20 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FA2KPH048621; Wed, 15 Feb 2012 10:02:20 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202151002.q1FA2KPH048621@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 15 Feb 2012 10:02: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: r231751 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 10:02:20 -0000 Author: ae Date: Wed Feb 15 10:02:19 2012 New Revision: 231751 URL: http://svn.freebsd.org/changeset/base/231751 Log: Add PART::type attribute handler. It returns partition type as string. MFC after: 2 weeks Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed Feb 15 09:53:20 2012 (r231750) +++ head/sys/geom/part/g_part.c Wed Feb 15 10:02:19 2012 (r231751) @@ -2057,6 +2057,7 @@ g_part_start(struct bio *bp) struct g_part_table *table; struct g_kerneldump *gkd; struct g_provider *pp; + char buf[64]; pp = bp->bio_to; gp = pp->geom; @@ -2105,6 +2106,9 @@ g_part_start(struct bio *bp) if (g_handleattr_str(bp, "PART::scheme", table->gpt_scheme->name)) return; + if (g_handleattr_str(bp, "PART::type", + G_PART_TYPE(table, entry, buf, sizeof(buf)))) + return; if (!strcmp("GEOM::kerneldump", bp->bio_attribute)) { /* * Check that the partition is suitable for kernel From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 10:33:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9558C1065670; Wed, 15 Feb 2012 10:33:30 +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 7FE2E8FC17; Wed, 15 Feb 2012 10:33:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FAXURB056738; Wed, 15 Feb 2012 10:33:30 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FAXUfg056736; Wed, 15 Feb 2012 10:33:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202151033.q1FAXUfg056736@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 15 Feb 2012 10:33: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: r231754 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 10:33:30 -0000 Author: ae Date: Wed Feb 15 10:33:29 2012 New Revision: 231754 URL: http://svn.freebsd.org/changeset/base/231754 Log: Add additional check to EBR probe and create methods: don't try probe and create EBR scheme when parent partition type is not "ebr". This fixes error messages about corrupted EBR for some partitions where is actually another partition scheme. NOTE: if you have EBR on the partition with different than "ebr" (0x05) type, then you will lost access to partitions until it will be changed. MFC after: 2 weeks Modified: head/sys/geom/part/g_part_ebr.c Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Wed Feb 15 10:15:15 2012 (r231753) +++ head/sys/geom/part/g_part_ebr.c Wed Feb 15 10:33:29 2012 (r231754) @@ -268,7 +268,7 @@ g_part_ebr_add(struct g_part_table *base static int g_part_ebr_create(struct g_part_table *basetable, struct g_part_parms *gpp) { - char psn[8]; + char type[64]; struct g_consumer *cp; struct g_provider *pp; uint32_t msize; @@ -285,10 +285,15 @@ g_part_ebr_create(struct g_part_table *b if (basetable->gpt_depth == 0) return (ENXIO); cp = LIST_FIRST(&pp->consumers); - error = g_getattr("PART::scheme", cp, &psn); - if (error) + error = g_getattr("PART::scheme", cp, &type); + if (error != 0) return (error); - if (strcmp(psn, "MBR")) + if (strcmp(type, "MBR") != 0) + return (ENXIO); + error = g_getattr("PART::type", cp, &type); + if (error != 0) + return (error); + if (strcmp(type, "ebr") != 0) return (ENXIO); msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); @@ -405,7 +410,7 @@ g_part_ebr_precheck(struct g_part_table static int g_part_ebr_probe(struct g_part_table *table, struct g_consumer *cp) { - char psn[8]; + char type[64]; struct g_provider *pp; u_char *buf, *p; int error, index, res; @@ -422,10 +427,16 @@ g_part_ebr_probe(struct g_part_table *ta /* Check that we have a parent and that it's a MBR. */ if (table->gpt_depth == 0) return (ENXIO); - error = g_getattr("PART::scheme", cp, &psn); - if (error) + error = g_getattr("PART::scheme", cp, &type); + if (error != 0) + return (error); + if (strcmp(type, "MBR") != 0) + return (ENXIO); + /* Check that partition has type DOSPTYP_EBR. */ + error = g_getattr("PART::type", cp, &type); + if (error != 0) return (error); - if (strcmp(psn, "MBR")) + if (strcmp(type, "ebr") != 0) return (ENXIO); /* Check that there's a EBR. */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 14:26:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 901171065674; Wed, 15 Feb 2012 14:26:51 +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 7AAAE8FC0C; Wed, 15 Feb 2012 14:26:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FEQpYc065871; Wed, 15 Feb 2012 14:26:51 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FEQpn7065868; Wed, 15 Feb 2012 14:26:51 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202151426.q1FEQpn7065868@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 15 Feb 2012 14:26: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: r231760 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 14:26:51 -0000 Author: glebius Date: Wed Feb 15 14:26:50 2012 New Revision: 231760 URL: http://svn.freebsd.org/changeset/base/231760 Log: style(9): sort includes. Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Wed Feb 15 14:23:01 2012 (r231759) +++ head/sys/netgraph/ng_base.c Wed Feb 15 14:26:50 2012 (r231760) @@ -43,25 +43,25 @@ */ #include -#include #include #include #include #include +#include #include #include #include #include #include +#include #include -#include -#include #include -#include #include -#include -#include #include +#include +#include +#include +#include #include #include From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 14:29:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2D6E1065672; Wed, 15 Feb 2012 14:29:23 +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 AD3118FC0A; Wed, 15 Feb 2012 14:29:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FETNaT066000; Wed, 15 Feb 2012 14:29:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FETN9B065998; Wed, 15 Feb 2012 14:29:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202151429.q1FETN9B065998@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 15 Feb 2012 14:29: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: r231761 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 14:29:23 -0000 Author: glebius Date: Wed Feb 15 14:29:23 2012 New Revision: 231761 URL: http://svn.freebsd.org/changeset/base/231761 Log: In ng_bypass() add more protection against potential race with ng_rmnode() and its followers. Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Wed Feb 15 14:26:50 2012 (r231760) +++ head/sys/netgraph/ng_base.c Wed Feb 15 14:29:23 2012 (r231761) @@ -1161,6 +1161,10 @@ ng_bypass(hook_p hook1, hook_p hook2) return (EINVAL); } mtx_lock(&ng_topo_mtx); + if (NG_HOOK_NOT_VALID(hook1) || NG_HOOK_NOT_VALID(hook2)) { + mtx_unlock(&ng_topo_mtx); + return (EINVAL); + } hook1->hk_peer->hk_peer = hook2->hk_peer; hook2->hk_peer->hk_peer = hook1->hk_peer; From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 14:56:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EECF1065670; Wed, 15 Feb 2012 14:56:19 +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 1982D8FC28; Wed, 15 Feb 2012 14:56:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FEuI7V067088; Wed, 15 Feb 2012 14:56:18 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FEuIaH067086; Wed, 15 Feb 2012 14:56:18 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202151456.q1FEuIaH067086@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 15 Feb 2012 14:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231764 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 14:56:19 -0000 Author: glebius Date: Wed Feb 15 14:56:18 2012 New Revision: 231764 URL: http://svn.freebsd.org/changeset/base/231764 Log: Remove testing stuff, reducing kernel memory footprint by 1 Kb. Anyway, when we are building a LINT kernel, all these macros are tested via nodes. Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Wed Feb 15 14:31:45 2012 (r231763) +++ head/sys/netgraph/ng_base.c Wed Feb 15 14:56:18 2012 (r231764) @@ -3737,32 +3737,3 @@ ng_replace_retaddr(node_p here, item_p i NGI_RETADDR(item) = ng_node2ID(here); } } - -#define TESTING -#ifdef TESTING -/* just test all the macros */ -void -ng_macro_test(item_p item); -void -ng_macro_test(item_p item) -{ - node_p node = NULL; - hook_p hook = NULL; - struct mbuf *m; - struct ng_mesg *msg; - ng_ID_t retaddr; - int error; - - NGI_GET_M(item, m); - NGI_GET_MSG(item, msg); - retaddr = NGI_RETADDR(item); - NG_SEND_DATA(error, hook, m, NULL); - NG_SEND_DATA_ONLY(error, hook, m); - NG_FWD_NEW_DATA(error, item, hook, m); - NG_FWD_ITEM_HOOK(error, item, hook); - NG_SEND_MSG_HOOK(error, node, msg, hook, retaddr); - NG_SEND_MSG_ID(error, node, msg, retaddr, retaddr); - NG_SEND_MSG_PATH(error, node, msg, ".:", retaddr); - NG_FWD_MSG_HOOK(error, node, item, hook, retaddr); -} -#endif /* TESTING */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 15:06:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3105A106566C; Wed, 15 Feb 2012 15:06:04 +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 036038FC19; Wed, 15 Feb 2012 15:06:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FF63l7067447; Wed, 15 Feb 2012 15:06:03 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FF63Qj067445; Wed, 15 Feb 2012 15:06:03 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202151506.q1FF63Qj067445@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 15 Feb 2012 15:06: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: r231765 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 15:06:04 -0000 Author: glebius Date: Wed Feb 15 15:06:03 2012 New Revision: 231765 URL: http://svn.freebsd.org/changeset/base/231765 Log: Trim double empty lines. Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Wed Feb 15 14:56:18 2012 (r231764) +++ head/sys/netgraph/ng_base.c Wed Feb 15 15:06:03 2012 (r231765) @@ -240,7 +240,6 @@ int ng_path_parse(char *addr, char **nod void ng_rmnode(node_p node, hook_p dummy1, void *dummy2, int dummy3); void ng_unname(node_p node); - /* Our own netgraph malloc type */ MALLOC_DEFINE(M_NETGRAPH, "netgraph", "netgraph structures and ctrl messages"); MALLOC_DEFINE(M_NETGRAPH_MSG, "netgraph_msg", "netgraph name storage"); @@ -341,7 +340,6 @@ ng_alloc_node(void) #define NG_ALLOC_HOOK(hook) do { (hook) = ng_alloc_hook(); } while (0) #define NG_ALLOC_NODE(node) do { (node) = ng_alloc_node(); } while (0) - #define NG_FREE_HOOK(hook) \ do { \ mtx_lock(&ng_nodelist_mtx); \ @@ -1206,7 +1204,6 @@ ng_newtype(struct ng_type *tp) return (EEXIST); } - /* Link in new type */ TYPELIST_WLOCK(); LIST_INSERT_HEAD(&ng_typelist, tp, types); @@ -3275,7 +3272,6 @@ SYSCTL_PROC(_debug, OID_AUTO, ng_dump_it 0, sizeof(int), sysctl_debug_ng_dump_items, "I", "Number of allocated items"); #endif /* NETGRAPH_DEBUG */ - /*********************************************************************** * Worklist routines **********************************************************************/ @@ -3359,7 +3355,6 @@ ng_worklist_add(node_p node) } } - /*********************************************************************** * Externally useable functions to set up a queue item ready for sending ***********************************************************************/ @@ -3440,8 +3435,6 @@ ng_package_msg(struct ng_mesg *msg, int return (item); } - - #define SET_RETADDR(item, here, retaddr) \ do { /* Data or fn items don't have retaddrs */ \ if ((item->el_flags & NGQF_TYPE) == NGQF_MESG) { \ @@ -3667,7 +3660,6 @@ ng_callout_trampoline(void *arg) CURVNET_RESTORE(); } - int ng_callout(struct callout *c, node_p node, hook_p hook, int ticks, ng_item_fn *fn, void * arg1, int arg2) From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 15:19:41 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4857E106566B; Wed, 15 Feb 2012 15:19:41 +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 D357B8FC16; Wed, 15 Feb 2012 15:19:40 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1FFJbQD014979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Feb 2012 02:19:38 +1100 Date: Thu, 16 Feb 2012 02:19:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff In-Reply-To: <201202151426.q1FEQpn7065868@svn.freebsd.org> Message-ID: <20120216015919.X2940@besplex.bde.org> References: <201202151426.q1FEQpn7065868@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231760 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 15:19:41 -0000 On Wed, 15 Feb 2012, Gleb Smirnoff wrote: > Log: > style(9): sort includes. > Modified: head/sys/netgraph/ng_base.c > ============================================================================== > --- head/sys/netgraph/ng_base.c Wed Feb 15 14:23:01 2012 (r231759) > +++ head/sys/netgraph/ng_base.c Wed Feb 15 14:26:50 2012 (r231760) > @@ -43,25 +43,25 @@ > */ > > #include > -#include systm was already sorted. Like param.h, it defines important macros that may be needed by other headers. For example, many headers use KASSERT(). KASSERT() happens to be a macro, so this happens to work if the other headers only use it in other macros, but this would fail if any of the other headers started using it in an inline functions. > #include > #include errno.h is standard pollution in param.h. Including it directly is a style bug. This style bug was not very common. It was in 7 files in kern in 4.4BSD-Lite2, 1 in kern in FreeBSD-3 (after I fixed it in FreeBSD-2), 4 in kern in FreeBSD-4, and 8 in kern in -current. But in the top level directory of netgraph, it is in all 49 of 49 .c files in -current. > #include > #include > +#include > #include > #include > #include > #include > #include > +#include > #include queue.h is nonstandard pollution in many headers. It has already been included (guarded) many times before here. Unfortunately, since it is nonstandard, this can't be depended on, though many .c files do. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 15:27:31 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 034A1106566B; Wed, 15 Feb 2012 15:27:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 78C008FC14; Wed, 15 Feb 2012 15:27:30 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q1FFRTmL049620; Wed, 15 Feb 2012 19:27:29 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q1FFRTUQ049619; Wed, 15 Feb 2012 19:27:29 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 15 Feb 2012 19:27:29 +0400 From: Gleb Smirnoff To: Bruce Evans Message-ID: <20120215152729.GQ20404@FreeBSD.org> References: <201202151426.q1FEQpn7065868@svn.freebsd.org> <20120216015919.X2940@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20120216015919.X2940@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231760 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 15:27:31 -0000 On Thu, Feb 16, 2012 at 02:19:37AM +1100, Bruce Evans wrote: B> On Wed, 15 Feb 2012, Gleb Smirnoff wrote: B> B> > Log: B> > style(9): sort includes. B> > Modified: head/sys/netgraph/ng_base.c B> > ============================================================================== B> > --- head/sys/netgraph/ng_base.c Wed Feb 15 14:23:01 2012 (r231759) B> > +++ head/sys/netgraph/ng_base.c Wed Feb 15 14:26:50 2012 (r231760) B> > @@ -43,25 +43,25 @@ B> > */ B> > B> > #include B> > -#include B> B> systm was already sorted. Like param.h, it defines important macros that B> may be needed by other headers. For example, many headers use KASSERT(). B> KASSERT() happens to be a macro, so this happens to work if the other B> headers only use it in other macros, but this would fail if any of the B> other headers started using it in an inline functions. B> B> > #include B> > #include B> B> errno.h is standard pollution in param.h. Including it directly is a B> style bug. This style bug was not very common. It was in 7 files B> in kern in 4.4BSD-Lite2, 1 in kern in FreeBSD-3 (after I fixed it in B> FreeBSD-2), 4 in kern in FreeBSD-4, and 8 in kern in -current. But B> in the top level directory of netgraph, it is in all 49 of 49 .c files B> in -current. B> B> > #include B> > #include B> > +#include B> > #include B> > #include B> > #include B> > #include B> > #include B> > +#include B> > #include B> B> queue.h is nonstandard pollution in many headers. It has already been B> included (guarded) many times before here. Unfortunately, since it B> is nonstandard, this can't be depended on, though many .c files do. Bruce, is this patch okay? Index: ng_base.c =================================================================== --- ng_base.c (revision 231765) +++ ng_base.c (working copy) @@ -43,8 +43,8 @@ */ #include +#include #include -#include #include #include #include @@ -60,7 +60,6 @@ #include #include #include -#include #include #include I'd prefer to leave sys/queue.h included explicitly. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 15:48:49 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D4FC106564A; Wed, 15 Feb 2012 15:48:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 0AD538FC0C; Wed, 15 Feb 2012 15:48:48 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1FFmkwI029033 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Feb 2012 02:48:47 +1100 Date: Thu, 16 Feb 2012 02:48:46 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff In-Reply-To: <20120215152729.GQ20404@FreeBSD.org> Message-ID: <20120216023627.D3142@besplex.bde.org> References: <201202151426.q1FEQpn7065868@svn.freebsd.org> <20120216015919.X2940@besplex.bde.org> <20120215152729.GQ20404@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r231760 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 15:48:49 -0000 On Wed, 15 Feb 2012, Gleb Smirnoff wrote: > On Thu, Feb 16, 2012 at 02:19:37AM +1100, Bruce Evans wrote: > B> systm was already sorted. Like param.h, it defines important macros that > ... > is this patch okay? Yes. > I'd prefer to leave sys/queue.h included explicitly. Yes, there is nothing better. sys/queue.h is now referenced 926 times in .depend for a kernel with 951 object files. This is more references than even for sys/param.h (901). This shows that sys/queue.h might as well be standard pollution. But hopefully, lots of the dependencies on queue.h are not real ones, but are the result of other pollution which might be cleanable. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 15:54:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C400106566B; Wed, 15 Feb 2012 15:54:58 +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 7B2048FC0C; Wed, 15 Feb 2012 15:54:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FFswNM069060; Wed, 15 Feb 2012 15:54:58 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FFswTF069058; Wed, 15 Feb 2012 15:54:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202151554.q1FFswTF069058@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 15 Feb 2012 15:54: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: r231766 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 15:54:58 -0000 Author: glebius Date: Wed Feb 15 15:54:57 2012 New Revision: 231766 URL: http://svn.freebsd.org/changeset/base/231766 Log: Fix includes list. Submitted by: bde Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Wed Feb 15 15:06:03 2012 (r231765) +++ head/sys/netgraph/ng_base.c Wed Feb 15 15:54:57 2012 (r231766) @@ -43,8 +43,8 @@ */ #include +#include #include -#include #include #include #include @@ -60,7 +60,6 @@ #include #include #include -#include #include #include From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 16:09:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFC2D106566B; Wed, 15 Feb 2012 16:09:56 +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 DE1988FC16; Wed, 15 Feb 2012 16:09:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FG9uaW069589; Wed, 15 Feb 2012 16:09:56 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FG9uRm069583; Wed, 15 Feb 2012 16:09:56 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202151609.q1FG9uRm069583@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 15 Feb 2012 16: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: r231767 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 16:09:57 -0000 Author: bz Date: Wed Feb 15 16:09:56 2012 New Revision: 231767 URL: http://svn.freebsd.org/changeset/base/231767 Log: Fix PAWS (Protect Against Wrapped Sequence numbers) in cases when hz >> 1000 and thus getting outside the timestamp clock frequenceny of 1ms < x < 1s per tick as mandated by RFC1323, leading to connection resets on idle connections. Always use a granularity of 1ms using getmicrouptime() making all but relevant callouts independent of hz. Use getmicrouptime(), not getmicrotime() as the latter may make a jump possibly breaking TCP nfsroot mounts having our timestamps move forward for more than 24.8 days in a second without having been idle for that long. PR: kern/61404 Reviewed by: jhb, mav, rrs Discussed with: silby, lstewart Sponsored by: Sandvine Incorporated (originally in 2011) MFC after: 6 weeks Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_seq.h head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Feb 15 15:54:57 2012 (r231766) +++ head/sys/netinet/tcp_input.c Wed Feb 15 16:09:56 2012 (r231767) @@ -1493,7 +1493,7 @@ tcp_do_segment(struct mbuf *m, struct tc */ if ((to.to_flags & TOF_TS) && (to.to_tsecr != 0)) { to.to_tsecr -= tp->ts_offset; - if (TSTMP_GT(to.to_tsecr, ticks)) + if (TSTMP_GT(to.to_tsecr, tcp_ts_getticks())) to.to_tsecr = 0; } @@ -1518,7 +1518,7 @@ tcp_do_segment(struct mbuf *m, struct tc if (to.to_flags & TOF_TS) { tp->t_flags |= TF_RCVD_TSTMP; tp->ts_recent = to.to_tsval; - tp->ts_recent_age = ticks; + tp->ts_recent_age = tcp_ts_getticks(); } if (to.to_flags & TOF_MSS) tcp_mss(tp, to.to_mss); @@ -1562,7 +1562,7 @@ tcp_do_segment(struct mbuf *m, struct tc */ if ((to.to_flags & TOF_TS) != 0 && SEQ_LEQ(th->th_seq, tp->last_ack_sent)) { - tp->ts_recent_age = ticks; + tp->ts_recent_age = tcp_ts_getticks(); tp->ts_recent = to.to_tsval; } @@ -1600,11 +1600,13 @@ tcp_do_segment(struct mbuf *m, struct tc */ if ((to.to_flags & TOF_TS) != 0 && to.to_tsecr) { - if (!tp->t_rttlow || - tp->t_rttlow > ticks - to.to_tsecr) - tp->t_rttlow = ticks - to.to_tsecr; + u_int t; + + t = tcp_ts_getticks() - to.to_tsecr; + if (!tp->t_rttlow || tp->t_rttlow > t) + tp->t_rttlow = t; tcp_xmit_timer(tp, - ticks - to.to_tsecr + 1); + TCP_TS_TO_TICKS(t) + 1); } else if (tp->t_rtttime && SEQ_GT(th->th_ack, tp->t_rtseq)) { if (!tp->t_rttlow || @@ -2070,7 +2072,7 @@ tcp_do_segment(struct mbuf *m, struct tc TSTMP_LT(to.to_tsval, tp->ts_recent)) { /* Check to see if ts_recent is over 24 days old. */ - if (ticks - tp->ts_recent_age > TCP_PAWS_IDLE) { + if (tcp_ts_getticks() - tp->ts_recent_age > TCP_PAWS_IDLE) { /* * Invalidate ts_recent. If this segment updates * ts_recent, the age will be reset later and ts_recent @@ -2229,7 +2231,7 @@ tcp_do_segment(struct mbuf *m, struct tc SEQ_LEQ(th->th_seq, tp->last_ack_sent) && SEQ_LEQ(tp->last_ack_sent, th->th_seq + tlen + ((thflags & (TH_SYN|TH_FIN)) != 0))) { - tp->ts_recent_age = ticks; + tp->ts_recent_age = tcp_ts_getticks(); tp->ts_recent = to.to_tsval; } @@ -2543,11 +2545,13 @@ process_ACK: * timestamps of 0 or we could calculate a * huge RTT and blow up the retransmit timer. */ - if ((to.to_flags & TOF_TS) != 0 && - to.to_tsecr) { - if (!tp->t_rttlow || tp->t_rttlow > ticks - to.to_tsecr) - tp->t_rttlow = ticks - to.to_tsecr; - tcp_xmit_timer(tp, ticks - to.to_tsecr + 1); + if ((to.to_flags & TOF_TS) != 0 && to.to_tsecr) { + u_int t; + + t = tcp_ts_getticks() - to.to_tsecr; + if (!tp->t_rttlow || tp->t_rttlow > t) + tp->t_rttlow = t; + tcp_xmit_timer(tp, TCP_TS_TO_TICKS(t) + 1); } else if (tp->t_rtttime && SEQ_GT(th->th_ack, tp->t_rtseq)) { if (!tp->t_rttlow || tp->t_rttlow > ticks - tp->t_rtttime) tp->t_rttlow = ticks - tp->t_rtttime; Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Wed Feb 15 15:54:57 2012 (r231766) +++ head/sys/netinet/tcp_output.c Wed Feb 15 16:09:56 2012 (r231767) @@ -680,13 +680,13 @@ send: /* Timestamps. */ if ((tp->t_flags & TF_RCVD_TSTMP) || ((flags & TH_SYN) && (tp->t_flags & TF_REQ_TSTMP))) { - to.to_tsval = ticks + tp->ts_offset; + to.to_tsval = tcp_ts_getticks() + tp->ts_offset; to.to_tsecr = tp->ts_recent; to.to_flags |= TOF_TS; /* Set receive buffer autosizing timestamp. */ if (tp->rfbuf_ts == 0 && (so->so_rcv.sb_flags & SB_AUTOSIZE)) - tp->rfbuf_ts = ticks; + tp->rfbuf_ts = tcp_ts_getticks(); } /* Selective ACK's. */ if (tp->t_flags & TF_SACK_PERMIT) { Modified: head/sys/netinet/tcp_seq.h ============================================================================== --- head/sys/netinet/tcp_seq.h Wed Feb 15 15:54:57 2012 (r231766) +++ head/sys/netinet/tcp_seq.h Wed Feb 15 16:09:56 2012 (r231767) @@ -62,7 +62,34 @@ (tp)->snd_una = (tp)->snd_nxt = (tp)->snd_max = (tp)->snd_up = \ (tp)->snd_recover = (tp)->iss -#define TCP_PAWS_IDLE (24 * 24 * 60 * 60 * hz) - /* timestamp wrap-around time */ +#ifdef _KERNEL +/* + * Clock macros for RFC 1323 timestamps. + */ +#define TCP_TS_TO_TICKS(_t) ((_t) * hz / 1000) + +/* Timestamp wrap-around time, 24 days. */ +#define TCP_PAWS_IDLE (24 * 24 * 60 * 60 * 1000) + +/* + * tcp_ts_getticks() in ms, should be 1ms < x < 1000ms according to RFC 1323. + * We always use 1ms granularity independent of hz. + */ +static __inline u_int +tcp_ts_getticks(void) +{ + struct timeval tv; + u_long ms; + + /* + * getmicrouptime() should be good enough for any 1-1000ms granularity. + * Do not use getmicrotime() here as it might break nfsroot/tcp. + */ + getmicrouptime(&tv); + ms = tv.tv_sec * 1000 + tv.tv_usec / 1000; + + return (ms); +} +#endif /* _KERNEL */ #endif /* _NETINET_TCP_SEQ_H_ */ Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Wed Feb 15 15:54:57 2012 (r231766) +++ head/sys/netinet/tcp_syncache.c Wed Feb 15 16:09:56 2012 (r231767) @@ -819,7 +819,7 @@ syncache_socket(struct syncache *sc, str if (sc->sc_flags & SCF_TIMESTAMP) { tp->t_flags |= TF_REQ_TSTMP|TF_RCVD_TSTMP; tp->ts_recent = sc->sc_tsreflect; - tp->ts_recent_age = ticks; + tp->ts_recent_age = tcp_ts_getticks(); tp->ts_offset = sc->sc_tsoff; } #ifdef TCP_SIGNATURE @@ -1226,7 +1226,7 @@ _syncache_add(struct in_conninfo *inc, s */ if (to->to_flags & TOF_TS) { sc->sc_tsreflect = to->to_tsval; - sc->sc_ts = ticks; + sc->sc_ts = tcp_ts_getticks(); sc->sc_flags |= SCF_TIMESTAMP; } if (to->to_flags & TOF_SCALE) { @@ -1667,7 +1667,7 @@ syncookie_generate(struct syncache_head data |= md5_buffer[2] << 10; /* more digest bits */ data ^= md5_buffer[3]; sc->sc_ts = data; - sc->sc_tsoff = data - ticks; /* after XOR */ + sc->sc_tsoff = data - tcp_ts_getticks(); /* after XOR */ } TCPSTAT_INC(tcps_sc_sendcookie); @@ -1752,7 +1752,7 @@ syncookie_lookup(struct in_conninfo *inc sc->sc_flags |= SCF_TIMESTAMP; sc->sc_tsreflect = to->to_tsval; sc->sc_ts = to->to_tsecr; - sc->sc_tsoff = to->to_tsecr - ticks; + sc->sc_tsoff = to->to_tsecr - tcp_ts_getticks(); sc->sc_flags |= (data & 0x1) ? SCF_SIGNATURE : 0; sc->sc_flags |= ((data >> 1) & 0x1) ? SCF_SACK : 0; sc->sc_requested_s_scale = min((data >> 2) & 0xf, Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Wed Feb 15 15:54:57 2012 (r231766) +++ head/sys/netinet/tcp_timewait.c Wed Feb 15 16:09:56 2012 (r231767) @@ -558,7 +558,7 @@ tcp_twrespond(struct tcptw *tw, int flag */ if (tw->t_recent && flags == TH_ACK) { to.to_flags |= TOF_TS; - to.to_tsval = ticks + tw->ts_offset; + to.to_tsval = tcp_ts_getticks() + tw->ts_offset; to.to_tsecr = tw->t_recent; } optlen = tcp_addoptions(&to, (u_char *)(th + 1)); From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 16:59:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EC8D106566C; Wed, 15 Feb 2012 16:59:25 +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 0D7868FC0A; Wed, 15 Feb 2012 16:59:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FGxOkL071403; Wed, 15 Feb 2012 16:59:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FGxOUC071401; Wed, 15 Feb 2012 16:59:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202151659.q1FGxOUC071401@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 15 Feb 2012 16:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231770 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 16:59:25 -0000 Author: nwhitehorn Date: Wed Feb 15 16:59:24 2012 New Revision: 231770 URL: http://svn.freebsd.org/changeset/base/231770 Log: Improve error handling in smusat(4). MFC after: 4 days Modified: head/sys/powerpc/powermac/smusat.c Modified: head/sys/powerpc/powermac/smusat.c ============================================================================== --- head/sys/powerpc/powermac/smusat.c Wed Feb 15 16:58:08 2012 (r231769) +++ head/sys/powerpc/powermac/smusat.c Wed Feb 15 16:59:24 2012 (r231770) @@ -202,33 +202,46 @@ static int smusat_updatecache(device_t dev) { uint8_t reg = 0x3f; + uint8_t value[16]; struct smusat_softc *sc = device_get_softc(dev); + int error; struct iic_msg msgs[2] = { {0, IIC_M_WR | IIC_M_NOSTOP, 1, ®}, - {0, IIC_M_RD, 16, sc->sc_cache}, + {0, IIC_M_RD, 16, value}, }; msgs[0].slave = msgs[1].slave = iicbus_get_addr(dev); - sc->sc_last_update = time_uptime; + error = iicbus_transfer(dev, msgs, 2); + if (error) + return (error); - return (iicbus_transfer(dev, msgs, 2)); + sc->sc_last_update = time_uptime; + memcpy(sc->sc_cache, value, sizeof(value)); + return (0); } static int smusat_sensor_read(struct smu_sensor *sens) { - int value; + int value, error; device_t dev; struct smusat_softc *sc; dev = sens->dev; sc = device_get_softc(dev); + error = 0; if (time_uptime - sc->sc_last_update > 1) - smusat_updatecache(dev); + error = smusat_updatecache(dev); + if (error) + return (-error); value = (sc->sc_cache[sens->reg*2] << 8) + sc->sc_cache[sens->reg*2 + 1]; + if (value == 0xffff) { + sc->sc_last_update = 0; /* Result was bad, don't cache */ + return (-EINVAL); + } switch (sens->type) { case SMU_TEMP_SENSOR: From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 18:34:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BF6D1065672; Wed, 15 Feb 2012 18:34:58 +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 20E1C8FC13; Wed, 15 Feb 2012 18:34:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FIYviK075537; Wed, 15 Feb 2012 18:34:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FIYv3o075535; Wed, 15 Feb 2012 18:34:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202151834.q1FIYv3o075535@svn.freebsd.org> From: Xin LI Date: Wed, 15 Feb 2012 18: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: r231777 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 18:34:58 -0000 Author: delphij Date: Wed Feb 15 18:34:57 2012 New Revision: 231777 URL: http://svn.freebsd.org/changeset/base/231777 Log: Bump .Dd date for previous revision. Modified: head/lib/libc/sys/kqueue.2 Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Wed Feb 15 18:18:29 2012 (r231776) +++ head/lib/libc/sys/kqueue.2 Wed Feb 15 18:34:57 2012 (r231777) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 7, 2011 +.Dd February 15, 2012 .Dt KQUEUE 2 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 18:59:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 743701065672; Wed, 15 Feb 2012 18:59:27 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 623D68FC0C; Wed, 15 Feb 2012 18:59:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FIxR6l076415; Wed, 15 Feb 2012 18:59:27 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FIxRLo076411; Wed, 15 Feb 2012 18:59:27 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201202151859.q1FIxRLo076411@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 15 Feb 2012 18:59: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: r231778 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 18:59:27 -0000 Author: luigi Date: Wed Feb 15 18:59:26 2012 New Revision: 231778 URL: http://svn.freebsd.org/changeset/base/231778 Log: reduce the differences between these three files. The three drivers (em, lem and igb) are extremely similar, too bad that the structures use different names and we cannot share the code. Modified: head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Wed Feb 15 18:34:57 2012 (r231777) +++ head/sys/dev/netmap/if_em_netmap.h Wed Feb 15 18:59:26 2012 (r231778) @@ -27,7 +27,7 @@ * $FreeBSD$ * $Id: if_em_netmap.h 9802 2011-12-02 18:42:37Z luigi $ * - * netmap changes for if_em. + * netmap support for if_em. * * For structure and details on the individual functions please see * ixgbe_netmap.h @@ -46,6 +46,7 @@ static int em_netmap_txsync(struct ifnet static int em_netmap_rxsync(struct ifnet *, u_int, int); static void em_netmap_lock_wrapper(struct ifnet *, int, u_int); + static void em_netmap_attach(struct adapter *adapter) { @@ -137,6 +138,7 @@ em_netmap_unblock_tasks(struct adapter * } } + /* * register-unregister routine */ @@ -170,7 +172,7 @@ em_netmap_reg(struct ifnet *ifp, int ono } } else { fail: - /* restore if_transmit */ + /* return to non-netmap mode */ ifp->if_transmit = na->if_transmit; ifp->if_capenable &= ~IFCAP_NETMAP; em_init_locked(adapter); /* also enable intr */ @@ -179,6 +181,7 @@ fail: return (error); } + /* * Reconcile hardware and user view of the transmit ring. */ @@ -224,6 +227,7 @@ em_netmap_txsync(struct ifnet *ifp, u_in uint64_t paddr; void *addr = PNMB(slot, &paddr); int len = slot->len; + if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { if (do_lock) EM_TX_UNLOCK(txr); @@ -262,9 +266,9 @@ em_netmap_txsync(struct ifnet *ifp, u_in if (n == 0 || kring->nr_hwavail < 1) { int delta; - /* record completed transmissions using THD. */ + /* record completed transmissions using TDH */ l = E1000_READ_REG(&adapter->hw, E1000_TDH(ring_nr)); - if (l >= kring->nkr_num_slots) { /* XXX can happen */ + if (l >= kring->nkr_num_slots) { /* XXX can it happen ? */ D("TDH wrap %d", l); l -= kring->nkr_num_slots; } @@ -285,6 +289,7 @@ em_netmap_txsync(struct ifnet *ifp, u_in return 0; } + /* * Reconcile kernel and user view of the receive ring. */ @@ -304,6 +309,7 @@ em_netmap_rxsync(struct ifnet *ifp, u_in if (do_lock) EM_RX_LOCK(rxr); + /* XXX check sync modes */ bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); @@ -317,7 +323,7 @@ em_netmap_rxsync(struct ifnet *ifp, u_in */ l = rxr->next_to_check; j = l + kring->nkr_hwofs; - /* here nkr_hwofs can be negative so must check for j < 0 */ + /* XXX here nkr_hwofs can be negative so must check for j < 0 */ if (j < 0) j += lim + 1; else if (j > lim) @@ -395,3 +401,4 @@ em_netmap_rxsync(struct ifnet *ifp, u_in EM_RX_UNLOCK(rxr); return 0; } +/* end of file */ Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Wed Feb 15 18:34:57 2012 (r231777) +++ head/sys/dev/netmap/if_igb_netmap.h Wed Feb 15 18:59:26 2012 (r231778) @@ -27,8 +27,7 @@ * $FreeBSD$ * $Id: if_igb_netmap.h 9802 2011-12-02 18:42:37Z luigi $ * - * netmap modifications for igb - * contribured by Ahmed Kooli + * netmap modifications for igb contributed by Ahmed Kooli */ #include @@ -95,8 +94,7 @@ igb_netmap_lock_wrapper(struct ifnet *if /* - * support for netmap register/unregisted. We are already under core lock. - * only called on the first init or the last unregister. + * register-unregister routine */ static int igb_netmap_reg(struct ifnet *ifp, int onoff) @@ -106,7 +104,7 @@ igb_netmap_reg(struct ifnet *ifp, int on int error = 0; if (na == NULL) - return EINVAL; + return EINVAL; /* no netmap support here */ igb_disable_intr(adapter); @@ -116,7 +114,6 @@ igb_netmap_reg(struct ifnet *ifp, int on if (onoff) { ifp->if_capenable |= IFCAP_NETMAP; - /* save if_transmit to restore it later */ na->if_transmit = ifp->if_transmit; ifp->if_transmit = netmap_start; @@ -130,14 +127,14 @@ fail: /* restore if_transmit */ ifp->if_transmit = na->if_transmit; ifp->if_capenable &= ~IFCAP_NETMAP; - igb_init_locked(adapter); /* also enables intr */ + igb_init_locked(adapter); /* also enable intr */ } return (error); } /* - * Reconcile kernel and user view of the transmit ring. + * Reconcile hardware and user view of the transmit ring. */ static int igb_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock) @@ -161,30 +158,30 @@ igb_netmap_txsync(struct ifnet *ifp, u_i bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, BUS_DMASYNC_POSTREAD); - /* update avail to what the hardware knows */ - ring->avail = kring->nr_hwavail; - - j = kring->nr_hwcur; /* netmap ring index */ - if (j != k) { /* we have new packets to send */ - u32 olinfo_status = 0; + /* check for new packets to send. + * j indexes the netmap ring, l indexes the nic ring, and + * j = kring->nr_hwcur, l = E1000_TDT (not tracked), + * j == (l + kring->nkr_hwofs) % ring_size + */ + j = kring->nr_hwcur; + if (j != k) { /* we have packets to send */ + /* 82575 needs the queue index added */ + u32 olinfo_status = + (adapter->hw.mac.type == e1000_82575) ? (txr->me << 4) : 0; - l = j - kring->nkr_hwofs; /* NIC ring index */ + l = j - kring->nkr_hwofs; if (l < 0) l += lim + 1; - /* 82575 needs the queue index added */ - if (adapter->hw.mac.type == e1000_82575) - olinfo_status |= txr->me << 4; - while (j != k) { struct netmap_slot *slot = &ring->slot[j]; - struct igb_tx_buffer *txbuf = &txr->tx_buffers[l]; union e1000_adv_tx_desc *curr = (union e1000_adv_tx_desc *)&txr->tx_base[l]; - uint64_t paddr; - void *addr = PNMB(slot, &paddr); + struct igb_tx_buffer *txbuf = &txr->tx_buffers[l]; int flags = ((slot->flags & NS_REPORT) || j == 0 || j == report_frequency) ? E1000_ADVTXD_DCMD_RS : 0; + uint64_t paddr; + void *addr = PNMB(slot, &paddr); int len = slot->len; if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { @@ -194,7 +191,7 @@ igb_netmap_txsync(struct ifnet *ifp, u_i } slot->flags &= ~NS_REPORT; - // XXX do we need to set the address ? + // XXX set the address unconditionally curr->read.buffer_addr = htole64(paddr); curr->read.olinfo_status = htole32(olinfo_status | @@ -220,7 +217,6 @@ igb_netmap_txsync(struct ifnet *ifp, u_i /* decrease avail by number of sent packets */ kring->nr_hwavail -= n; - ring->avail = kring->nr_hwavail; /* Set the watchdog XXX ? */ txr->queue_status = IGB_QUEUE_WORKING; @@ -231,23 +227,28 @@ igb_netmap_txsync(struct ifnet *ifp, u_i E1000_WRITE_REG(&adapter->hw, E1000_TDT(txr->me), l); } + if (n == 0 || kring->nr_hwavail < 1) { int delta; - /* record completed transmission using TDH */ + /* record completed transmissions using TDH */ l = E1000_READ_REG(&adapter->hw, E1000_TDH(ring_nr)); - if (l >= kring->nkr_num_slots) /* XXX can it happen ? */ + if (l >= kring->nkr_num_slots) { /* XXX can it happen ? */ + D("TDH wrap %d", l); l -= kring->nkr_num_slots; + } delta = l - txr->next_to_clean; if (delta) { - /* new tx were completed */ + /* some completed, increment hwavail. */ if (delta < 0) delta += kring->nkr_num_slots; txr->next_to_clean = l; kring->nr_hwavail += delta; - ring->avail = kring->nr_hwavail; } } + /* update avail to what the hardware knows */ + ring->avail = kring->nr_hwavail; + if (do_lock) IGB_TX_UNLOCK(txr); return 0; @@ -274,10 +275,17 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i if (do_lock) IGB_RX_LOCK(rxr); - /* Sync the ring. */ + /* XXX check sync modes */ bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + /* import newly received packets into the netmap ring. + * j is an index in the netmap ring, l in the NIC ring, and + * j = (kring->nr_hwcur + kring->nr_hwavail) % ring_size + * l = rxr->next_to_check; + * and + * j == (l + kring->nkr_hwofs) % ring_size + */ l = rxr->next_to_check; j = l + kring->nkr_hwofs; if (j > lim) @@ -289,7 +297,6 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i if ((staterr & E1000_RXD_STAT_DD) == 0) break; ring->slot[j].len = le16toh(curr->wb.upper.length); - bus_dmamap_sync(rxr->ptag, rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); j = (j == lim) ? 0 : j + 1; @@ -300,18 +307,13 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i kring->nr_hwavail += n; } - /* skip past packets that userspace has already processed, - * making them available for reception. - * advance nr_hwcur and issue a bus_dmamap_sync on the - * buffers so it is safe to write to them. - * Also increase nr_hwavail - */ + /* skip past packets that userspace has already processed */ j = kring->nr_hwcur; - l = kring->nr_hwcur - kring->nkr_hwofs; - if (l < 0) - l += lim + 1; - if (j != k) { /* userspace has read some packets. */ + if (j != k) { /* userspace has read some packets. */ n = 0; + l = j - kring->nkr_hwofs; + if (l < 0) + l += lim + 1; while (j != k) { struct netmap_slot *slot = ring->slot + j; union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; @@ -340,10 +342,11 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i n++; } kring->nr_hwavail -= n; - kring->nr_hwcur = ring->cur; + kring->nr_hwcur = k; bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - /* IMPORTANT: we must leave one free slot in the ring, + /* + * IMPORTANT: we must leave one free slot in the ring, * so move l back by one unit */ l = (l == 0) ? lim : l - 1; @@ -355,3 +358,4 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i IGB_RX_UNLOCK(rxr); return 0; } +/* end of file */ Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Wed Feb 15 18:34:57 2012 (r231777) +++ head/sys/dev/netmap/if_lem_netmap.h Wed Feb 15 18:59:26 2012 (r231778) @@ -96,7 +96,7 @@ lem_netmap_lock_wrapper(struct ifnet *if /* - * Register/unregister routine + * register-unregister routine */ static int lem_netmap_reg(struct ifnet *ifp, int onoff) @@ -106,14 +106,13 @@ lem_netmap_reg(struct ifnet *ifp, int on int error = 0; if (na == NULL) - return EINVAL; + return EINVAL; /* no netmap support here */ lem_disable_intr(adapter); /* Tell the stack that the interface is no longer active */ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); - /* lem_netmap_block_tasks(adapter); */ #ifndef EM_LEGACY_IRQ // XXX do we need this ? taskqueue_block(adapter->tq); taskqueue_drain(adapter->tq, &adapter->rxtx_task); @@ -122,9 +121,6 @@ lem_netmap_reg(struct ifnet *ifp, int on if (onoff) { ifp->if_capenable |= IFCAP_NETMAP; - /* save if_transmit to restore it when exiting. - * XXX what about if_start and if_qflush ? - */ na->if_transmit = ifp->if_transmit; ifp->if_transmit = netmap_start; @@ -135,10 +131,10 @@ lem_netmap_reg(struct ifnet *ifp, int on } } else { fail: - /* restore non-netmap mode */ + /* return to non-netmap mode */ ifp->if_transmit = na->if_transmit; ifp->if_capenable &= ~IFCAP_NETMAP; - lem_init_locked(adapter); /* also enables intr */ + lem_init_locked(adapter); /* also enable intr */ } #ifndef EM_LEGACY_IRQ @@ -150,7 +146,7 @@ fail: /* - * Reconcile kernel and user view of the transmit ring. + * Reconcile hardware and user view of the transmit ring. */ static int lem_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock) @@ -173,23 +169,25 @@ lem_netmap_txsync(struct ifnet *ifp, u_i bus_dmamap_sync(adapter->txdma.dma_tag, adapter->txdma.dma_map, BUS_DMASYNC_POSTREAD); - /* update avail to what the hardware knows */ - ring->avail = kring->nr_hwavail; - - j = kring->nr_hwcur; /* points into the netmap ring */ - if (j != k) { /* we have new packets to send */ - l = j - kring->nkr_hwofs; /* points into the NIC ring */ + /* check for new packets to send. + * j indexes the netmap ring, l indexes the nic ring, and + * j = kring->nr_hwcur, l = E1000_TDT (not tracked), + * j == (l + kring->nkr_hwofs) % ring_size + */ + j = kring->nr_hwcur; + if (j != k) { /* we have packets to send */ + l = j - kring->nkr_hwofs; if (l < 0) l += lim + 1; while (j != k) { struct netmap_slot *slot = &ring->slot[j]; struct e1000_tx_desc *curr = &adapter->tx_desc_base[l]; struct em_buffer *txbuf = &adapter->tx_buffer_area[l]; - uint64_t paddr; - void *addr = PNMB(slot, &paddr); int flags = ((slot->flags & NS_REPORT) || j == 0 || j == report_frequency) ? E1000_TXD_CMD_RS : 0; + uint64_t paddr; + void *addr = PNMB(slot, &paddr); int len = slot->len; if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { @@ -220,7 +218,6 @@ lem_netmap_txsync(struct ifnet *ifp, u_i /* decrease avail by number of sent packets */ kring->nr_hwavail -= n; - ring->avail = kring->nr_hwavail; bus_dmamap_sync(adapter->txdma.dma_tag, adapter->txdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -233,19 +230,21 @@ lem_netmap_txsync(struct ifnet *ifp, u_i /* record completed transmissions using TDH */ l = E1000_READ_REG(&adapter->hw, E1000_TDH(0)); - if (l >= kring->nkr_num_slots) { /* can it happen ? */ + if (l >= kring->nkr_num_slots) { /* XXX can it happen ? */ D("bad TDH %d", l); l -= kring->nkr_num_slots; } delta = l - adapter->next_tx_to_clean; if (delta) { + /* some completed, increment hwavail. */ if (delta < 0) delta += kring->nkr_num_slots; adapter->next_tx_to_clean = l; kring->nr_hwavail += delta; - ring->avail = kring->nr_hwavail; } } + /* update avail to what the hardware knows */ + ring->avail = kring->nr_hwavail; if (do_lock) EM_TX_UNLOCK(adapter); @@ -271,13 +270,20 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i if (do_lock) EM_RX_LOCK(adapter); + /* XXX check sync modes */ bus_dmamap_sync(adapter->rxdma.dma_tag, adapter->rxdma.dma_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - /* import newly received packets into the netmap ring */ - l = adapter->next_rx_desc_to_check; /* points into the NIC ring */ - j = l + kring->nkr_hwofs; /* points into the netmap ring */ + /* import newly received packets into the netmap ring + * j is an index in the netmap ring, l in the NIC ring, and + * j = (kring->nr_hwcur + kring->nr_hwavail) % ring_size + * l = rxr->next_to_check; + * and + * j == (l + kring->nkr_hwofs) % ring_size + */ + l = adapter->next_rx_desc_to_check; + j = l + kring->nkr_hwofs; if (j > lim) j -= lim + 1; for (n = 0; ; n++) { @@ -322,6 +328,7 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i EM_RX_UNLOCK(adapter); return netmap_ring_reinit(kring); } + curr->status = 0; if (slot->flags & NS_BUF_CHANGED) { curr->buffer_addr = htole64(paddr); @@ -348,10 +355,8 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i l = (l == 0) ? lim : l - 1; E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), l); } - /* tell userspace that there are new packets */ ring->avail = kring->nr_hwavail ; - if (do_lock) EM_RX_UNLOCK(adapter); return 0; From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 21:20:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EDE6106566B; Wed, 15 Feb 2012 21:20:58 +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 6E0238FC13; Wed, 15 Feb 2012 21:20:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FLKwsh081904; Wed, 15 Feb 2012 21:20:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FLKww4081902; Wed, 15 Feb 2012 21:20:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201202152120.q1FLKww4081902@svn.freebsd.org> From: Warner Losh Date: Wed, 15 Feb 2012 21:20: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: r231780 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 21:20:58 -0000 Author: imp Date: Wed Feb 15 21:20:58 2012 New Revision: 231780 URL: http://svn.freebsd.org/changeset/base/231780 Log: Wordsmith the can't find kernel error message, and suggest which variable to set to override. Modified: head/share/mk/bsd.kmod.mk Modified: head/share/mk/bsd.kmod.mk ============================================================================== --- head/share/mk/bsd.kmod.mk Wed Feb 15 21:03:26 2012 (r231779) +++ head/share/mk/bsd.kmod.mk Wed Feb 15 21:20:58 2012 (r231780) @@ -9,7 +9,7 @@ SYSDIR= ${_dir} .endfor .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \ !exists(${SYSDIR}/conf/kmod.mk) -.error "can't find kernel source tree" +.error "can't locate the kernel source tree, set SYSDIR to override." .endif .include "${SYSDIR}/conf/kmod.mk" From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 21:32:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46BEF106564A; Wed, 15 Feb 2012 21:32:06 +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 358038FC08; Wed, 15 Feb 2012 21:32:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FLW6CP082680; Wed, 15 Feb 2012 21:32:06 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FLW6kd082678; Wed, 15 Feb 2012 21:32:06 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202152132.q1FLW6kd082678@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 15 Feb 2012 21:32: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: r231781 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 21:32:06 -0000 Author: jkim Date: Wed Feb 15 21:32:05 2012 New Revision: 231781 URL: http://svn.freebsd.org/changeset/base/231781 Log: Some BIOSes are known for corrupting low 64KB between suspend and resume. Mask off the first 16 pages unless we appear to be running in a VM. This address may be overridden by 'hw.physmem.start' tunable from loader. Note Linux used to have a BIOS quirk table for this issue but it seems they made it default recently. Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed Feb 15 21:20:58 2012 (r231780) +++ head/sys/amd64/amd64/machdep.c Wed Feb 15 21:32:05 2012 (r231781) @@ -1381,7 +1381,7 @@ getmemsize(caddr_t kmdp, u_int64_t first { int i, physmap_idx, pa_indx, da_indx; vm_paddr_t pa, physmap[PHYSMAP_SIZE]; - u_long physmem_tunable, memtest; + u_long physmem_start, physmem_tunable, memtest; pt_entry_t *pte; struct bios_smap *smapbase, *smap, *smapend; u_int32_t smapsize; @@ -1469,8 +1469,19 @@ getmemsize(caddr_t kmdp, u_int64_t first /* * Size up each available chunk of physical memory. + * + * XXX Some BIOSes corrupt low 64KB between suspend and resume. + * By default, mask off the first 16 pages unless we appear to be + * running in a VM. */ - physmap[0] = PAGE_SIZE; /* mask off page 0 */ + physmem_start = (vm_guest > VM_GUEST_NO ? 1 : 16) << PAGE_SHIFT; + TUNABLE_ULONG_FETCH("hw.physmem.start", &physmem_start); + if (physmem_start < PAGE_SIZE) + physmap[0] = PAGE_SIZE; + else if (physmem_start >= physmap[1]) + physmap[0] = round_page(physmap[1] - PAGE_SIZE); + else + physmap[0] = round_page(physmem_start); pa_indx = 0; da_indx = 1; phys_avail[pa_indx++] = physmap[0]; From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 22:10:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01B3C106566B; Wed, 15 Feb 2012 22:10:34 +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 E4AA18FC08; Wed, 15 Feb 2012 22:10:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FMAXF5084278; Wed, 15 Feb 2012 22:10:33 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FMAXq2084276; Wed, 15 Feb 2012 22:10:33 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202152210.q1FMAXq2084276@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 15 Feb 2012 22: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: r231787 - head/sys/amd64/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 22:10:34 -0000 Author: jkim Date: Wed Feb 15 22:10:33 2012 New Revision: 231787 URL: http://svn.freebsd.org/changeset/base/231787 Log: Make ACPI resume beeper less cryptic. Set PIC timer2 mode properly. Modified: head/sys/amd64/acpica/acpi_wakecode.S Modified: head/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- head/sys/amd64/acpica/acpi_wakecode.S Wed Feb 15 22:07:09 2012 (r231786) +++ head/sys/amd64/acpica/acpi_wakecode.S Wed Feb 15 22:10:33 2012 (r231787) @@ -30,7 +30,9 @@ */ #include +#include #include +#include #include "assym.s" @@ -71,13 +73,21 @@ wakeup_start: testb $~0, resume_beep - wakeup_start jz 1f movb $0, resume_beep - wakeup_start - movb $0xc0, %al - outb %al, $0x42 - movb $0x04, %al - outb %al, $0x42 - inb $0x61, %al - orb $0x3, %al - outb %al, $0x61 + + /* Set PIC timer2 to beep. */ + movb $(TIMER_SEL2 | TIMER_SQWAVE | TIMER_16BIT), %al + outb %al, $TIMER_MODE + + /* Turn on speaker. */ + inb $IO_PPI, %al + orb $PIT_SPKR, %al + outb %al, $IO_PPI + + /* Set frequency. */ + movw $0x4c0, %ax + outb %al, $TIMER_CNTR2 + shrw $8, %ax + outb %al, $TIMER_CNTR2 1: /* Re-initialize video BIOS if the reset_video tunable is set. */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 22:49:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B4811065672; Wed, 15 Feb 2012 22:49:26 +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 D37B68FC0A; Wed, 15 Feb 2012 22:49:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FMnPgU085867; Wed, 15 Feb 2012 22:49:25 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FMnP2r085865; Wed, 15 Feb 2012 22:49:25 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202152249.q1FMnP2r085865@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 15 Feb 2012 22:49: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: r231791 - head/sys/amd64/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 22:49:26 -0000 Author: jkim Date: Wed Feb 15 22:49:25 2012 New Revision: 231791 URL: http://svn.freebsd.org/changeset/base/231791 Log: Set up an event handler to turn off speaker if user requested it. Speaker will stop beeping after all device drivers are resumed. Use proper API to "acquire" and "release" PIC timer2 for consistency and correctness. Modified: head/sys/amd64/acpica/acpi_wakeup.c Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Wed Feb 15 22:45:57 2012 (r231790) +++ head/sys/amd64/acpica/acpi_wakeup.c Wed Feb 15 22:49:25 2012 (r231791) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -40,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -92,11 +94,11 @@ static void acpi_wakeup_cpus(struct acp *addr = val; \ } while (0) -/* Turn off bits 1&2 of the PIT, stopping the beep. */ static void acpi_stop_beep(void *arg) { - outb(0x61, inb(0x61) & ~0x3); + + timer_spkr_release(); } #ifdef SMP @@ -217,6 +219,7 @@ acpi_wakeup_cpus(struct acpi_softc *sc, int acpi_sleep_machdep(struct acpi_softc *sc, int state) { + static eventhandler_tag stop_beep = NULL; #ifdef SMP cpuset_t wakeup_cpus; #endif @@ -234,6 +237,22 @@ acpi_sleep_machdep(struct acpi_softc *sc CPU_CLR(PCPU_GET(cpuid), &wakeup_cpus); #endif + if (acpi_resume_beep == 0) { + if (stop_beep != NULL) { + EVENTHANDLER_DEREGISTER(power_resume, stop_beep); + stop_beep = NULL; + } + } else { + if (stop_beep == NULL) + stop_beep = EVENTHANDLER_REGISTER(power_resume, + acpi_stop_beep, NULL, EVENTHANDLER_PRI_LAST); + if (stop_beep == NULL) + device_printf(sc->acpi_dev, + "Failed to set up event handler\n"); + else + timer_spkr_acquire(); + } + AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); rf = intr_disable(); @@ -257,7 +276,7 @@ acpi_sleep_machdep(struct acpi_softc *sc } #endif - WAKECODE_FIXUP(resume_beep, uint8_t, (acpi_resume_beep != 0)); + WAKECODE_FIXUP(resume_beep, uint8_t, (stop_beep != NULL)); WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[0]); @@ -311,10 +330,6 @@ out: mem_range_softc.mr_op->reinit != NULL) mem_range_softc.mr_op->reinit(&mem_range_softc); - /* If we beeped, turn it off after a delay. */ - if (acpi_resume_beep) - timeout(acpi_stop_beep, NULL, 3 * hz); - return (ret); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 23:13:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3ECE1065672; Wed, 15 Feb 2012 23:13:29 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 913BC8FC18; Wed, 15 Feb 2012 23:13:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FNDTqW086942; Wed, 15 Feb 2012 23:13:29 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FNDT7G086931; Wed, 15 Feb 2012 23:13:29 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201202152313.q1FNDT7G086931@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 15 Feb 2012 23:13: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: r231796 - in head/sys/dev: e1000 ixgbe netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 23:13:29 -0000 Author: luigi Date: Wed Feb 15 23:13:29 2012 New Revision: 231796 URL: http://svn.freebsd.org/changeset/base/231796 Log: (This commit only touches code within the DEV_NETMAP blocks) Introduce some functions to map NIC ring indexes into netmap ring indexes and vice versa. This way we can implement the bound checks only in one place (and hopefully in a correct way). On passing, make the code and comments more uniform across the various drivers. Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Wed Feb 15 23:03:30 2012 (r231795) +++ head/sys/dev/e1000/if_em.c Wed Feb 15 23:13:29 2012 (r231796) @@ -3296,12 +3296,10 @@ em_setup_transmit_ring(struct tx_ring *t } #ifdef DEV_NETMAP if (slot) { - int si = i + na->tx_rings[txr->me].nkr_hwofs; + int si = netmap_tidx_n2k(na, txr->me, i); uint64_t paddr; void *addr; - if (si >= na->num_tx_desc) - si -= na->num_tx_desc; addr = PNMB(slot + si, &paddr); txr->tx_base[i].buffer_addr = htole64(paddr); /* reload the map for netmap mode */ @@ -4053,13 +4051,10 @@ em_setup_receive_ring(struct rx_ring *rx rxbuf = &rxr->rx_buffers[j]; #ifdef DEV_NETMAP if (slot) { - /* slot si is mapped to the j-th NIC-ring entry */ - int si = j + na->rx_rings[0].nkr_hwofs; + int si = netmap_ridx_n2k(na, rxr->me, j); uint64_t paddr; void *addr; - if (si > na->num_rx_desc) - si -= na->num_rx_desc; addr = PNMB(slot + si, &paddr); netmap_load_map(rxr->rxtag, rxbuf->map, addr); /* Update descriptor */ Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Wed Feb 15 23:03:30 2012 (r231795) +++ head/sys/dev/e1000/if_igb.c Wed Feb 15 23:13:29 2012 (r231796) @@ -3315,11 +3315,8 @@ igb_setup_transmit_ring(struct tx_ring * } #ifdef DEV_NETMAP if (slot) { - /* slot si is mapped to the i-th NIC-ring entry */ - int si = i + na->tx_rings[txr->me].nkr_hwofs; - - if (si < 0) - si += na->num_tx_desc; + int si = netmap_tidx_n2k(na, txr->me, i); + /* no need to set the address */ netmap_load_map(txr->txtag, txbuf->map, NMB(slot + si)); } #endif /* DEV_NETMAP */ @@ -4060,12 +4057,10 @@ igb_setup_receive_ring(struct rx_ring *r #ifdef DEV_NETMAP if (slot) { /* slot sj is mapped to the i-th NIC-ring entry */ - int sj = j + na->rx_rings[rxr->me].nkr_hwofs; + int sj = netmap_ridx_n2k(na, rxr->me, j); uint64_t paddr; void *addr; - if (sj < 0) - sj += na->num_rx_desc; addr = PNMB(slot + sj, &paddr); netmap_load_map(rxr->ptag, rxbuf->pmap, addr); /* Update descriptor */ Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Wed Feb 15 23:03:30 2012 (r231795) +++ head/sys/dev/e1000/if_lem.c Wed Feb 15 23:13:29 2012 (r231796) @@ -2668,13 +2668,11 @@ lem_setup_transmit_structures(struct ada tx_buffer->m_head = NULL; #ifdef DEV_NETMAP if (slot) { - /* slot si is mapped to the i-th NIC-ring entry */ - int si = i + na->tx_rings[0].nkr_hwofs; + /* the i-th NIC entry goes to slot si */ + int si = netmap_tidx_n2k(na, 0, i); uint64_t paddr; void *addr; - if (si > na->num_tx_desc) - si -= na->num_tx_desc; addr = PNMB(slot + si, &paddr); adapter->tx_desc_base[si].buffer_addr = htole64(paddr); /* reload the map for netmap mode */ @@ -3244,13 +3242,11 @@ lem_setup_receive_structures(struct adap for (i = 0; i < adapter->num_rx_desc; i++) { #ifdef DEV_NETMAP if (slot) { - /* slot si is mapped to the i-th NIC-ring entry */ - int si = i + na->rx_rings[0].nkr_hwofs; + /* the i-th NIC entry goes to slot si */ + int si = netmap_ridx_n2k(na, 0, i); uint64_t paddr; void *addr; - if (si > na->num_rx_desc) - si -= na->num_rx_desc; addr = PNMB(slot + si, &paddr); netmap_load_map(adapter->rxtag, rx_buffer->map, addr); /* Update descriptor */ Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Wed Feb 15 23:03:30 2012 (r231795) +++ head/sys/dev/ixgbe/ixgbe.c Wed Feb 15 23:13:29 2012 (r231796) @@ -2969,14 +2969,11 @@ ixgbe_setup_transmit_ring(struct tx_ring * Slots in the netmap ring (indexed by "si") are * kring->nkr_hwofs positions "ahead" wrt the * corresponding slot in the NIC ring. In some drivers - * (not here) nkr_hwofs can be negative. When computing - * si = i + kring->nkr_hwofs make sure to handle wraparounds. + * (not here) nkr_hwofs can be negative. Function + * netmap_tidx_n2k() handles wraparounds properly. */ if (slot) { - int si = i + na->tx_rings[txr->me].nkr_hwofs; - - if (si >= na->num_tx_desc) - si -= na->num_tx_desc; + int si = netmap_tidx_n2k(na, txr->me, i); netmap_load_map(txr->txtag, txbuf->map, NMB(slot + si)); } #endif /* DEV_NETMAP */ @@ -3925,12 +3922,10 @@ ixgbe_setup_receive_ring(struct rx_ring * an mbuf, so end the block with a continue; */ if (slot) { - int sj = j + na->rx_rings[rxr->me].nkr_hwofs; + int sj = netmap_ridx_n2k(na, rxr->me, j); uint64_t paddr; void *addr; - if (sj >= na->num_rx_desc) - sj -= na->num_rx_desc; addr = PNMB(slot + sj, &paddr); netmap_load_map(rxr->ptag, rxbuf->pmap, addr); /* Update descriptor */ Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Wed Feb 15 23:03:30 2012 (r231795) +++ head/sys/dev/netmap/if_em_netmap.h Wed Feb 15 23:13:29 2012 (r231796) @@ -27,7 +27,7 @@ * $FreeBSD$ * $Id: if_em_netmap.h 9802 2011-12-02 18:42:37Z luigi $ * - * netmap support for if_em. + * netmap support for if_em.c * * For structure and details on the individual functions please see * ixgbe_netmap.h @@ -66,9 +66,6 @@ em_netmap_attach(struct adapter *adapter } -/* - * wrapper to export locks to the generic code - */ static void em_netmap_lock_wrapper(struct ifnet *ifp, int what, u_int queueid) { @@ -214,9 +211,7 @@ em_netmap_txsync(struct ifnet *ifp, u_in */ j = kring->nr_hwcur; if (j != k) { /* we have packets to send */ - l = j - kring->nkr_hwofs; - if (l < 0) - l += lim + 1; + l = netmap_tidx_k2n(na, ring_nr, j); while (j != k) { struct netmap_slot *slot = &ring->slot[j]; struct e1000_tx_desc *curr = &txr->tx_base[l]; @@ -322,12 +317,7 @@ em_netmap_rxsync(struct ifnet *ifp, u_in * j == (l + kring->nkr_hwofs) % ring_size */ l = rxr->next_to_check; - j = l + kring->nkr_hwofs; - /* XXX here nkr_hwofs can be negative so must check for j < 0 */ - if (j < 0) - j += lim + 1; - else if (j > lim) - j -= lim + 1; + j = netmap_ridx_n2k(na, ring_nr, l); for (n = 0; ; n++) { struct e1000_rx_desc *curr = &rxr->rx_base[l]; @@ -347,15 +337,10 @@ em_netmap_rxsync(struct ifnet *ifp, u_in } /* skip past packets that userspace has already processed */ - j = kring->nr_hwcur; + j = kring->nr_hwcur; /* netmap ring index */ if (j != k) { /* userspace has read some packets. */ n = 0; - l = j - kring->nkr_hwofs; /* NIC ring index */ - /* here nkr_hwofs can be negative so check for l > lim */ - if (l < 0) - l += lim + 1; - else if (l > lim) - l -= lim + 1; + l = netmap_ridx_k2n(na, ring_nr, j); /* NIC ring index */ while (j != k) { struct netmap_slot *slot = &ring->slot[j]; struct e1000_rx_desc *curr = &rxr->rx_base[l]; Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Wed Feb 15 23:03:30 2012 (r231795) +++ head/sys/dev/netmap/if_igb_netmap.h Wed Feb 15 23:13:29 2012 (r231796) @@ -169,9 +169,7 @@ igb_netmap_txsync(struct ifnet *ifp, u_i u32 olinfo_status = (adapter->hw.mac.type == e1000_82575) ? (txr->me << 4) : 0; - l = j - kring->nkr_hwofs; - if (l < 0) - l += lim + 1; + l = netmap_tidx_k2n(na, ring_nr, j); while (j != k) { struct netmap_slot *slot = &ring->slot[j]; union e1000_adv_tx_desc *curr = @@ -287,9 +285,7 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i * j == (l + kring->nkr_hwofs) % ring_size */ l = rxr->next_to_check; - j = l + kring->nkr_hwofs; - if (j > lim) - j -= lim + 1; + j = netmap_ridx_n2k(na, ring_nr, l); for (n = 0; ; n++) { union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; uint32_t staterr = le32toh(curr->wb.upper.status_error); @@ -311,9 +307,7 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i j = kring->nr_hwcur; if (j != k) { /* userspace has read some packets. */ n = 0; - l = j - kring->nkr_hwofs; - if (l < 0) - l += lim + 1; + l = netmap_ridx_k2n(na, ring_nr, j); while (j != k) { struct netmap_slot *slot = ring->slot + j; union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Wed Feb 15 23:03:30 2012 (r231795) +++ head/sys/dev/netmap/if_lem_netmap.h Wed Feb 15 23:13:29 2012 (r231796) @@ -45,8 +45,6 @@ static int lem_netmap_rxsync(struct ifne static void lem_netmap_lock_wrapper(struct ifnet *, int, u_int); -SYSCTL_NODE(_dev, OID_AUTO, lem, CTLFLAG_RW, 0, "lem card"); - static void lem_netmap_attach(struct adapter *adapter) { @@ -153,7 +151,7 @@ lem_netmap_txsync(struct ifnet *ifp, u_i { struct adapter *adapter = ifp->if_softc; struct netmap_adapter *na = NA(adapter->ifp); - struct netmap_kring *kring = &na->tx_rings[0]; + struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; @@ -176,9 +174,7 @@ lem_netmap_txsync(struct ifnet *ifp, u_i */ j = kring->nr_hwcur; if (j != k) { /* we have packets to send */ - l = j - kring->nkr_hwofs; - if (l < 0) - l += lim + 1; + l = netmap_tidx_k2n(na, ring_nr, j); while (j != k) { struct netmap_slot *slot = &ring->slot[j]; struct e1000_tx_desc *curr = &adapter->tx_desc_base[l]; @@ -260,7 +256,7 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i { struct adapter *adapter = ifp->if_softc; struct netmap_adapter *na = NA(adapter->ifp); - struct netmap_kring *kring = &na->rx_rings[0]; + struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; int j, k, l, n, lim = kring->nkr_num_slots - 1; @@ -283,9 +279,7 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i * j == (l + kring->nkr_hwofs) % ring_size */ l = adapter->next_rx_desc_to_check; - j = l + kring->nkr_hwofs; - if (j > lim) - j -= lim + 1; + j = netmap_ridx_n2k(na, ring_nr, l); for (n = 0; ; n++) { struct e1000_rx_desc *curr = &adapter->rx_desc_base[l]; int len; @@ -310,12 +304,10 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i } /* skip past packets that userspace has already processed */ - j = kring->nr_hwcur; /* netmap ring index */ + j = kring->nr_hwcur; /* netmap ring index */ if (j != k) { /* userspace has read some packets. */ n = 0; - l = j - kring->nkr_hwofs; /* NIC ring index */ - if (l < 0) - l += lim + 1; + l = netmap_ridx_k2n(na, ring_nr, j); /* NIC ring index */ while (j != k) { struct netmap_slot *slot = &ring->slot[j]; struct e1000_rx_desc *curr = &adapter->rx_desc_base[l]; @@ -332,7 +324,7 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i curr->status = 0; if (slot->flags & NS_BUF_CHANGED) { curr->buffer_addr = htole64(paddr); - /* buffer has changed, and reload map */ + /* buffer has changed, reload map */ netmap_reload_map(adapter->rxtag, rxbuf->map, addr); slot->flags &= ~NS_BUF_CHANGED; } Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Wed Feb 15 23:03:30 2012 (r231795) +++ head/sys/dev/netmap/if_re_netmap.h Wed Feb 15 23:13:29 2012 (r231796) @@ -263,7 +263,7 @@ re_netmap_rxsync(struct ifnet *ifp, u_in * is to limit the amount of data reported up to 'lim' */ l = sc->rl_ldata.rl_rx_prodidx; /* next pkt to check */ - j = l + kring->nkr_hwofs; + j = netmap_ridx_n2k(na, ring_nr, l); /* the kring index */ for (n = kring->nr_hwavail; n < lim ; n++) { struct rl_desc *cur_rx = &sc->rl_ldata.rl_rx_list[l]; uint32_t rxstat = le32toh(cur_rx->rl_cmdstat); @@ -296,9 +296,7 @@ re_netmap_rxsync(struct ifnet *ifp, u_in j = kring->nr_hwcur; if (j != k) { /* userspace has read some packets. */ n = 0; - l = kring->nr_hwcur - kring->nkr_hwofs; - if (l < 0) - l += lim + 1; + l = netmap_ridx_k2n(na, ring_nr, j); /* the NIC index */ while (j != k) { struct netmap_slot *slot = ring->slot + j; struct rl_desc *desc = &sc->rl_ldata.rl_rx_list[l]; @@ -370,11 +368,7 @@ re_netmap_tx_init(struct rl_softc *sc) for (i = 0; i < n; i++) { void *addr; uint64_t paddr; - struct netmap_kring *kring = &na->tx_rings[0]; - int l = i + kring->nkr_hwofs; - - if (l >= n) - l -= n; + int l = netmap_tidx_n2k(na, 0, i); addr = PNMB(slot + l, &paddr); desc[i].rl_bufaddr_lo = htole32(RL_ADDR_LO(paddr)); @@ -391,19 +385,21 @@ re_netmap_rx_init(struct rl_softc *sc) struct netmap_slot *slot = netmap_reset(na, NR_RX, 0, 0); struct rl_desc *desc = sc->rl_ldata.rl_rx_list; uint32_t cmdstat; - int i, n; + int i, n, max_avail; if (!slot) return; n = sc->rl_ldata.rl_rx_desc_cnt; + /* + * Userspace owned hwavail packets before the reset, + * so the NIC that last hwavail descriptors of the ring + * are still owned by the driver (and keep one empty). + */ + max_avail = n - 1 - na->rx_rings[0].nr_hwavail; for (i = 0; i < n; i++) { void *addr; uint64_t paddr; - struct netmap_kring *kring = &na->rx_rings[0]; - int l = i + kring->nkr_hwofs; - - if (l >= n) - l -= n; + int l = netmap_ridx_n2k(na, 0, i); addr = PNMB(slot + l, &paddr); @@ -414,14 +410,9 @@ re_netmap_rx_init(struct rl_softc *sc) desc[i].rl_bufaddr_lo = htole32(RL_ADDR_LO(paddr)); desc[i].rl_bufaddr_hi = htole32(RL_ADDR_HI(paddr)); cmdstat = na->buff_size; - if (i == n - 1) + if (i == n - 1) /* mark the end of ring */ cmdstat |= RL_RDESC_CMD_EOR; - /* - * userspace knows that hwavail packets were ready before the - * reset, so we need to tell the NIC that last hwavail - * descriptors of the ring are still owned by the driver. - */ - if (i < n - 1 - kring->nr_hwavail) // XXX + 1 ? + if (i < max_avail) cmdstat |= RL_RDESC_CMD_OWN; desc[i].rl_cmdstat = htole32(cmdstat); } Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Wed Feb 15 23:03:30 2012 (r231795) +++ head/sys/dev/netmap/ixgbe_netmap.h Wed Feb 15 23:13:29 2012 (r231796) @@ -210,6 +210,7 @@ ixgbe_netmap_txsync(struct ifnet *ifp, u IXGBE_TX_LOCK(txr); /* take a copy of ring->cur now, and never read it again */ k = ring->cur; + /* do a sanity check on cur - hwcur XXX verify */ l = k - kring->nr_hwcur; if (l < 0) l += lim + 1; @@ -240,9 +241,7 @@ ixgbe_netmap_txsync(struct ifnet *ifp, u */ j = kring->nr_hwcur; if (j != k) { /* we have new packets to send */ - l = j - kring->nkr_hwofs; - if (l < 0) /* wraparound */ - l += lim + 1; + l = netmap_tidx_k2n(na, ring_nr, j); /* NIC index */ while (j != k) { /* @@ -459,9 +458,7 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u * rxr->next_to_check is set to 0 on a ring reinit */ l = rxr->next_to_check; - j = rxr->next_to_check + kring->nkr_hwofs; - if (j > lim) - j -= lim + 1; + j = netmap_ridx_n2k(na, ring_nr, l); if (netmap_no_pendintr || force_update) { for (n = 0; ; n++) { @@ -493,9 +490,7 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u j = kring->nr_hwcur; if (j != k) { /* userspace has read some packets. */ n = 0; - l = kring->nr_hwcur - kring->nkr_hwofs; - if (l < 0) - l += lim + 1; + l = netmap_ridx_k2n(na, ring_nr, j); while (j != k) { /* collect per-slot info, with similar validations * and flag handling as in the txsync code. Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Wed Feb 15 23:03:30 2012 (r231795) +++ head/sys/dev/netmap/netmap_kern.h Wed Feb 15 23:13:29 2012 (r231796) @@ -250,6 +250,58 @@ netmap_reload_map(bus_dma_tag_t tag, bus } } +/* + * functions to map NIC to KRING indexes (n2k) and vice versa (k2n) + */ +static inline int +netmap_ridx_n2k(struct netmap_adapter *na, int ring, int nic_idx) +{ + int kring_idx = nic_idx + na->rx_rings[ring].nkr_hwofs; + if (kring_idx < 0) + return kring_idx + na->num_rx_desc; + else if (kring_idx < na->num_rx_desc) + return kring_idx; + else + return kring_idx - na->num_rx_desc; +} + +static inline int +netmap_tidx_n2k(struct netmap_adapter *na, int ring, int nic_idx) +{ + int kring_idx = nic_idx + na->tx_rings[ring].nkr_hwofs; + if (kring_idx < 0) + return kring_idx + na->num_tx_desc; + else if (kring_idx < na->num_tx_desc) + return kring_idx; + else + return kring_idx - na->num_tx_desc; +} + + +static inline int +netmap_ridx_k2n(struct netmap_adapter *na, int ring, int kring_idx) +{ + int nic_idx = kring_idx - na->rx_rings[ring].nkr_hwofs; + if (nic_idx < 0) + return nic_idx + na->num_rx_desc; + else if (nic_idx < na->num_rx_desc) + return nic_idx; + else + return nic_idx - na->num_rx_desc; +} + + +static inline int +netmap_tidx_k2n(struct netmap_adapter *na, int ring, int kring_idx) +{ + int nic_idx = kring_idx - na->tx_rings[ring].nkr_hwofs; + if (nic_idx < 0) + return nic_idx + na->num_tx_desc; + else if (nic_idx < na->num_tx_desc) + return nic_idx; + else + return nic_idx - na->num_tx_desc; +} /* * NMB return the virtual address of a buffer (buffer 0 on bad index) From owner-svn-src-head@FreeBSD.ORG Wed Feb 15 23:33:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C71A1065673; Wed, 15 Feb 2012 23:33:22 +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 8065C8FC18; Wed, 15 Feb 2012 23:33:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1FNXMDv087696; Wed, 15 Feb 2012 23:33:22 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1FNXM5i087693; Wed, 15 Feb 2012 23:33:22 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202152333.q1FNXM5i087693@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 15 Feb 2012 23:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231797 - in head/sys/amd64: acpica amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 23:33:22 -0000 Author: jkim Date: Wed Feb 15 23:33:22 2012 New Revision: 231797 URL: http://svn.freebsd.org/changeset/base/231797 Log: Clean up RFLAG and CR3 register handling and nearby comments. For BSP, use spinlock_enter()/spinlock_exit() to save/restore RFLAGS. We know interrupt is disabled when returning from S3. For AP, we do not have to save/restore it because IRET will do it for us any way. Do not save CR3 locally because savectx() does it and BSP does not have to switch to kernel map for amd64. Change contigmalloc(9) flag while I am in the neighborhood. Modified: head/sys/amd64/acpica/acpi_wakeup.c head/sys/amd64/amd64/mp_machdep.c Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Wed Feb 15 23:13:29 2012 (r231796) +++ head/sys/amd64/acpica/acpi_wakeup.c Wed Feb 15 23:33:22 2012 (r231797) @@ -223,7 +223,6 @@ acpi_sleep_machdep(struct acpi_softc *sc #ifdef SMP cpuset_t wakeup_cpus; #endif - register_t cr3, rf; ACPI_STATUS status; int ret; @@ -255,17 +254,9 @@ acpi_sleep_machdep(struct acpi_softc *sc AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); - rf = intr_disable(); + spinlock_enter(); intr_suspend(); - /* - * Temporarily switch to the kernel pmap because it provides - * an identity mapping (setup at boot) for the low physical - * memory region containing the wakeup code. - */ - cr3 = rcr3(); - load_cr3(KPML4phys); - if (savectx(susppcbs[0])) { ctx_fpusave(suspfpusave[0]); #ifdef SMP @@ -304,6 +295,7 @@ acpi_sleep_machdep(struct acpi_softc *sc ia32_pause(); } else { pmap_init_pat(); + load_cr3(susppcbs[0]->pcb_cr3); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); #ifdef SMP @@ -319,10 +311,9 @@ out: restart_cpus(wakeup_cpus); #endif - load_cr3(cr3); mca_resume(); intr_resume(); - intr_restore(rf); + spinlock_exit(); AcpiSetFirmwareWakingVector(0); @@ -346,7 +337,7 @@ acpi_alloc_wakeup_handler(void) * and ROM area (0xa0000 and above). The temporary page tables must be * page-aligned. */ - wakeaddr = contigmalloc(4 * PAGE_SIZE, M_DEVBUF, M_NOWAIT, 0x500, + wakeaddr = contigmalloc(4 * PAGE_SIZE, M_DEVBUF, M_WAITOK, 0x500, 0xa0000, PAGE_SIZE, 0ul); if (wakeaddr == NULL) { printf("%s: can't alloc wake memory\n", __func__); Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Wed Feb 15 23:13:29 2012 (r231796) +++ head/sys/amd64/amd64/mp_machdep.c Wed Feb 15 23:33:22 2012 (r231797) @@ -1414,20 +1414,17 @@ cpustop_handler(void) void cpususpend_handler(void) { - register_t cr3, rf; u_int cpu; cpu = PCPU_GET(cpuid); - rf = intr_disable(); - cr3 = rcr3(); - if (savectx(susppcbs[cpu])) { ctx_fpusave(suspfpusave[cpu]); wbinvd(); CPU_SET_ATOMIC(cpu, &stopped_cpus); } else { pmap_init_pat(); + load_cr3(susppcbs[cpu]->pcb_cr3); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); } @@ -1439,11 +1436,9 @@ cpususpend_handler(void) CPU_CLR_ATOMIC(cpu, &started_cpus); CPU_CLR_ATOMIC(cpu, &stopped_cpus); - /* Restore CR3 and enable interrupts */ - load_cr3(cr3); + /* Resume MCA and local APIC */ mca_resume(); lapic_setup(0); - intr_restore(rf); } /* From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 02:19:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D716A106566B; Thu, 16 Feb 2012 02:19:53 +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 C5DF28FC08; Thu, 16 Feb 2012 02:19:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1G2JrC6093925; Thu, 16 Feb 2012 02:19:53 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1G2Jr5J093922; Thu, 16 Feb 2012 02:19:53 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201202160219.q1G2Jr5J093922@svn.freebsd.org> From: Rick Macklem Date: Thu, 16 Feb 2012 02:19: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: r231805 - in head/sys/fs: nfs nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 02:19:53 -0000 Author: rmacklem Date: Thu Feb 16 02:19:53 2012 New Revision: 231805 URL: http://svn.freebsd.org/changeset/base/231805 Log: Delete a couple of out of date comments that are no longer true in the new NFS client. Requested by: bde MFC after: 1 week Modified: head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Thu Feb 16 02:02:00 2012 (r231804) +++ head/sys/fs/nfs/nfs_commonport.c Thu Feb 16 02:19:53 2012 (r231805) @@ -109,9 +109,6 @@ MALLOC_DEFINE(M_NEWNFSDROLLBACK, "NFSD r * Definition of mutex locks. * newnfsd_mtx is used in nfsrvd_nfsd() to protect the nfs socket list * and assorted other nfsd structures. - * Giant is used to protect the nfsd list and count, which is just - * updated when nfsd's start/stop and is grabbed for nfsrvd_dorpc() - * for the VFS ops. */ struct mtx newnfsd_mtx; struct mtx nfs_sockl_mutex; Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Thu Feb 16 02:02:00 2012 (r231804) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Thu Feb 16 02:19:53 2012 (r231805) @@ -319,11 +319,7 @@ nfsvno_setattr(struct vnode *vp, struct } /* - * Set up nameidata for a lookup() call and do it - * For the cases where we are crossing mount points - * (looking up the public fh path or the v4 root path when - * not using a pseudo-root fs), set/release the Giant lock, - * as required. + * Set up nameidata for a lookup() call and do it. */ int nfsvno_namei(struct nfsrv_descript *nd, struct nameidata *ndp, From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 03:27:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A197A1065676; Thu, 16 Feb 2012 03:27:39 +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 759F88FC12; Thu, 16 Feb 2012 03:27:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1G3RdJD096449; Thu, 16 Feb 2012 03:27:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1G3Rdgn096446; Thu, 16 Feb 2012 03:27:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202160327.q1G3Rdgn096446@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 16 Feb 2012 03:27: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: r231810 - head/sys/boot/powerpc/boot1.chrp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 03:27:39 -0000 Author: nwhitehorn Date: Thu Feb 16 03:27:38 2012 New Revision: 231810 URL: http://svn.freebsd.org/changeset/base/231810 Log: Make sure to synchronize icache for the newly loaded loader. Not an issue on most systems, when the relevant icache lines are not full. MFC after: 2 weeks Modified: head/sys/boot/powerpc/boot1.chrp/Makefile head/sys/boot/powerpc/boot1.chrp/boot1.c Modified: head/sys/boot/powerpc/boot1.chrp/Makefile ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/Makefile Thu Feb 16 03:18:28 2012 (r231809) +++ head/sys/boot/powerpc/boot1.chrp/Makefile Thu Feb 16 03:27:38 2012 (r231810) @@ -8,16 +8,17 @@ BINDIR?= /boot INSTALLFLAGS= -b FILES= boot1.hfs -SRCS= boot1.c ashldi3.c +SRCS= boot1.c ashldi3.c syncicache.c NO_MAN= CFLAGS= -ffreestanding -msoft-float -Os \ - -I${.CURDIR}/../../common -I${.CURDIR}/../../../ + -I${.CURDIR}/../../common -I${.CURDIR}/../../../ \ + -D_STANDALONE LDFLAGS=-nostdlib -static -N .include "${.CURDIR}/../Makefile.inc" -.PATH: ${.CURDIR}/../../../libkern ${.CURDIR} +.PATH: ${.CURDIR}/../../../libkern ${.CURDIR}/../../../../lib/libc/powerpc/gen ${.CURDIR} # The following inserts out objects into a template HFS # created by generate-hfs.sh Modified: head/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/boot1.c Thu Feb 16 03:18:28 2012 (r231809) +++ head/sys/boot/powerpc/boot1.chrp/boot1.c Thu Feb 16 03:27:38 2012 (r231810) @@ -77,6 +77,8 @@ static int __sputc(char c, void *arg); static char *__uitoa(char *buf, u_int val, int base); static char *__ultoa(char *buf, u_long val, int base); +void __syncicache(void *, int); + /* * Open Firmware interface functions */ @@ -523,6 +525,7 @@ load(const char *fname) } if (ph.p_filesz != ph.p_memsz) bzero(p + ph.p_filesz, ph.p_memsz - ph.p_filesz); + __syncicache(p, ph.p_memsz); } ofw_close(bootdev); (*(void (*)(void *, int, ofwfp_t, char *, int))eh.e_entry)(NULL, 0, From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 05:06:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18DB2106572D; Thu, 16 Feb 2012 05:06:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07B738FC18; Thu, 16 Feb 2012 05:06:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1G567dH099574; Thu, 16 Feb 2012 05:06:07 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1G567bX099572; Thu, 16 Feb 2012 05:06:07 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202160506.q1G567bX099572@svn.freebsd.org> From: Eitan Adler Date: Thu, 16 Feb 2012 05:06: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: r231813 - head/lib/libc/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 05:06:08 -0000 Author: eadler Date: Thu Feb 16 05:06:07 2012 New Revision: 231813 URL: http://svn.freebsd.org/changeset/base/231813 Log: Add err(3) to strerror(3) SEE ALSO section PR: docs/164940 Submitted by: Niclas Zeising Approved by: cperciva MFC after: 3 days Modified: head/lib/libc/string/strerror.3 Modified: head/lib/libc/string/strerror.3 ============================================================================== --- head/lib/libc/string/strerror.3 Thu Feb 16 05:01:09 2012 (r231812) +++ head/lib/libc/string/strerror.3 Thu Feb 16 05:06:07 2012 (r231813) @@ -147,6 +147,7 @@ or should be used instead. .Sh SEE ALSO .Xr intro 2 , +.Xr err 3 , .Xr psignal 3 .Sh STANDARDS The From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 05:11:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D338106564A; Thu, 16 Feb 2012 05:11:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 877B28FC13; Thu, 16 Feb 2012 05:11:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1G5BZ7R099788; Thu, 16 Feb 2012 05:11:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1G5BZNk099785; Thu, 16 Feb 2012 05:11:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202160511.q1G5BZNk099785@svn.freebsd.org> From: Eitan Adler Date: Thu, 16 Feb 2012 05:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 05:11:35 -0000 Author: eadler Date: Thu Feb 16 05:11:35 2012 New Revision: 231814 URL: http://svn.freebsd.org/changeset/base/231814 Log: Add a timestamp to the msgbuf output in order to determine when when messages were printed. This can be enabled with the kern.msgbuf_show_timestamp sysctl PR: kern/161553 Reviewed by: avg Submitted by: Arnaud Lacombe Approved by: cperciva MFC after: 1 month Modified: head/sys/kern/subr_msgbuf.c head/sys/sys/msgbuf.h Modified: head/sys/kern/subr_msgbuf.c ============================================================================== --- head/sys/kern/subr_msgbuf.c Thu Feb 16 05:06:07 2012 (r231813) +++ head/sys/kern/subr_msgbuf.c Thu Feb 16 05:11:35 2012 (r231814) @@ -32,8 +32,10 @@ #include #include #include +#include #include #include +#include /* * Maximum number conversion buffer length: uintmax_t in base 2, plus <> @@ -47,6 +49,14 @@ static u_int msgbuf_cksum(struct msgbuf *mbp); /* + * + */ +static int msgbuf_show_timestamp = 0; +SYSCTL_INT(_kern, OID_AUTO, msgbuf_show_timestamp, CTLFLAG_RW | CTLFLAG_TUN, + &msgbuf_show_timestamp, 0, "Show timestamp in msgbuf"); +TUNABLE_INT("kern.msgbuf_show_timestamp", &msgbuf_show_timestamp); + +/* * Initialize a message buffer of the specified size at the specified * location. This also zeros the buffer area. */ @@ -60,7 +70,7 @@ msgbuf_init(struct msgbuf *mbp, void *pt msgbuf_clear(mbp); mbp->msg_magic = MSG_MAGIC; mbp->msg_lastpri = -1; - mbp->msg_needsnl = 0; + mbp->msg_flags = 0; bzero(&mbp->msg_lock, sizeof(mbp->msg_lock)); mtx_init(&mbp->msg_lock, "msgbuf", NULL, MTX_SPIN); } @@ -95,7 +105,7 @@ msgbuf_reinit(struct msgbuf *mbp, void * mbp->msg_lastpri = -1; /* Assume that the old message buffer didn't end in a newline. */ - mbp->msg_needsnl = 1; + mbp->msg_flags |= MSGBUF_NEEDNL; bzero(&mbp->msg_lock, sizeof(mbp->msg_lock)); mtx_init(&mbp->msg_lock, "msgbuf", NULL, MTX_SPIN); } @@ -134,7 +144,7 @@ msgbuf_getcount(struct msgbuf *mbp) * The caller should hold the message buffer spinlock. */ static inline void -msgbuf_do_addchar(struct msgbuf *mbp, u_int *seq, int c) +__msgbuf_do_addchar(struct msgbuf * const mbp, u_int * const seq, const int c) { u_int pos; @@ -149,6 +159,33 @@ msgbuf_do_addchar(struct msgbuf *mbp, u_ *seq = MSGBUF_SEQNORM(mbp, *seq + 1); } +static inline void +msgbuf_do_addchar(struct msgbuf * const mbp, u_int * const seq, const int c) +{ + + if (msgbuf_show_timestamp && + (mbp->msg_flags & MSGBUF_NEXT_NEW_LINE) != 0) { + char buf[32]; + char const *bufp; + struct timespec ts; + int err; + + getnanouptime(&ts); + err = snprintf(buf, sizeof (buf), "[%jd.%ld] ", + (intmax_t)ts.tv_sec, ts.tv_nsec / 1000); + + for (bufp = buf; *bufp != '\0'; bufp++) + __msgbuf_do_addchar(mbp, seq, *bufp); + + mbp->msg_flags &= ~MSGBUF_NEXT_NEW_LINE; + } + + __msgbuf_do_addchar(mbp, seq, c); + + if (c == '\n') + mbp->msg_flags |= MSGBUF_NEXT_NEW_LINE; +} + /* * Append a character to a message buffer. */ @@ -207,10 +244,10 @@ msgbuf_addstr(struct msgbuf *mbp, int pr * did not end with a newline. If that is the case, we need to * insert a newline before this string. */ - if (mbp->msg_lastpri != pri && mbp->msg_needsnl != 0) { + if (mbp->msg_lastpri != pri && (mbp->msg_flags & MSGBUF_NEEDNL) != 0) { msgbuf_do_addchar(mbp, &seq, '\n'); - mbp->msg_needsnl = 0; + mbp->msg_flags &= ~MSGBUF_NEEDNL; } for (i = 0; i < len; i++) { @@ -219,7 +256,7 @@ msgbuf_addstr(struct msgbuf *mbp, int pr * (and therefore prefix_len != 0), then we need a priority * prefix for this line. */ - if (mbp->msg_needsnl == 0 && prefix_len != 0) { + if ((mbp->msg_flags & MSGBUF_NEEDNL) == 0 && prefix_len != 0) { int j; for (j = 0; j < prefix_len; j++) @@ -242,9 +279,9 @@ msgbuf_addstr(struct msgbuf *mbp, int pr * we need to insert a new prefix or insert a newline later. */ if (str[i] == '\n') - mbp->msg_needsnl = 0; + mbp->msg_flags &= ~MSGBUF_NEEDNL; else - mbp->msg_needsnl = 1; + mbp->msg_flags |= MSGBUF_NEEDNL; msgbuf_do_addchar(mbp, &seq, str[i]); } Modified: head/sys/sys/msgbuf.h ============================================================================== --- head/sys/sys/msgbuf.h Thu Feb 16 05:06:07 2012 (r231813) +++ head/sys/sys/msgbuf.h Thu Feb 16 05:11:35 2012 (r231814) @@ -46,7 +46,9 @@ struct msgbuf { u_int msg_cksum; /* checksum of contents */ u_int msg_seqmod; /* range for sequence numbers */ int msg_lastpri; /* saved priority value */ - int msg_needsnl; /* set when newline needed */ + u_int msg_flags; +#define MSGBUF_NEEDNL 0x01 /* set when newline needed */ +#define MSGBUF_NEXT_NEW_LINE 0x02 struct mtx msg_lock; /* mutex to protect the buffer */ }; From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 05:16:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B20B106564A; Thu, 16 Feb 2012 05:16:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA1D78FC18; Thu, 16 Feb 2012 05:16:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1G5GtAY099976; Thu, 16 Feb 2012 05:16:55 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1G5Gt86099974; Thu, 16 Feb 2012 05:16:55 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202160516.q1G5Gt86099974@svn.freebsd.org> From: Eitan Adler Date: Thu, 16 Feb 2012 05: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: r231815 - head/usr.bin/elfdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 05:16:56 -0000 Author: eadler Date: Thu Feb 16 05:16:55 2012 New Revision: 231815 URL: http://svn.freebsd.org/changeset/base/231815 Log: Don't extract the n_type value from the elf header, since it is never used Fix warning when compiling with gcc46: variable 'type' set but not used Approved by: cperciva MFC after: 3 days Modified: head/usr.bin/elfdump/elfdump.c Modified: head/usr.bin/elfdump/elfdump.c ============================================================================== --- head/usr.bin/elfdump/elfdump.c Thu Feb 16 05:11:35 2012 (r231814) +++ head/usr.bin/elfdump/elfdump.c Thu Feb 16 05:16:55 2012 (r231815) @@ -904,7 +904,6 @@ elf_print_note(Elf32_Ehdr *e, void *sh) u_int64_t name; u_int32_t namesz; u_int32_t descsz; - u_int32_t type; u_int32_t desc; char *n, *s; @@ -916,7 +915,6 @@ elf_print_note(Elf32_Ehdr *e, void *sh) while (n < ((char *)e + offset + size)) { namesz = elf_get_word(e, n, N_NAMESZ); descsz = elf_get_word(e, n, N_DESCSZ); - type = elf_get_word(e, n, N_TYPE); s = n + sizeof(Elf_Note); desc = elf_get_word(e, n + sizeof(Elf_Note) + namesz, 0); fprintf(out, "\t%s %d\n", s, desc); From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 05:17:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2599F106578A; Thu, 16 Feb 2012 05:17:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A89F08FC1D; Thu, 16 Feb 2012 05:17:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1G5H1sN000120; Thu, 16 Feb 2012 05:17:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1G5H14i000118; Thu, 16 Feb 2012 05:17:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202160517.q1G5H14i000118@svn.freebsd.org> From: Eitan Adler Date: Thu, 16 Feb 2012 05:17: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: r231816 - head/usr.bin/gencat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 05:17:03 -0000 Author: eadler Date: Thu Feb 16 05:17:01 2012 New Revision: 231816 URL: http://svn.freebsd.org/changeset/base/231816 Log: Removed unused code: fixes compiler warning with CC=gcc46 error: parameter 'fd' set but not used Approved by: cperciva MFC after: 1 week Modified: head/usr.bin/gencat/gencat.c Modified: head/usr.bin/gencat/gencat.c ============================================================================== --- head/usr.bin/gencat/gencat.c Thu Feb 16 05:16:55 2012 (r231815) +++ head/usr.bin/gencat/gencat.c Thu Feb 16 05:17:01 2012 (r231816) @@ -462,89 +462,6 @@ MCParse(int fd) } } -void -MCReadCat(int fd) -{ - fd = 0; -#if 0 - MCHeaderT mcHead; - MCMsgT mcMsg; - MCSetT mcSet; - msgT *msg; - setT *set; - int i; - char *data; - - /* XXX init sethead? */ - - if (read(fd, &mcHead, sizeof(mcHead)) != sizeof(mcHead)) - CORRUPT(); - if (strncmp(mcHead.magic, MCMagic, MCMagicLen) != 0) - CORRUPT(); - if (mcHead.majorVer != MCMajorVer) - error("unrecognized catalog version"); - if ((mcHead.flags & MCGetByteOrder()) == 0) - error("wrong byte order"); - - if (lseek(fd, mcHead.firstSet, SEEK_SET) == -1) - CORRUPT(); - - for (;;) { - if (read(fd, &mcSet, sizeof(mcSet)) != sizeof(mcSet)) - CORRUPT(); - if (mcSet.invalid) - continue; - - set = xmalloc(sizeof(setT)); - memset(set, '\0', sizeof(*set)); - if (cat->first) { - cat->last->next = set; - set->prev = cat->last; - cat->last = set; - } else - cat->first = cat->last = set; - - set->setId = mcSet.setId; - - /* Get the data */ - if (mcSet.dataLen) { - data = xmalloc(mcSet.dataLen); - if (lseek(fd, mcSet.data.off, SEEK_SET) == -1) - CORRUPT(); - if (read(fd, data, mcSet.dataLen) != mcSet.dataLen) - CORRUPT(); - if (lseek(fd, mcSet.u.firstMsg, SEEK_SET) == -1) - CORRUPT(); - - for (i = 0; i < mcSet.numMsgs; ++i) { - if (read(fd, &mcMsg, sizeof(mcMsg)) != sizeof(mcMsg)) - CORRUPT(); - if (mcMsg.invalid) { - --i; - continue; - } - msg = xmalloc(sizeof(msgT)); - memset(msg, '\0', sizeof(*msg)); - if (set->first) { - set->last->next = msg; - msg->prev = set->last; - set->last = msg; - } else - set->first = set->last = msg; - - msg->msgId = mcMsg.msgId; - msg->str = xstrdup((char *) (data + mcMsg.msg.off)); - } - free(data); - } - if (!mcSet.nextSet) - break; - if (lseek(fd, mcSet.nextSet, SEEK_SET) == -1) - CORRUPT(); - } -#endif -} - /* * Write message catalog. * From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 05:17:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4051E106567C; Thu, 16 Feb 2012 05:17:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B6508FC17; Thu, 16 Feb 2012 05:17:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1G5H7FJ000157; Thu, 16 Feb 2012 05:17:07 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1G5H6Z0000155; Thu, 16 Feb 2012 05:17:06 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202160517.q1G5H6Z0000155@svn.freebsd.org> From: Eitan Adler Date: Thu, 16 Feb 2012 05: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: r231817 - head/usr.sbin/IPXrouted X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 05:17:07 -0000 Author: eadler Date: Thu Feb 16 05:17:06 2012 New Revision: 231817 URL: http://svn.freebsd.org/changeset/base/231817 Log: Fix warning when compiling with gcc46 Approved by: cperciva MFC after: 3 days Modified: head/usr.sbin/IPXrouted/tables.c Modified: head/usr.sbin/IPXrouted/tables.c ============================================================================== --- head/usr.sbin/IPXrouted/tables.c Thu Feb 16 05:17:01 2012 (r231816) +++ head/usr.sbin/IPXrouted/tables.c Thu Feb 16 05:17:06 2012 (r231817) @@ -172,7 +172,6 @@ rtadd_clone(struct rt_entry *ort, struct { struct afhash h; register struct rt_entry *rt; - struct rthash *rh; int af = dst->sa_family, flags; u_int hash; @@ -183,7 +182,6 @@ rtadd_clone(struct rt_entry *ort, struct (*afswitch[af].af_hash)(dst, &h); flags = (*afswitch[af].af_ishost)(dst) ? RTF_HOST : 0; hash = h.afh_nethash; - rh = &nethash[hash & ROUTEHASHMASK]; rt = (struct rt_entry *)malloc(sizeof (*rt)); if (rt == 0) return; @@ -213,7 +211,6 @@ rtchange(struct rt_entry *rt, struct soc short ticks) { int doioctl = 0, metricchanged = 0; - struct rtuentry oldroute; FIXLEN(gate); /* @@ -281,7 +278,6 @@ rtchange(struct rt_entry *rt, struct soc if (doioctl || metricchanged) { TRACE_ACTION("CHANGE FROM", rt); if (doioctl) { - oldroute = rt->rt_rt; rt->rt_router = *gate; } rt->rt_metric = metric; From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 05:52:55 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B6A1106564A; Thu, 16 Feb 2012 05:52:55 +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 A9C328FC0A; Thu, 16 Feb 2012 05:52:54 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1G5QAL8020279 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Feb 2012 16:26:36 +1100 Date: Thu, 16 Feb 2012 16:26:10 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh In-Reply-To: <201202152120.q1FLKww4081902@svn.freebsd.org> Message-ID: <20120216160800.P1018@besplex.bde.org> References: <201202152120.q1FLKww4081902@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231780 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 05:52:55 -0000 On Wed, 15 Feb 2012, Warner Losh wrote: > Log: > Wordsmith the can't find kernel error message, and suggest which > variable to set to override. > > Modified: > head/share/mk/bsd.kmod.mk > > Modified: head/share/mk/bsd.kmod.mk > ============================================================================== > --- head/share/mk/bsd.kmod.mk Wed Feb 15 21:03:26 2012 (r231779) > +++ head/share/mk/bsd.kmod.mk Wed Feb 15 21:20:58 2012 (r231780) > @@ -9,7 +9,7 @@ SYSDIR= ${_dir} > .endfor > .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \ > !exists(${SYSDIR}/conf/kmod.mk) > -.error "can't find kernel source tree" > +.error "can't locate the kernel source tree, set SYSDIR to override." > .endif > > .include "${SYSDIR}/conf/kmod.mk" This adds 2 punctuation errors: - comma (comma splice) - period. Error messages are not terminated in KNF. However, most of the others in *.mk are terminated. This one also differs from the style of most of the others in quoting the string. The only other one that uses quotes is the only other one that doesn't use a period. It is unclear what tokens can go after .error. In C, the tokens after #error should always be quoted, since some tokens are special. About 1/3 of the others don't contrace "cannot" to "can't". None of the others has the comma splice error. This might be because none of the others has multiple clauses. When clauses are spliced using a comma, the comma must be followed by a conjunctive adverb, but a semicolon usually works and helps keep error messages short. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 06:45:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6742106566B; Thu, 16 Feb 2012 06:45:51 +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 D14C68FC08; Thu, 16 Feb 2012 06:45:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1G6jpuW002967; Thu, 16 Feb 2012 06:45:51 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1G6jpRG002965; Thu, 16 Feb 2012 06:45:51 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201202160645.q1G6jpRG002965@svn.freebsd.org> From: Alan Cox Date: Thu, 16 Feb 2012 06:45: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: r231819 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 06:45:52 -0000 Author: alc Date: Thu Feb 16 06:45:51 2012 New Revision: 231819 URL: http://svn.freebsd.org/changeset/base/231819 Log: When vm_mmap() is used to map a vm object into a kernel vm_map, it makes no sense to check the size of the kernel vm_map against the user-level resource limits for the calling process. Reviewed by: kib Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Thu Feb 16 06:11:00 2012 (r231818) +++ head/sys/vm/vm_mmap.c Thu Feb 16 06:45:51 2012 (r231819) @@ -1438,18 +1438,18 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, size = round_page(size); - PROC_LOCK(td->td_proc); - if (td->td_proc->p_vmspace->vm_map.size + size > - lim_cur(td->td_proc, RLIMIT_VMEM)) { - PROC_UNLOCK(td->td_proc); - return (ENOMEM); - } - if (racct_set(td->td_proc, RACCT_VMEM, - td->td_proc->p_vmspace->vm_map.size + size)) { + if (map == &td->td_proc->p_vmspace->vm_map) { + PROC_LOCK(td->td_proc); + if (map->size + size > lim_cur(td->td_proc, RLIMIT_VMEM)) { + PROC_UNLOCK(td->td_proc); + return (ENOMEM); + } + if (racct_set(td->td_proc, RACCT_VMEM, map->size + size)) { + PROC_UNLOCK(td->td_proc); + return (ENOMEM); + } PROC_UNLOCK(td->td_proc); - return (ENOMEM); } - PROC_UNLOCK(td->td_proc); /* * We currently can only deal with page aligned file offsets. From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 07:02:27 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C88861065673; Thu, 16 Feb 2012 07:02:27 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 359F68FC0A; Thu, 16 Feb 2012 07:02:26 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1G72ObZ013355 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Feb 2012 18:02:25 +1100 Date: Thu, 16 Feb 2012 18:02:24 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rick Macklem In-Reply-To: <201202160219.q1G2Jr5J093922@svn.freebsd.org> Message-ID: <20120216180210.Y1018@besplex.bde.org> References: <201202160219.q1G2Jr5J093922@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231805 - in head/sys/fs: nfs nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 07:02:27 -0000 On Thu, 16 Feb 2012, Rick Macklem wrote: > Log: > Delete a couple of out of date comments that are no longer true in > the new NFS client. > > Requested by: bde > MFC after: 1 week Thanks. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 07:47:16 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00D381065673; Thu, 16 Feb 2012 07:47:16 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id 681478FC0A; Thu, 16 Feb 2012 07:47:15 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q1G7l2Qv011671; Thu, 16 Feb 2012 16:47:12 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q1G7l1xc087259; Thu, 16 Feb 2012 16:47:02 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Thu, 16 Feb 2012 16:43:32 +0900 (JST) Message-Id: <20120216.164332.2209961872967607025.hrs@allbsd.org> To: eadler@FreeBSD.org From: Hiroki Sato In-Reply-To: <201202160517.q1G5H6Z0000155@svn.freebsd.org> <201202160517.q1G5H14i000118@svn.freebsd.org> References: <201202160517.q1G5H6Z0000155@svn.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.4 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Thu_Feb_16_16_43_32_2012_655)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Thu, 16 Feb 2012 16:47:13 +0900 (JST) X-Spam-Status: No, score=-104.6 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231817 - head/usr.sbin/IPXrouted X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 07:47:16 -0000 ----Security_Multipart(Thu_Feb_16_16_43_32_2012_655)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Eitan Adler wrote in <201202160517.q1G5H6Z0000155@svn.freebsd.org>: ea> Author: eadler ea> Date: Thu Feb 16 05:17:06 2012 ea> New Revision: 231817 ea> URL: http://svn.freebsd.org/changeset/base/231817 ea> ea> Log: ea> Fix warning when compiling with gcc46 ea> ea> Approved by: cperciva ea> MFC after: 3 days ea> ea> Modified: ea> head/usr.sbin/IPXrouted/tables.c (snip) ea> @@ -213,7 +211,6 @@ rtchange(struct rt_entry *rt, struct soc ea> short ticks) ea> { ea> int doioctl = 0, metricchanged = 0; ea> - struct rtuentry oldroute; ea> ea> FIXLEN(gate); ea> /* ea> @@ -281,7 +278,6 @@ rtchange(struct rt_entry *rt, struct soc ea> if (doioctl || metricchanged) { ea> TRACE_ACTION("CHANGE FROM", rt); ea> if (doioctl) { ea> - oldroute = rt->rt_rt; ea> rt->rt_router = *gate; ea> } ea> rt->rt_metric = metric; ea> The oldroute is still used in the #ifdef section at the end of this function. ea> Author: eadler ea> Date: Thu Feb 16 05:17:01 2012 ea> New Revision: 231816 ea> URL: http://svn.freebsd.org/changeset/base/231816 ea> ea> Log: ea> Removed unused code: fixes compiler warning with CC=gcc46 ea> error: parameter 'fd' set but not used ea> ea> Approved by: cperciva ea> MFC after: 1 week ea> ea> Modified: ea> head/usr.bin/gencat/gencat.c ea> ea> Modified: head/usr.bin/gencat/gencat.c ea> ============================================================================== ea> --- head/usr.bin/gencat/gencat.c Thu Feb 16 05:16:55 2012 (r231815) ea> +++ head/usr.bin/gencat/gencat.c Thu Feb 16 05:17:01 2012 (r231816) ea> @@ -462,89 +462,6 @@ MCParse(int fd) ea> } ea> } ea> ea> -void ea> -MCReadCat(int fd) ea> -{ ea> - fd = 0; This file was from NetBSD and this change just increased the diff. I do not understand why the prototype declaration of MCReadCat() was left while the main body was removed. IMHO it is not a good idea to remove unused code partially like this or unused code in one from another project if you just want to suppress a compiler warning. It may suppress the warning, but remaining bits in comments and/or conditional parts where the compiler does not complain make developers confused. I think it is more harmful than the warning. -- Hiroki ----Security_Multipart(Thu_Feb_16_16_43_32_2012_655)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk88s6QACgkQTyzT2CeTzy21+wCfZyyOVOnML3ry8ar7ff+Uuglv Sb8AoJWdi+32rF/XOdo/MaGYxUYyoBZx =ZzuH -----END PGP SIGNATURE----- ----Security_Multipart(Thu_Feb_16_16_43_32_2012_655)---- From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 08:39:59 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD949106564A; Thu, 16 Feb 2012 08:39:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 2F4458FC0C; Thu, 16 Feb 2012 08:39:58 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1G8dtvU024795 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Feb 2012 19:39:56 +1100 Date: Thu, 16 Feb 2012 19:39:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler In-Reply-To: <201202160511.q1G5BZNk099785@svn.freebsd.org> Message-ID: <20120216181210.K1423@besplex.bde.org> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 08:39:59 -0000 On Thu, 16 Feb 2012, Eitan Adler wrote: > Log: > Add a timestamp to the msgbuf output in order to determine when when > messages were printed. > > This can be enabled with the kern.msgbuf_show_timestamp sysctl Apart from being fundamentally broken, this adds lots of bloat and style bugs. The msgbuf is a very low-level interface, and was careful not to do stuff like this. I'm still waiting for the previous round of breakage of it, that replaces careful atomic ops by spinlocks, to be backed out. Code at this level cannot use any normal locking, and used to be carefully written to not do so. The spinlocks break it, for example, if there is a trap while holding the lock and the trap handler wants to use the message buffer. Interrupts are possible too, but they are disabled on the same CPU for technical reasons, so they cannot cause deadlock here. The main possiblities for traps are NMIs. The NMI handler shouldn't call printf, but perhaps it does. It might cause a panic. Then panic can only print by blowing open the locks. It might be a STOP IPI. The stop function uses printf to diagnose other blockages, at least with certain options. Anyway printf must never block endlessly, so msgbuf functions must not never block endlessly either, so neither can use any normal locking, since normal locking can easily block endlessly in deadlock conditions, by the definition of deadlock. > Modified: head/sys/kern/subr_msgbuf.c > ============================================================================== > --- head/sys/kern/subr_msgbuf.c Thu Feb 16 05:06:07 2012 (r231813) > +++ head/sys/kern/subr_msgbuf.c Thu Feb 16 05:11:35 2012 (r231814) > @@ -47,6 +49,14 @@ > static u_int msgbuf_cksum(struct msgbuf *mbp); > > /* > + * > + */ First style bug: 3 lines for a content-free comment. > +static int msgbuf_show_timestamp = 0; > +SYSCTL_INT(_kern, OID_AUTO, msgbuf_show_timestamp, CTLFLAG_RW | CTLFLAG_TUN, > + &msgbuf_show_timestamp, 0, "Show timestamp in msgbuf"); > +TUNABLE_INT("kern.msgbuf_show_timestamp", &msgbuf_show_timestamp); Not too bad. > @@ -149,6 +159,33 @@ msgbuf_do_addchar(struct msgbuf *mbp, u_ > *seq = MSGBUF_SEQNORM(mbp, *seq + 1); > } > > +static inline void Bogus inlining. This function is about 10 times too large to be worth inlining, and gcc-4 will already do excessive inlining for it if it is only used once. > +msgbuf_do_addchar(struct msgbuf * const mbp, u_int * const seq, const int c) > +{ In KNF, local variables for a function go here... > + > + if (msgbuf_show_timestamp && > + (mbp->msg_flags & MSGBUF_NEXT_NEW_LINE) != 0) { > + char buf[32]; > + char const *bufp; > + struct timespec ts; > + int err; ...not here. The struct would be sorted first in KNF. > + > + getnanouptime(&ts); By calling this, you open the msgbuf to any deadlock possibilities that are in getnanouptime(). There are none currently, but this is not guaranteed. There are some for nanoutuptime(), since some timecounters use normal locking. `witness' is careful not to use any timecounter functions, though timestamps for it would be considerably more useful than here. I thought that it used timestamps, but can find any in it now. And shouldn't this be a human-readable real time instead of the monotonic time? `ticks' is just as good for a human-unreadable monotonic time (except it overflows after 24+ days and wraps at 48+ days with HZ = 1000). > + err = snprintf(buf, sizeof (buf), "[%jd.%ld] ", > + (intmax_t)ts.tv_sec, ts.tv_nsec / 1000); This can convert `ticks' to much the same human-unreadable time that getnanouptime() returns. Using getnanouptime() is bogus because the time in microseconds is printed. getmicrouptime() would return that directly and not need to be converted. Who cares about the microseconds part? If anyone cares, then it should be printed in human-readable %06ld format. One bug in %ld format is that it gives ".1" for 1 microseconds, but ".1" looks like 1/10. With %06ld format, it is fairly clear that the precision is in microseconds, and interpreting the time as in seconds with a fractional part gives the correct time. Other representation problems: - my idea of using the real time is no good. Times in seconds since the Epoch are more than a billion, so they are not human-readable. - times since boot time are fairly human-unreadable too, after running for a few hours makes them large. - the microseconds precision is bogus. getnanouptime() only provides a resolution of 1/HZ, with garbage in the low bits. If anyone cares about the fractional part, then when HZ = 100 it should be printed using %02ld format like time(1) bogusly does (the resolution hasn't been 1/100 for time(1) for almost 20 years), and when HZ = 1000 it should be printed using %03ld format. > + > + for (bufp = buf; *bufp != '\0'; bufp++) > + __msgbuf_do_addchar(mbp, seq, *bufp); > + > + mbp->msg_flags &= ~MSGBUF_NEXT_NEW_LINE; > + } > + > + __msgbuf_do_addchar(mbp, seq, c); > + In KNF, statements are separated by a single newline, not 2. The change to spinlocks also added a lot of style bugs of this. > ... No further style problems in the .c file. > Modified: head/sys/sys/msgbuf.h > ============================================================================== > --- head/sys/sys/msgbuf.h Thu Feb 16 05:06:07 2012 (r231813) > +++ head/sys/sys/msgbuf.h Thu Feb 16 05:11:35 2012 (r231814) > @@ -46,7 +46,9 @@ struct msgbuf { > u_int msg_cksum; /* checksum of contents */ > u_int msg_seqmod; /* range for sequence numbers */ > int msg_lastpri; /* saved priority value */ > - int msg_needsnl; /* set when newline needed */ > + u_int msg_flags; In KNF, the primary indentation is 1 tab, but this was broken for msgbuf in the same commit that broke its locking; this commit follows KNF, but this is inconsistent. The previous breakage was not in the usual way which expands 1 tab to 2 -- here it expands 1 tab to 1 tab plus 3 spaces, giving a weird indentatation of 11 columns. Weird indentations like this are difficult to be consistent with. > +#define MSGBUF_NEEDNL 0x01 /* set when newline needed */ > +#define MSGBUF_NEXT_NEW_LINE 0x02 In KNF, the primary indentation is 1 tab after #define. This is still followed for all other #define's in this file. The style of these #define's is very inconsistent. Only one has a comment. One abbreviates newline as NL, and the other verbosifies it as NEW_LINE. > struct mtx msg_lock; /* mutex to protect the buffer */ > }; So the fundamental error in this commit is just the logic error of calling the possibly-unsafe function getnanouptime(), and my complaint is mainly about the previous breakage. I first thought that this change was about print_uptime() in shutdown. This uses a lot of code to unprettily print the uptime in a primitive human-readable format (days, hours, minutes and seconds with dhms tags but no separators like ':'). It doesn't bother printing fractional seconds. It doesn't bogusly cast tv_sec to intmax_t. It bogusly casts to long instead. intmax_t is excessive whenever tv_sec is a delta-time. Here casting to plain int is enough for uptimes of up to 68 years, since 16-bit ints are not supported. print_uptime() is even less needed with uptimes in the msgbuf. It was almost useless precisely because it wasn't in the msgbuf. You had to watch the console to see it, but if you do that then you probably remember when it was booted, or just rebooted manually and should have checked the boot time first. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 08:52:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A78581065675; Thu, 16 Feb 2012 08:52:05 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 580768FC14; Thu, 16 Feb 2012 08:52:05 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id q1G8q2f1011345 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 16 Feb 2012 00:52:04 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4F3CC40D.4000307@freebsd.org> Date: Thu, 16 Feb 2012 00:53:33 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.26) Gecko/20120129 Thunderbird/3.1.18 MIME-Version: 1.0 To: Bruce Evans References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> In-Reply-To: <20120216181210.K1423@besplex.bde.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, Eitan Adler Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 08:52:05 -0000 On 2/16/12 12:39 AM, Bruce Evans wrote: > On Thu, 16 Feb 2012, Eitan Adler wrote: > >> Log: >> Add a timestamp to the msgbuf output in order to determine when when >> messages were printed. >> >> This can be enabled with the kern.msgbuf_show_timestamp sysctl > > Apart from being fundamentally broken, this adds lots of bloat and > style bugs. The msgbuf is a very low-level interface, and was > careful not to do stuff like this. I'm still waiting for the previous > round of breakage of it, that replaces careful atomic ops by spinlocks, > to be backed out. Code at this level cannot use any normal locking, > and used to be carefully written to not do so. The spinlocks break it, > for example, if there is a trap while holding the lock and the trap > handler wants to use the message buffer. Interrupts are possible > too, but they are disabled on the same CPU for technical reasons, so > they cannot cause deadlock here. The main possiblities for traps are > NMIs. The NMI handler shouldn't call printf, but perhaps it does. > It might cause a panic. Then panic can only print by blowing open > the locks. It might be a STOP IPI. The stop function uses printf > to diagnose other blockages, at least with certain options. Anyway > printf must never block endlessly, so msgbuf functions must not never > block endlessly either, so neither can use any normal locking, since > normal locking can easily block endlessly in deadlock conditions, by > the definition of deadlock. Bruce, this is a good example of a legitimate gripe going un-noticed because you didn't shout loud enough at the right time, at the right people. It's been about 20 years since we started working on this but I've finally come to the point of saying that we need you to do more when you see problems. object officially if you think things should be backed out! your reasons here seem sound, so it's hard to see why you haven't been more public about it. Julian From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 08:56:14 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93CAC1065674; Thu, 16 Feb 2012 08:56:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 0F2458FC13; Thu, 16 Feb 2012 08:56:13 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1G8u9O7029463 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Feb 2012 19:56:11 +1100 Date: Thu, 16 Feb 2012 19:56:09 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hiroki Sato In-Reply-To: <20120216.164332.2209961872967607025.hrs@allbsd.org> Message-ID: <20120216194921.X1656@besplex.bde.org> References: <201202160517.q1G5H6Z0000155@svn.freebsd.org> <20120216.164332.2209961872967607025.hrs@allbsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, eadler@FreeBSD.org Subject: Re: svn commit: r231817 - head/usr.sbin/IPXrouted X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 08:56:14 -0000 On Thu, 16 Feb 2012, Hiroki Sato wrote: > Eitan Adler wrote > in <201202160517.q1G5H6Z0000155@svn.freebsd.org>: > > ea> Author: eadler > ea> Date: Thu Feb 16 05:17:06 2012 > ea> New Revision: 231817 > ea> URL: http://svn.freebsd.org/changeset/base/231817 > ea> > ea> Log: > ea> Fix warning when compiling with gcc46 > IMHO it is not a good idea to remove unused code partially like this > or unused code in one from another project if you just want to > suppress a compiler warning. It may suppress the warning, but > remaining bits in comments and/or conditional parts where the > compiler does not complain make developers confused. I think it is > more harmful than the warning. This is another example of the phenomenon that small bikesheds are the hardest to paint :-). It is surprisingly difficult to make many small harmless-looking changes correctly without knowing their full context, since just determining their full context may take a day or three. Each. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 09:01:17 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2379C106566C; Thu, 16 Feb 2012 09:01: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 9B1518FC13; Thu, 16 Feb 2012 09:01:15 +0000 (UTC) Received: from porto.starpoint.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 LAA13354; Thu, 16 Feb 2012 11:01:13 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RxxDE-0003uG-Ui; Thu, 16 Feb 2012 11:01:12 +0200 Message-ID: <4F3CC5C4.7020501@FreeBSD.org> Date: Thu, 16 Feb 2012 11:00:52 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0) Gecko/20120202 Thunderbird/10.0 MIME-Version: 1.0 To: Julian Elischer References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> In-Reply-To: <4F3CC40D.4000307@freebsd.org> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler , Bruce Evans Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 09:01:17 -0000 on 16/02/2012 10:53 Julian Elischer said the following: > Bruce, this is a good example of a legitimate gripe going un-noticed because > you didn't shout loud enough at the right time, at the right people. > It's been about 20 years since we started working on this but I've finally > come to the point of saying that we need you to do more when you see problems. > object officially if you think things should be backed out! > > your reasons here seem sound, so it's hard to see why you haven't been more > public about it. Just for the record: Bruce and I voiced opinions against the commit when it went in after a rather short notice for such an important thing. The opinions can be found in the archives of these lists. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 09:13:43 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE3A2106564A; Thu, 16 Feb 2012 09:13:43 +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 5DC028FC12; Thu, 16 Feb 2012 09:13:41 +0000 (UTC) Received: from porto.starpoint.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 LAA13997; Thu, 16 Feb 2012 11:13:40 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RxxPI-0003ul-9D; Thu, 16 Feb 2012 11:13:40 +0200 Message-ID: <4F3CC8A5.3030107@FreeBSD.org> Date: Thu, 16 Feb 2012 11:13:09 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0) Gecko/20120202 Thunderbird/10.0 MIME-Version: 1.0 To: Julian Elischer References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> In-Reply-To: <4F3CC5C4.7020501@FreeBSD.org> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler , Bruce Evans Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 09:13:44 -0000 on 16/02/2012 11:00 Andriy Gapon said the following: > on 16/02/2012 10:53 Julian Elischer said the following: >> Bruce, this is a good example of a legitimate gripe going un-noticed because >> you didn't shout loud enough at the right time, at the right people. >> It's been about 20 years since we started working on this but I've finally >> come to the point of saying that we need you to do more when you see problems. >> object officially if you think things should be backed out! >> >> your reasons here seem sound, so it's hard to see why you haven't been more >> public about it. > > Just for the record: Bruce and I voiced opinions against the commit when it went > in after a rather short notice for such an important thing. The opinions > can be found in the archives of these lists. To be more precise: s/opinions against/concerns about behavior in the edge cases/. For me personally the immediate benefits in the common situations outweighed the problems in the edge cases, although I still believe that we can get the former without sacrifices in the latter. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 09:18:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 983FF1065670; Thu, 16 Feb 2012 09:18:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail15.syd.optusnet.com.au (mail15.syd.optusnet.com.au [211.29.132.196]) by mx1.freebsd.org (Postfix) with ESMTP id 129258FC0C; Thu, 16 Feb 2012 09:18:12 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail15.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1G9I9if026882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Feb 2012 20:18:10 +1100 Date: Thu, 16 Feb 2012 20:18:09 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Julian Elischer In-Reply-To: <4F3CC40D.4000307@freebsd.org> Message-ID: <20120216195726.V1707@besplex.bde.org> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler , Bruce Evans Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 09:18:14 -0000 On Thu, 16 Feb 2012, Julian Elischer wrote: > On 2/16/12 12:39 AM, Bruce Evans wrote: >> On Thu, 16 Feb 2012, Eitan Adler wrote: >> >>> Log: >>> Add a timestamp to the msgbuf output in order to determine when when >>> messages were printed. >>> >>> This can be enabled with the kern.msgbuf_show_timestamp sysctl >> >> Apart from being fundamentally broken, this adds lots of bloat and >> style bugs. The msgbuf is a very low-level interface, and was >> careful not to do stuff like this. I'm still waiting for the previous >> round of breakage of it, that replaces careful atomic ops by spinlocks, >> to be backed out. Code at this level cannot use any normal locking, >> > Bruce, this is a good example of a legitimate gripe going un-noticed because > you didn't shout loud enough at the right time, at the right people. But I did, in 2 replies to a reply to its commit message in June 2011. > It's been about 20 years since we started working on this but I've finally > come to the point of saying that we need you to do more when you see > problems. > object officially if you think things should be backed out! > > your reasons here seem sound, so it's hard to see why you haven't been more > public about it. I don't use -current often enough to insist on things being backed out. The technical argument will have to suffice. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 14:08:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FF3D106566B; Thu, 16 Feb 2012 14:08:15 +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 7B14A8FC0C; Thu, 16 Feb 2012 14:08:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GE8FG5019370; Thu, 16 Feb 2012 14:08:15 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GE8Fkp019368; Thu, 16 Feb 2012 14:08:15 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201202161408.q1GE8Fkp019368@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 16 Feb 2012 14:08: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: r231821 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 14:08:15 -0000 Author: pluknet Date: Thu Feb 16 14:08:14 2012 New Revision: 231821 URL: http://svn.freebsd.org/changeset/base/231821 Log: delete-old does not have delete-old-libs dependency. Reflect this in the comment. PR: conf/163993 Submitted by: Eugen Konkov MFC after: 3 days Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Thu Feb 16 10:58:15 2012 (r231820) +++ head/Makefile Thu Feb 16 14:08:14 2012 (r231821) @@ -24,7 +24,7 @@ # check-old-dirs - List obsolete directories. # check-old-files - List obsolete files. # check-old-libs - List obsolete libraries. -# delete-old - Delete obsolete directories/files/libraries. +# delete-old - Delete obsolete directories/files. # delete-old-dirs - Delete obsolete directories. # delete-old-files - Delete obsolete files. # delete-old-libs - Delete obsolete libraries. From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 14:38:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5BDF1065670; Thu, 16 Feb 2012 14:38:34 +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 3AF778FC19; Thu, 16 Feb 2012 14:38:33 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1GEcNpk014028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Feb 2012 01:38:25 +1100 Date: Fri, 17 Feb 2012 01:38:23 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans In-Reply-To: <20120212040658.D4220@besplex.bde.org> Message-ID: <20120217012142.I2506@besplex.bde.org> References: <201202102216.q1AMGI0m098192@svn.freebsd.org> <20120211194854.J2214@besplex.bde.org> <20120211163807.GA25525@cons.org> <20120212040658.D4220@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Martin Cracauer , Martin Cracauer , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r231449 - head/usr.bin/tee X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 14:38:35 -0000 On Sun, 12 Feb 2012, Bruce Evans wrote: > BTW, one of the many bugs in the tty driver in -current is that it no > longer does watermark processing for select() and poll(), so it reads > and writes tinygrams even when polled using select() and poll() (and > there is no better way). I use the following quick fix: > > % Index: ttydisc.h > % =================================================================== > % RCS file: /home/ncvs/src/sys/sys/ttydisc.h,v > % retrieving revision 1.7 > % diff -u -2 -r1.7 ttydisc.h > % --- ttydisc.h 23 Aug 2009 08:04:40 -0000 1.7 > % +++ ttydisc.h 25 Sep 2010 14:37:54 -0000 > % @@ -70,8 +70,13 @@ > % ttydisc_read_poll(struct tty *tp) > % { > % + size_t navail; > % % tty_lock_assert(tp, MA_OWNED); > % % - return ttyinq_bytescanonicalized(&tp->t_inq); > % + navail = ttyinq_bytescanonicalized(&tp->t_inq); > % + if ((tp->t_termios.c_lflag & ICANON) == 0 && > % + navail < tp->t_termios.c_cc[VMIN] && tp->t_termios.c_cc[VTIME] == > 0) > % + navail = 0; > % + return (navail); > % } > % % @@ -79,8 +84,10 @@ > % ttydisc_write_poll(struct tty *tp) > % { > % + size_t nleft; > % % tty_lock_assert(tp, MA_OWNED); > % % - return ttyoutq_bytesleft(&tp->t_outq); > % + nleft = ttyoutq_bytesleft(&tp->t_outq); > % + return (nleft >= tp->t_outlow ? nleft : 0); > % } > % > > The watermarks that affect applications should be under control of the > application like they are for sockets. There is only limited control > of the read watermark for ttys, by enabling MIN and setting it as high > as possible (the maximum is normally UCHAR_MAX which is normally 255), > and this is not standardized, but it works in Linux and used to work > in FreeBSD. > > The watermarks that affect drivers should be under control of drivers > like they used to be. Here is a program that demonstrates the brokenness of select() on any tty in -current (I tested with an ssh pty). select() is specified to not return before i/o can be done without blocking. But -current blocks. This program uses blocking mode so that POSIX is clearly violated. Practical programs need to use non-blocking mode so they don't block if something steals their input, or if there is a kernel bug like this. Then they need select() to not return before i/o can be done wthout blocking _in blocking mode_ although they actually use non-blocking mode to do the i/o. Otherwise they will do i/o in tinygrams. I just checked POSIX and was a little surprised to find that it specifies the correct behaviour perfectly: "A descriptor shall be considered ready for reading when a call to an input function with O_NONBLOCK clear would block..." % #include % #include % #include % #include % #include % #include % #include % % int % main(void) % { % fd_set readfds; % struct termios ot, t; % int flags, n; % char buf[8]; % % flags = fcntl(0, F_SETFL); % if (flags == -1) % err(1, "fcntl"); % if (fcntl(0, F_SETFL, flags & ~O_NONBLOCK) != 0) % err(1, "fcntl"); % if (tcgetattr(0, &t) != 0) % err(1, "tcgetattr() of stdin"); % ot = t; % cfmakeraw(&t); % t.c_cc[VMIN] = 2; % t.c_cc[VTIME] = 0; % if (tcsetattr(0, TCSANOW, &t) != 0) % err(1, "tcsetattr() of stdin"); % FD_SET(0, &readfds); % fprintf(stderr, "Type 2 letters. This should not proceed\r\n"); % fprintf(stderr, "to `select returned' after only 1 ... "); % if (select(1, &readfds, NULL, NULL, NULL) <= 0) % err(1, "select"); % fprintf(stderr, "select returned ... "); % n = read(0, buf, sizeof(buf)); % fprintf(stderr, "read returned `"); % if (n < 0) % err(1, "read"); % if (tcsetattr(0, TCSANOW, &ot) != 0) % err(1, "tcsetattr() of stdin"); % (void)write(1, buf, n); % fprintf(stderr, "'\n"); % exit(0); % } The error handling here is excessive but still not complete. If fails to restore the terminal state after an err() exit. "stty sane" also fails to restore the terminal to is sane state. It leaves MIN at 2, which can be very confusing. Most shells change it to 1 for their editor, then restore it to 2 to confuse the next program that doesn't change it. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 14:44:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C825A106564A; Thu, 16 Feb 2012 14:44:52 +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 B2EC58FC0C; Thu, 16 Feb 2012 14:44:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GEiqc0021173; Thu, 16 Feb 2012 14:44:52 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GEiqvd021171; Thu, 16 Feb 2012 14:44:52 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202161444.q1GEiqvd021171@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 16 Feb 2012 14:44: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: r231823 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 14:44:52 -0000 Author: glebius Date: Thu Feb 16 14:44:52 2012 New Revision: 231823 URL: http://svn.freebsd.org/changeset/base/231823 Log: In ng_getsockaddr() allocate memory prior to obtaining lock. Reported & tested by: Mykola Dzham Modified: head/sys/netgraph/ng_socket.c Modified: head/sys/netgraph/ng_socket.c ============================================================================== --- head/sys/netgraph/ng_socket.c Thu Feb 16 14:42:35 2012 (r231822) +++ head/sys/netgraph/ng_socket.c Thu Feb 16 14:44:52 2012 (r231823) @@ -490,33 +490,30 @@ ng_getsockaddr(struct socket *so, struct int sg_len; int error = 0; - /* Why isn't sg_data a `char[1]' ? :-( */ - sg_len = sizeof(struct sockaddr_ng) - sizeof(sg->sg_data) + 1; - pcbp = sotongpcb(so); if ((pcbp == NULL) || (pcbp->sockdata == NULL)) /* XXXGL: can this still happen? */ return (EINVAL); + sg_len = sizeof(struct sockaddr_ng) + NG_NODESIZ - + sizeof(sg->sg_data); + sg = malloc(sg_len, M_SONAME, M_WAITOK | M_ZERO); + mtx_lock(&pcbp->sockdata->mtx); if (pcbp->sockdata->node != NULL) { node_p node = pcbp->sockdata->node; - int namelen = 0; /* silence compiler! */ if (NG_NODE_HAS_NAME(node)) - sg_len += namelen = strlen(NG_NODE_NAME(node)); - - sg = malloc(sg_len, M_SONAME, M_WAITOK | M_ZERO); - - if (NG_NODE_HAS_NAME(node)) - bcopy(NG_NODE_NAME(node), sg->sg_data, namelen); + bcopy(NG_NODE_NAME(node), sg->sg_data, + strlen(NG_NODE_NAME(node))); + mtx_unlock(&pcbp->sockdata->mtx); sg->sg_len = sg_len; sg->sg_family = AF_NETGRAPH; *addr = (struct sockaddr *)sg; - mtx_unlock(&pcbp->sockdata->mtx); } else { mtx_unlock(&pcbp->sockdata->mtx); + free(sg, M_SONAME); error = EINVAL; } From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 16:48:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16CE6106564A; Thu, 16 Feb 2012 16:48:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01FDD8FC15; Thu, 16 Feb 2012 16:48:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GGmCJV025506; Thu, 16 Feb 2012 16:48:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GGmCmo025504; Thu, 16 Feb 2012 16:48:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202161648.q1GGmCmo025504@svn.freebsd.org> From: Adrian Chadd Date: Thu, 16 Feb 2012 16:48: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: r231828 - head/sys/dev/wtap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 16:48:13 -0000 Author: adrian Date: Thu Feb 16 16:48:12 2012 New Revision: 231828 URL: http://svn.freebsd.org/changeset/base/231828 Log: Add a module dependency on wlan. Submitted by: monthadar@gmail.com Modified: head/sys/dev/wtap/if_wtap_module.c Modified: head/sys/dev/wtap/if_wtap_module.c ============================================================================== --- head/sys/dev/wtap/if_wtap_module.c Thu Feb 16 15:36:05 2012 (r231827) +++ head/sys/dev/wtap/if_wtap_module.c Thu Feb 16 16:48:12 2012 (r231828) @@ -184,3 +184,4 @@ static moduledata_t wtap_conf = { }; DECLARE_MODULE(wtap, wtap_conf, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); +MODULE_DEPEND(wtap, wlan, 1, 1, 1); /* 802.11 media layer */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 17:48:00 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 150CD106564A; Thu, 16 Feb 2012 17:48:00 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 6C39C8FC14; Thu, 16 Feb 2012 17:47:59 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id q1GHlw1D070466; Thu, 16 Feb 2012 10:47:58 -0700 (MST) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id q1GHlw3T070465; Thu, 16 Feb 2012 10:47:58 -0700 (MST) (envelope-from ken) Date: Thu, 16 Feb 2012 10:47:58 -0700 From: "Kenneth D. Merry" To: Andriy Gapon Message-ID: <20120216174758.GA64180@nargothrond.kdm.org> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F3CC8A5.3030107@FreeBSD.org> User-Agent: Mutt/1.4.2i Cc: src-committers@FreeBSD.org, Eitan Adler , svn-src-all@FreeBSD.org, Bruce Evans , svn-src-head@FreeBSD.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 17:48:00 -0000 On Thu, Feb 16, 2012 at 11:13:09 +0200, Andriy Gapon wrote: > on 16/02/2012 11:00 Andriy Gapon said the following: > > on 16/02/2012 10:53 Julian Elischer said the following: > >> Bruce, this is a good example of a legitimate gripe going un-noticed because > >> you didn't shout loud enough at the right time, at the right people. > >> It's been about 20 years since we started working on this but I've finally > >> come to the point of saying that we need you to do more when you see problems. > >> object officially if you think things should be backed out! > >> > >> your reasons here seem sound, so it's hard to see why you haven't been more > >> public about it. > > > > Just for the record: Bruce and I voiced opinions against the commit when it went > > in after a rather short notice for such an important thing. The opinions > > can be found in the archives of these lists. > > To be more precise: s/opinions against/concerns about behavior in the edge cases/. > > For me personally the immediate benefits in the common situations outweighed the > problems in the edge cases, although I still believe that we can get the former > without sacrifices in the latter. I will happily back the message buffer locking changes out if you and Bruce agree that that is the best thing to do. I can also review any proposed fixes to the message buffer locking code, but I really don't have the bandwidth right now to come up with the "real" solution. Sorry I didn't get around to dealing with it, I should have said something months ago. Now that you know a fix won't be coming from me, you two can let me know whether you'd like the changes backed out, or you are certainly free to commit a solution yourselves. Ken -- Kenneth Merry ken@FreeBSD.org From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 18:51:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9B0D106564A; Thu, 16 Feb 2012 18:51:12 +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 C7E8B8FC0A; Thu, 16 Feb 2012 18:51:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GIpCXY029608; Thu, 16 Feb 2012 18:51:12 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GIpCHF029606; Thu, 16 Feb 2012 18:51:12 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202161851.q1GIpCHF029606@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 16 Feb 2012 18:51: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: r231829 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 18:51:12 -0000 Author: glebius Date: Thu Feb 16 18:51:12 2012 New Revision: 231829 URL: http://svn.freebsd.org/changeset/base/231829 Log: Supply correct "how" argument to the uma_zcreate(). Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Thu Feb 16 16:48:12 2012 (r231828) +++ head/sys/netgraph/ng_base.c Thu Feb 16 18:51:12 2012 (r231829) @@ -3097,11 +3097,11 @@ ngb_mod_event(module_t mod, int event, v MTX_DEF); #endif ng_qzone = uma_zcreate("NetGraph items", sizeof(struct ng_item), - NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0); + NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, M_WAITOK); uma_zone_set_max(ng_qzone, maxalloc); ng_qdzone = uma_zcreate("NetGraph data items", sizeof(struct ng_item), NULL, NULL, NULL, NULL, - UMA_ALIGN_CACHE, 0); + UMA_ALIGN_CACHE, M_WAITOK); uma_zone_set_max(ng_qdzone, maxdata); /* Autoconfigure number of threads. */ if (numthreads <= 0) From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 18:54:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B5761065675; Thu, 16 Feb 2012 18:54:45 +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 4AABE8FC16; Thu, 16 Feb 2012 18:54:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GIsjO1029771; Thu, 16 Feb 2012 18:54:45 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GIsj6k029769; Thu, 16 Feb 2012 18:54:45 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202161854.q1GIsj6k029769@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 16 Feb 2012 18:54: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: r231830 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 18:54:45 -0000 Author: glebius Date: Thu Feb 16 18:54:44 2012 New Revision: 231830 URL: http://svn.freebsd.org/changeset/base/231830 Log: Specify correct loading order for core of netgraph(4). Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Thu Feb 16 18:51:12 2012 (r231829) +++ head/sys/netgraph/ng_base.c Thu Feb 16 18:54:44 2012 (r231830) @@ -3066,7 +3066,7 @@ vnet_netgraph_uninit(const void *unused } } while (node != NULL); } -VNET_SYSUNINIT(vnet_netgraph_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_netgraph_uninit, SI_SUB_NETGRAPH, SI_ORDER_FIRST, vnet_netgraph_uninit, NULL); #endif /* VIMAGE */ @@ -3132,7 +3132,7 @@ static moduledata_t netgraph_mod = { ngb_mod_event, (NULL) }; -DECLARE_MODULE(netgraph, netgraph_mod, SI_SUB_NETGRAPH, SI_ORDER_MIDDLE); +DECLARE_MODULE(netgraph, netgraph_mod, SI_SUB_NETGRAPH, SI_ORDER_FIRST); SYSCTL_NODE(_net, OID_AUTO, graph, CTLFLAG_RW, 0, "netgraph Family"); SYSCTL_INT(_net_graph, OID_AUTO, abi_version, CTLFLAG_RD, 0, NG_ABI_VERSION,""); SYSCTL_INT(_net_graph, OID_AUTO, msg_version, CTLFLAG_RD, 0, NG_VERSION, ""); From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 19:10:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A235C106566C; Thu, 16 Feb 2012 19:10:01 +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 8285E8FC18; Thu, 16 Feb 2012 19:10:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GJA1Lw030318; Thu, 16 Feb 2012 19:10:01 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GJA10O030316; Thu, 16 Feb 2012 19:10:01 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202161910.q1GJA10O030316@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 16 Feb 2012 19:10: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: r231831 - head/sys/netgraph X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 19:10:01 -0000 Author: glebius Date: Thu Feb 16 19:10:01 2012 New Revision: 231831 URL: http://svn.freebsd.org/changeset/base/231831 Log: Refactor the name hash and the ID hash, that are used to address nodes: - Make hash sizes growable, to satisfy users running large mpd installations, having thousands of nodes. - NG_NAMEHASH() proved to give a very bad distribution in real life name sets, while generic hash32_str(name, HASHINIT) proved to give an even one, so you the latter for name hash. - Do not store unnamed nodes in slot 0 of name hash, no reason for that. - Use the ID hash in cases when we need to run through all nodes: the NGM_LISTNODES command and in the vnet_netgraph_uninit(). - Implement NGM_LISTNODES and NGM_LISTNAMES as separate code, the former iterates through the ID hash, and the latter through the name hash. - Keep count of all nodes and of named nodes, so that we don't need to count nodes in NGM_LISTNODES and NGM_LISTNAMES. The counters are also used to estimate whether we need to grow hashes. - Close a race between two threads running ng_name_node() assigning same name to different nodes. Modified: head/sys/netgraph/netgraph.h head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/netgraph.h ============================================================================== --- head/sys/netgraph/netgraph.h Thu Feb 16 18:54:44 2012 (r231830) +++ head/sys/netgraph/netgraph.h Thu Feb 16 19:10:01 2012 (r231831) @@ -365,7 +365,7 @@ struct ng_node { void *nd_private; /* node type dependant node ID */ ng_ID_t nd_ID; /* Unique per node */ LIST_HEAD(hooks, ng_hook) nd_hooks; /* linked list of node hooks */ - LIST_ENTRY(ng_node) nd_nodes; /* linked list of all nodes */ + LIST_ENTRY(ng_node) nd_nodes; /* name hash collision list */ LIST_ENTRY(ng_node) nd_idnodes; /* ID hash collision list */ struct ng_queue nd_input_queue; /* input queue for locking */ int nd_refs; /* # of references to this node */ @@ -1202,10 +1202,6 @@ typedef void *meta_p; #define NGI_GET_META(i,m) #define ng_copy_meta(meta) NULL -/* Hash related definitions */ -#define NG_ID_HASH_SIZE 128 /* most systems wont need even this many */ -#define NG_NAME_HASH_SIZE 128 /* most systems wont need even this many */ - /* * Mark the current thread when called from the outbound path of the * network stack, in order to enforce queuing on ng nodes calling into Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Thu Feb 16 18:54:44 2012 (r231830) +++ head/sys/netgraph/ng_base.c Thu Feb 16 19:10:01 2012 (r231831) @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -170,10 +171,20 @@ static struct rwlock ng_typelist_lock; #define TYPELIST_WLOCK() rw_wlock(&ng_typelist_lock) #define TYPELIST_WUNLOCK() rw_wunlock(&ng_typelist_lock) -/* Hash related definitions */ -/* XXX Don't need to initialise them because it's a LIST */ -static VNET_DEFINE(LIST_HEAD(, ng_node), ng_ID_hash[NG_ID_HASH_SIZE]); -#define V_ng_ID_hash VNET(ng_ID_hash) +/* Hash related definitions. */ +LIST_HEAD(nodehash, ng_node); +static VNET_DEFINE(struct nodehash *, ng_ID_hash); +static VNET_DEFINE(u_long, ng_ID_hmask); +static VNET_DEFINE(u_long, ng_nodes); +static VNET_DEFINE(struct nodehash *, ng_name_hash); +static VNET_DEFINE(u_long, ng_name_hmask); +static VNET_DEFINE(u_long, ng_named_nodes); +#define V_ng_ID_hash VNET(ng_ID_hash) +#define V_ng_ID_hmask VNET(ng_ID_hmask) +#define V_ng_nodes VNET(ng_nodes) +#define V_ng_name_hash VNET(ng_name_hash) +#define V_ng_name_hmask VNET(ng_name_hmask) +#define V_ng_named_nodes VNET(ng_named_nodes) static struct rwlock ng_idhash_lock; #define IDHASH_RLOCK() rw_rlock(&ng_idhash_lock) @@ -182,7 +193,7 @@ static struct rwlock ng_idhash_lock; #define IDHASH_WUNLOCK() rw_wunlock(&ng_idhash_lock) /* Method to find a node.. used twice so do it here */ -#define NG_IDHASH_FN(ID) ((ID) % (NG_ID_HASH_SIZE)) +#define NG_IDHASH_FN(ID) ((ID) % (V_ng_ID_hmask + 1)) #define NG_IDHASH_FIND(ID, node) \ do { \ rw_assert(&ng_idhash_lock, RA_LOCKED); \ @@ -195,18 +206,6 @@ static struct rwlock ng_idhash_lock; } \ } while (0) -static VNET_DEFINE(LIST_HEAD(, ng_node), ng_name_hash[NG_NAME_HASH_SIZE]); -#define V_ng_name_hash VNET(ng_name_hash) - -#define NG_NAMEHASH(NAME, HASH) \ - do { \ - u_char h = 0; \ - const u_char *c; \ - for (c = (const u_char*)(NAME); *c; c++)\ - h += *c; \ - (HASH) = h % (NG_NAME_HASH_SIZE); \ - } while (0) - static struct rwlock ng_namehash_lock; #define NAMEHASH_RLOCK() rw_rlock(&ng_namehash_lock) #define NAMEHASH_RUNLOCK() rw_runlock(&ng_namehash_lock) @@ -227,8 +226,10 @@ static int ng_con_nodes(item_p item, nod node_p node2, const char *name2); static int ng_con_part2(node_p node, item_p item, hook_p hook); static int ng_con_part3(node_p node, item_p item, hook_p hook); -static int ng_mkpeer(node_p node, const char *name, - const char *name2, char *type); +static int ng_mkpeer(node_p node, const char *name, const char *name2, + char *type); +static void ng_name_rehash(void); +static void ng_ID_rehash(void); /* Imported, these used to be externally visible, some may go back. */ void ng_destroy_hook(hook_p hook); @@ -661,12 +662,7 @@ ng_make_node_common(struct ng_type *type /* Initialize hook list for new node */ LIST_INIT(&node->nd_hooks); - /* Link us into the name hash. */ - NAMEHASH_WLOCK(); - LIST_INSERT_HEAD(&V_ng_name_hash[0], node, nd_nodes); - NAMEHASH_WUNLOCK(); - - /* get an ID and put us in the hash chain */ + /* Get an ID and put us in the hash chain. */ IDHASH_WLOCK(); for (;;) { /* wrap protection, even if silly */ node_p node2 = NULL; @@ -678,6 +674,9 @@ ng_make_node_common(struct ng_type *type break; } } + V_ng_nodes++; + if (V_ng_nodes * 2 > V_ng_ID_hmask) + ng_ID_rehash(); LIST_INSERT_HEAD(&V_ng_ID_hash[NG_IDHASH_FN(node->nd_ID)], node, nd_idnodes); IDHASH_WUNLOCK(); @@ -794,10 +793,14 @@ ng_unref_node(node_p node) node->nd_type->refs--; /* XXX maybe should get types lock? */ NAMEHASH_WLOCK(); - LIST_REMOVE(node, nd_nodes); + if (NG_NODE_HAS_NAME(node)) { + V_ng_named_nodes--; + LIST_REMOVE(node, nd_nodes); + } NAMEHASH_WUNLOCK(); IDHASH_WLOCK(); + V_ng_nodes--; LIST_REMOVE(node, nd_idnodes); IDHASH_WUNLOCK(); @@ -813,9 +816,10 @@ static node_p ng_ID2noderef(ng_ID_t ID) { node_p node; + IDHASH_RLOCK(); NG_IDHASH_FIND(ID, node); - if(node) + if (node) NG_NODE_REF(node); IDHASH_RUNLOCK(); return(node); @@ -837,8 +841,9 @@ ng_node2ID(node_p node) int ng_name_node(node_p node, const char *name) { - int i, hash; + uint32_t hash; node_p node2; + int i; /* Check the name is valid */ for (i = 0; i < NG_NODESIZ; i++) { @@ -854,20 +859,26 @@ ng_name_node(node_p node, const char *na return (EINVAL); } - /* Check the name isn't already being used */ - if ((node2 = ng_name2noderef(node, name)) != NULL) { - NG_NODE_UNREF(node2); - TRAP_ERROR(); - return (EADDRINUSE); - } + NAMEHASH_WLOCK(); + if (V_ng_named_nodes * 2 > V_ng_name_hmask) + ng_name_rehash(); - /* copy it */ - strlcpy(NG_NODE_NAME(node), name, NG_NODESIZ); + hash = hash32_str(name, HASHINIT) & V_ng_name_hmask; + /* Check the name isn't already being used. */ + LIST_FOREACH(node2, &V_ng_name_hash[hash], nd_nodes) + if (NG_NODE_IS_VALID(node2) && + (strcmp(NG_NODE_NAME(node2), name) == 0)) { + NAMEHASH_WUNLOCK(); + return (EADDRINUSE); + } + if (NG_NODE_HAS_NAME(node)) + LIST_REMOVE(node, nd_nodes); + else + V_ng_named_nodes++; + /* Copy it. */ + strlcpy(NG_NODE_NAME(node), name, NG_NODESIZ); /* Update name hash. */ - NG_NAMEHASH(name, hash); - NAMEHASH_WLOCK(); - LIST_REMOVE(node, nd_nodes); LIST_INSERT_HEAD(&V_ng_name_hash[hash], node, nd_nodes); NAMEHASH_WUNLOCK(); @@ -902,8 +913,8 @@ ng_name2noderef(node_p here, const char return (ng_ID2noderef(temp)); } - /* Find node by name */ - NG_NAMEHASH(name, hash); + /* Find node by name. */ + hash = hash32_str(name, HASHINIT) & V_ng_name_hmask; NAMEHASH_RLOCK(); LIST_FOREACH(node, &V_ng_name_hash[hash], nd_nodes) if (NG_NODE_IS_VALID(node) && @@ -949,6 +960,68 @@ ng_unname(node_p node) { } +/* + * Allocate a bigger name hash. + */ +static void +ng_name_rehash() +{ + struct nodehash *new; + uint32_t hash; + u_long hmask; + node_p node, node2; + int i; + + new = hashinit_flags((V_ng_name_hmask + 1) * 2, M_NETGRAPH_NODE, &hmask, + HASH_NOWAIT); + if (new == NULL) + return; + + for (i = 0; i <= V_ng_name_hmask; i++) + LIST_FOREACH_SAFE(node, &V_ng_name_hash[i], nd_nodes, node2) { +#ifdef INVARIANTS + LIST_REMOVE(node, nd_nodes); +#endif + hash = hash32_str(NG_NODE_NAME(node), HASHINIT) & hmask; + LIST_INSERT_HEAD(&new[hash], node, nd_nodes); + } + + hashdestroy(V_ng_name_hash, M_NETGRAPH_NODE, V_ng_name_hmask); + V_ng_name_hash = new; + V_ng_name_hmask = hmask; +} + +/* + * Allocate a bigger ID hash. + */ +static void +ng_ID_rehash() +{ + struct nodehash *new; + uint32_t hash; + u_long hmask; + node_p node, node2; + int i; + + new = hashinit_flags((V_ng_ID_hmask + 1) * 2, M_NETGRAPH_NODE, &hmask, + HASH_NOWAIT); + if (new == NULL) + return; + + for (i = 0; i <= V_ng_ID_hmask; i++) + LIST_FOREACH_SAFE(node, &V_ng_ID_hash[i], nd_idnodes, node2) { +#ifdef INVARIANTS + LIST_REMOVE(node, nd_idnodes); +#endif + hash = (node->nd_ID % (hmask + 1)); + LIST_INSERT_HEAD(&new[hash], node, nd_idnodes); + } + + hashdestroy(V_ng_ID_hash, M_NETGRAPH_NODE, V_ng_name_hmask); + V_ng_ID_hash = new; + V_ng_ID_hmask = hmask; +} + /************************************************************************ Hook routines Names are not optional. Hooks are always connected, except for a @@ -2574,28 +2647,55 @@ ng_generic_msg(node_p here, item_p item, break; } - case NGM_LISTNAMES: case NGM_LISTNODES: { - const int unnamed = (msg->header.cmd == NGM_LISTNODES); struct namelist *nl; node_p node; - int num = 0, i; + int i; - NAMEHASH_RLOCK(); - /* Count number of nodes */ - for (i = 0; i < NG_NAME_HASH_SIZE; i++) { - LIST_FOREACH(node, &V_ng_name_hash[i], nd_nodes) { - if (NG_NODE_IS_VALID(node) && - (unnamed || NG_NODE_HAS_NAME(node))) { - num++; - } + IDHASH_RLOCK(); + /* Get response struct. */ + NG_MKRESPONSE(resp, msg, sizeof(*nl) + + (V_ng_nodes * sizeof(struct nodeinfo)), M_NOWAIT | M_ZERO); + if (resp == NULL) { + IDHASH_RUNLOCK(); + error = ENOMEM; + break; + } + nl = (struct namelist *) resp->data; + + /* Cycle through the lists of nodes. */ + nl->numnames = 0; + for (i = 0; i <= V_ng_ID_hmask; i++) { + LIST_FOREACH(node, &V_ng_ID_hash[i], nd_idnodes) { + struct nodeinfo *const np = + &nl->nodeinfo[nl->numnames]; + + if (NG_NODE_NOT_VALID(node)) + continue; + if (NG_NODE_HAS_NAME(node)) + strcpy(np->name, NG_NODE_NAME(node)); + strcpy(np->type, node->nd_type->name); + np->id = ng_node2ID(node); + np->hooks = node->nd_numhooks; + KASSERT(nl->numnames < V_ng_nodes, + ("%s: no space", __func__)); + nl->numnames++; } } + IDHASH_RUNLOCK(); + break; + } + case NGM_LISTNAMES: + { + struct namelist *nl; + node_p node; + int i; - /* Get response struct */ + NAMEHASH_RLOCK(); + /* Get response struct. */ NG_MKRESPONSE(resp, msg, sizeof(*nl) + - (num * sizeof(struct nodeinfo)), M_NOWAIT); + (V_ng_named_nodes * sizeof(struct nodeinfo)), M_NOWAIT); if (resp == NULL) { NAMEHASH_RUNLOCK(); error = ENOMEM; @@ -2603,24 +2703,21 @@ ng_generic_msg(node_p here, item_p item, } nl = (struct namelist *) resp->data; - /* Cycle through the linked list of nodes */ + /* Cycle through the lists of nodes. */ nl->numnames = 0; - for (i = 0; i < NG_NAME_HASH_SIZE; i++) { + for (i = 0; i <= V_ng_name_hmask; i++) { LIST_FOREACH(node, &V_ng_name_hash[i], nd_nodes) { struct nodeinfo *const np = &nl->nodeinfo[nl->numnames]; if (NG_NODE_NOT_VALID(node)) continue; - if (!unnamed && (! NG_NODE_HAS_NAME(node))) - continue; - if (NG_NODE_HAS_NAME(node)) - strcpy(np->name, NG_NODE_NAME(node)); + strcpy(np->name, NG_NODE_NAME(node)); strcpy(np->type, node->nd_type->name); np->id = ng_node2ID(node); np->hooks = node->nd_numhooks; - KASSERT(nl->numnames < num, ("%s: no space", - __func__)); + KASSERT(nl->numnames < V_ng_named_nodes, + ("%s: no space", __func__)); nl->numnames++; } } @@ -3027,6 +3124,17 @@ ng_mod_event(module_t mod, int event, vo return (error); } +static void +vnet_netgraph_init(const void *unused __unused) +{ + + /* We start with small hashes, but they can grow. */ + V_ng_ID_hash = hashinit(16, M_NETGRAPH_NODE, &V_ng_ID_hmask); + V_ng_name_hash = hashinit(16, M_NETGRAPH_NODE, &V_ng_name_hmask); +} +VNET_SYSINIT(vnet_netgraph_init, SI_SUB_NETGRAPH, SI_ORDER_FIRST, + vnet_netgraph_init, NULL); + #ifdef VIMAGE static void vnet_netgraph_uninit(const void *unused __unused) @@ -3036,9 +3144,9 @@ vnet_netgraph_uninit(const void *unused do { /* Find a node to kill */ - NAMEHASH_RLOCK(); - for (i = 0; i < NG_NAME_HASH_SIZE; i++) { - LIST_FOREACH(node, &V_ng_name_hash[i], nd_nodes) { + IDHASH_RLOCK(); + for (i = 0; i <= V_ng_ID_hmask; i++) { + LIST_FOREACH(node, &V_ng_ID_hash[i], nd_idnodes) { if (node != &ng_deadnode) { NG_NODE_REF(node); break; @@ -3047,7 +3155,7 @@ vnet_netgraph_uninit(const void *unused if (node != NULL) break; } - NAMEHASH_RUNLOCK(); + IDHASH_RUNLOCK(); /* Attempt to kill it only if it is a regular node */ if (node != NULL) { @@ -3065,6 +3173,9 @@ vnet_netgraph_uninit(const void *unused last_killed = node; } } while (node != NULL); + + hashdestroy(V_ng_name_hash, M_NETGRAPH_NODE, V_ng_name_hmask); + hashdestroy(V_ng_ID_hash, M_NETGRAPH_NODE, V_ng_ID_hmask); } VNET_SYSUNINIT(vnet_netgraph_uninit, SI_SUB_NETGRAPH, SI_ORDER_FIRST, vnet_netgraph_uninit, NULL); From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 19:25:46 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B1DC1065673; Thu, 16 Feb 2012 19:25:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id AE8508FC0C; Thu, 16 Feb 2012 19:25:45 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1GJPgPj006407 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Feb 2012 06:25:43 +1100 Date: Fri, 17 Feb 2012 06:25:42 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Kenneth D. Merry" In-Reply-To: <20120216174758.GA64180@nargothrond.kdm.org> Message-ID: <20120217053341.R1256@besplex.bde.org> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@FreeBSD.org, Eitan Adler , svn-src-all@FreeBSD.org, Andriy Gapon , Bruce Evans , svn-src-head@FreeBSD.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 19:25:46 -0000 On Thu, 16 Feb 2012, Kenneth D. Merry wrote: > On Thu, Feb 16, 2012 at 11:13:09 +0200, Andriy Gapon wrote: >> on 16/02/2012 11:00 Andriy Gapon said the following: >>> on 16/02/2012 10:53 Julian Elischer said the following: >>>> Bruce, this is a good example of a legitimate gripe going un-noticed because >>>> you didn't shout loud enough at the right time, at the right people. >>>> It's been about 20 years since we started working on this but I've finally >>>> come to the point of saying that we need you to do more when you see problems. >>>> object officially if you think things should be backed out! >>>> >>>> your reasons here seem sound, so it's hard to see why you haven't been more >>>> public about it. >>> >>> Just for the record: Bruce and I voiced opinions against the commit when it went >>> in after a rather short notice for such an important thing. The opinions >>> can be found in the archives of these lists. >> >> To be more precise: s/opinions against/concerns about behavior in the edge cases/. >> >> For me personally the immediate benefits in the common situations outweighed the >> problems in the edge cases, although I still believe that we can get the former >> without sacrifices in the latter. > > I will happily back the message buffer locking changes out if you and Bruce > agree that that is the best thing to do. Thanks. I'm not sure what backing it out would take us back to. > I can also review any proposed fixes to the message buffer locking code, > but I really don't have the bandwidth right now to come up with the "real" > solution. > > Sorry I didn't get around to dealing with it, I should have said something > months ago. > > Now that you know a fix won't be coming from me, you two can let me know > whether you'd like the changes backed out, or you are certainly free to > commit a solution yourselves. I seem to remember that I asked you to test my old simple changes for printf serialization on your larger systems that apparently generates lots of contending printfs. Kernel printfs should be a very rare operation, and kernel syslog messages not much more so, so concurrent printfs should be rare-squared. They are a non-problem for me, so my old changes haven't been tested much. But I needed serialization the other day for my printfs in trap() to debug a deadlock in ddb, since the deadlock is related to to trap() racing itself. I actually used PRINTF_BUFR_SIZE in a ~2008 kernel for this. This is actually a good test of printf() under heavy load. Any line buffering for printf() would have either broken the output format (I wanted to show many checkpoint passes per line) or changed the timing enough to make the race go away. My changes do the following to serialize per printf (not per line): - try to acquire a nonstandard spinlock implemented using atomic_cmpset. - spin for up to ~1 second (or more like 1 ms if you want) waiting for it - ignore the lock after the timeout and proceeed (with complications to not let multiple CPUs proceed at the same time, I hope) - when multiple CPUs proceed, use atomic atomic ops as before to avoid races in msgbuf accesses, and depend on console drivers being correct to avoid deadlocks and races in them. Most aren't correct. The worst that is supposed to happen is for deadlock on the nonstandard spinlock to occur except for the timeout; then the timeout reduces to interleaved output with bugs limited to console drivers by correct msgbuf code. The deadlock on the nonstanded spinlock occurs in buggy trap handlers for traps in code holding the lock (mainly ddb traps). Then it mainly gives the amusing behaviour that the buggy code is punished by printing its output very slowly. Bruce From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 21:04:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6814F106566B; Thu, 16 Feb 2012 21:04:47 +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 574438FC17; Thu, 16 Feb 2012 21:04:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GL4lLw034263; Thu, 16 Feb 2012 21:04:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GL4lLm034261; Thu, 16 Feb 2012 21:04:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201202162104.q1GL4lLm034261@svn.freebsd.org> From: Warner Losh Date: Thu, 16 Feb 2012 21:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231834 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 21:04:47 -0000 Author: imp Date: Thu Feb 16 21:04:47 2012 New Revision: 231834 URL: http://svn.freebsd.org/changeset/base/231834 Log: Fix comma splice, can't ambiguity and quoting. Submitted by: bde@ MFC after: 2 weeks Modified: head/share/mk/bsd.kmod.mk Modified: head/share/mk/bsd.kmod.mk ============================================================================== --- head/share/mk/bsd.kmod.mk Thu Feb 16 19:40:17 2012 (r231833) +++ head/share/mk/bsd.kmod.mk Thu Feb 16 21:04:47 2012 (r231834) @@ -9,7 +9,7 @@ SYSDIR= ${_dir} .endfor .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \ !exists(${SYSDIR}/conf/kmod.mk) -.error "can't locate the kernel source tree, set SYSDIR to override." +.error Unable to locate the kernel source tree. Set SYSDIR to override. .endif .include "${SYSDIR}/conf/kmod.mk" From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 21:18:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32095106566B; Thu, 16 Feb 2012 21:18:37 +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 1FFF48FC0C; Thu, 16 Feb 2012 21:18:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GLIbPd034755; Thu, 16 Feb 2012 21:18:37 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GLIbk7034752; Thu, 16 Feb 2012 21:18:37 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201202162118.q1GLIbk7034752@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 16 Feb 2012 21:18: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: r231835 - head/usr.sbin/usbdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 21:18:37 -0000 Author: hselasky Date: Thu Feb 16 21:18:36 2012 New Revision: 231835 URL: http://svn.freebsd.org/changeset/base/231835 Log: Add support for filtering USB devices and USB endpoints to the usbdump utility when making software USB traces. MFC after: 1 week Modified: head/usr.sbin/usbdump/usbdump.8 head/usr.sbin/usbdump/usbdump.c Modified: head/usr.sbin/usbdump/usbdump.8 ============================================================================== --- head/usr.sbin/usbdump/usbdump.8 Thu Feb 16 21:04:47 2012 (r231834) +++ head/usr.sbin/usbdump/usbdump.8 Thu Feb 16 21:18:36 2012 (r231835) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 31, 2011 +.Dd February 16, 2012 .Dt USBDUMP 8 .Os .Sh NAME @@ -38,6 +38,7 @@ .Op Fl s Ar snaplen .Op Fl v .Op Fl w Ar file +.Op Fl f Ar filter .Sh DESCRIPTION The .Nm @@ -61,6 +62,16 @@ When defined multiple times the verbosit .It Fl w Ar file Write the raw packets to .Ar file . +.It Fl f Ar filter +The filter argument consists of either one or two numbers separated by a dot. +The first indicates the device unit number which should be traced. +The second number which is optional indicates the endpoint which should be traced. +To get all traffic for the control endpoint, two filters should be +created, one for endpoint 0 and one for endpoint 128. +If 128 is added to the endpoint number that means IN direction, else OUT direction is implied. +A device unit or endpoint value of -1 means ignore this field. +If no filters are specified, all packets are passed through using the default -1,-1 filter. +This option can be specified multiple times. .El .Sh EXAMPLES Capture the USB raw packets on usbus2: @@ -72,6 +83,11 @@ size limit: .Pp .Dl "usbdump -i usbus2 -s 0 -w /tmp/dump_pkts" .Pp +Dump the USB raw packets of usbus2, but only the control endpoint traffic +of device unit number 3: +.Pp +.Dl "usbdump -i usbus2 -s 0 -f 3.0 -f 3.128 -w /tmp/dump_pkts" +.Pp Read and display the USB raw packets from previous file: .Pp .Dl "usbdump -r /tmp/dump_pkts -v" Modified: head/usr.sbin/usbdump/usbdump.c ============================================================================== --- head/usr.sbin/usbdump/usbdump.c Thu Feb 16 21:04:47 2012 (r231834) +++ head/usr.sbin/usbdump/usbdump.c Thu Feb 16 21:18:36 2012 (r231835) @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -45,12 +46,33 @@ #include #include #include +#include #include #include #include #include #include +#define BPF_STORE_JUMP(x,_c,_k,_jt,_jf) do { \ + (x).code = (_c); \ + (x).k = (_k); \ + (x).jt = (_jt); \ + (x).jf = (_jf); \ +} while (0) + +#define BPF_STORE_STMT(x,_c,_k) do { \ + (x).code = (_c); \ + (x).k = (_k); \ + (x).jt = 0; \ + (x).jf = 0; \ +} while (0) + +struct usb_filt { + STAILQ_ENTRY(usb_filt) entry; + int unit; + int endpoint; +}; + struct usbcap { int fd; /* fd for /dev/usbpf */ uint32_t bufsize; @@ -123,6 +145,114 @@ static const char *speed_table[USB_SPEED [USB_SPEED_SUPER] = "SUPER", }; +static STAILQ_HEAD(,usb_filt) usb_filt_head = + STAILQ_HEAD_INITIALIZER(usb_filt_head); + +static void +add_filter(int usb_filt_unit, int usb_filt_ep) +{ + struct usb_filt *puf; + + puf = malloc(sizeof(struct usb_filt)); + if (puf == NULL) + errx(EX_SOFTWARE, "Out of memory."); + + puf->unit = usb_filt_unit; + puf->endpoint = usb_filt_ep; + + STAILQ_INSERT_TAIL(&usb_filt_head, puf, entry); +} + +static void +make_filter(struct bpf_program *pprog, int snapshot) +{ + struct usb_filt *puf; + struct bpf_insn *dynamic_insn; + int len; + + len = 0; + + STAILQ_FOREACH(puf, &usb_filt_head, entry) + len++; + + dynamic_insn = malloc(((len * 5) + 1) * sizeof(struct bpf_insn)); + + if (dynamic_insn == NULL) + errx(EX_SOFTWARE, "Out of memory."); + + len++; + + if (len == 1) { + /* accept all packets */ + + BPF_STORE_STMT(dynamic_insn[0], BPF_RET | BPF_K, snapshot); + + goto done; + } + + len = 0; + + STAILQ_FOREACH(puf, &usb_filt_head, entry) { + const int addr_off = (uintptr_t)&((struct usbpf_pkthdr *)0)->up_address; + const int addr_ep = (uintptr_t)&((struct usbpf_pkthdr *)0)->up_endpoint; + + if (puf->unit != -1) { + if (puf->endpoint != -1) { + BPF_STORE_STMT(dynamic_insn[len], + BPF_LD | BPF_B | BPF_ABS, addr_off); + len++; + BPF_STORE_JUMP(dynamic_insn[len], + BPF_JMP | BPF_JEQ | BPF_K, (uint8_t)puf->unit, 0, 3); + len++; + BPF_STORE_STMT(dynamic_insn[len], + BPF_LD | BPF_W | BPF_ABS, addr_ep); + len++; + BPF_STORE_JUMP(dynamic_insn[len], + BPF_JMP | BPF_JEQ | BPF_K, htobe32(puf->endpoint), 0, 1); + len++; + } else { + BPF_STORE_STMT(dynamic_insn[len], + BPF_LD | BPF_B | BPF_ABS, addr_off); + len++; + BPF_STORE_JUMP(dynamic_insn[len], + BPF_JMP | BPF_JEQ | BPF_K, (uint8_t)puf->unit, 0, 1); + len++; + } + } else { + if (puf->endpoint != -1) { + BPF_STORE_STMT(dynamic_insn[len], + BPF_LD | BPF_W | BPF_ABS, addr_ep); + len++; + BPF_STORE_JUMP(dynamic_insn[len], + BPF_JMP | BPF_JEQ | BPF_K, htobe32(puf->endpoint), 0, 1); + len++; + } + } + BPF_STORE_STMT(dynamic_insn[len], + BPF_RET | BPF_K, snapshot); + len++; + } + + BPF_STORE_STMT(dynamic_insn[len], BPF_RET | BPF_K, 0); + len++; + +done: + pprog->bf_len = len; + pprog->bf_insns = dynamic_insn; +} + +static void +free_filter(struct bpf_program *pprog) +{ + struct usb_filt *puf; + + while ((puf = STAILQ_FIRST(&usb_filt_head)) != NULL) { + STAILQ_REMOVE_HEAD(&usb_filt_head, entry); + free(puf); + } + free(pprog->bf_insns); +} + static void handle_sigint(int sig) { @@ -527,6 +657,7 @@ usage(void) #define FMT " %-14s %s\n" fprintf(stderr, "usage: usbdump [options]\n"); fprintf(stderr, FMT, "-i ", "Listen on USB bus interface"); + fprintf(stderr, FMT, "-f ", "Specify a device and endpoint filter"); fprintf(stderr, FMT, "-r ", "Read the raw packets from file"); fprintf(stderr, FMT, "-s ", "Snapshot bytes from each packet"); fprintf(stderr, FMT, "-v", "Increase the verbose level"); @@ -539,7 +670,6 @@ int main(int argc, char *argv[]) { struct timeval tv; - struct bpf_insn total_insn; struct bpf_program total_prog; struct bpf_stat us; struct bpf_version bv; @@ -547,12 +677,16 @@ main(int argc, char *argv[]) struct ifreq ifr; long snapshot = 192; uint32_t v; - int fd, o; + int fd; + int o; + int filt_unit; + int filt_ep; const char *optstring; + char *pp; memset(&uc, 0, sizeof(struct usbcap)); - optstring = "i:r:s:vw:"; + optstring = "i:r:s:vw:f:"; while ((o = getopt(argc, argv, optstring)) != -1) { switch (o) { case 'i': @@ -563,8 +697,10 @@ main(int argc, char *argv[]) init_rfile(p); break; case 's': - snapshot = strtol(optarg, NULL, 10); + snapshot = strtol(optarg, &pp, 10); errno = 0; + if (pp != NULL && *pp != 0) + usage(); if (snapshot == 0 && errno == EINVAL) usage(); /* snapeshot == 0 is special */ @@ -578,6 +714,20 @@ main(int argc, char *argv[]) w_arg = optarg; init_wfile(p); break; + case 'f': + filt_unit = strtol(optarg, &pp, 10); + filt_ep = -1; + if (pp != NULL) { + if (*pp == '.') { + filt_ep = strtol(pp + 1, &pp, 10); + if (pp != NULL && *pp != 0) + usage(); + } else if (*pp != 0) { + usage(); + } + } + add_filter(filt_unit, filt_ep); + break; default: usage(); /* NOTREACHED */ @@ -623,17 +773,13 @@ main(int argc, char *argv[]) if (p->buffer == NULL) errx(EX_SOFTWARE, "Out of memory."); - /* XXX no read filter rules yet so at this moment accept everything */ - total_insn.code = (u_short)(BPF_RET | BPF_K); - total_insn.jt = 0; - total_insn.jf = 0; - total_insn.k = snapshot; + make_filter(&total_prog, snapshot); - total_prog.bf_len = 1; - total_prog.bf_insns = &total_insn; if (ioctl(p->fd, BIOCSETF, (caddr_t)&total_prog) < 0) err(EXIT_FAILURE, "BIOCSETF ioctl failed"); + free_filter(&total_prog); + /* 1 second read timeout */ tv.tv_sec = 1; tv.tv_usec = 0; From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 21:47:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8FE0106566B; Thu, 16 Feb 2012 21:47:17 +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 A850E8FC08; Thu, 16 Feb 2012 21:47:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GLlH4I035724; Thu, 16 Feb 2012 21:47:17 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GLlHeQ035722; Thu, 16 Feb 2012 21:47:17 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201202162147.q1GLlHeQ035722@svn.freebsd.org> From: "Justin T. Gibbs" Date: Thu, 16 Feb 2012 21:47: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: r231836 - head/sys/xen/interface/io X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 21:47:17 -0000 Author: gibbs Date: Thu Feb 16 21:47:17 2012 New Revision: 231836 URL: http://svn.freebsd.org/changeset/base/231836 Log: Fix "_" vs. "-" typo in a comment. No functional changes. Modified: head/sys/xen/interface/io/blkif.h Modified: head/sys/xen/interface/io/blkif.h ============================================================================== --- head/sys/xen/interface/io/blkif.h Thu Feb 16 21:18:36 2012 (r231835) +++ head/sys/xen/interface/io/blkif.h Thu Feb 16 21:47:17 2012 (r231836) @@ -268,7 +268,7 @@ * max-requests * Values: * Default Value: BLKIF_MAX_RING_REQUESTS(PAGE_SIZE) - * Maximum Value: BLKIF_MAX_RING_REQUESTS(PAGE_SIZE * max-ring_pages) + * Maximum Value: BLKIF_MAX_RING_REQUESTS(PAGE_SIZE * max-ring-pages) * * The maximum number of concurrent, logical requests that will be * issued by the frontend. From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 21:49:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B83D21065674; Thu, 16 Feb 2012 21:49:28 +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 A78D58FC0A; Thu, 16 Feb 2012 21:49:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GLnSSk035828; Thu, 16 Feb 2012 21:49:28 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GLnSXb035826; Thu, 16 Feb 2012 21:49:28 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201202162149.q1GLnSXb035826@svn.freebsd.org> From: "Justin T. Gibbs" Date: Thu, 16 Feb 2012 21:49: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: r231837 - head/sys/dev/xen/blkback X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 21:49:28 -0000 Author: gibbs Date: Thu Feb 16 21:49:28 2012 New Revision: 231837 URL: http://svn.freebsd.org/changeset/base/231837 Log: Fix typo in a printf string: "specificed" -> "specified". MFC after: 1 day Modified: head/sys/dev/xen/blkback/blkback.c Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Thu Feb 16 21:47:17 2012 (r231836) +++ head/sys/dev/xen/blkback/blkback.c Thu Feb 16 21:49:28 2012 (r231837) @@ -3134,7 +3134,7 @@ xbb_collect_frontend_info(struct xbb_sof if (xbb->ring_config.ring_pages > XBB_MAX_RING_PAGES) { xenbus_dev_fatal(xbb->dev, EINVAL, - "Front-end specificed ring-pages of %u " + "Front-end specified ring-pages of %u " "exceeds backend limit of %zu. " "Unable to connect.", xbb->ring_config.ring_pages, @@ -3142,7 +3142,7 @@ xbb_collect_frontend_info(struct xbb_sof return (EINVAL); } else if (xbb->max_requests > XBB_MAX_REQUESTS) { xenbus_dev_fatal(xbb->dev, EINVAL, - "Front-end specificed max_requests of %u " + "Front-end specified max_requests of %u " "exceeds backend limit of %u. " "Unable to connect.", xbb->max_requests, @@ -3150,7 +3150,7 @@ xbb_collect_frontend_info(struct xbb_sof return (EINVAL); } else if (xbb->max_request_segments > XBB_MAX_SEGMENTS_PER_REQUEST) { xenbus_dev_fatal(xbb->dev, EINVAL, - "Front-end specificed max_requests_segments " + "Front-end specified max_requests_segments " "of %u exceeds backend limit of %u. " "Unable to connect.", xbb->max_request_segments, @@ -3158,7 +3158,7 @@ xbb_collect_frontend_info(struct xbb_sof return (EINVAL); } else if (xbb->max_request_size > XBB_MAX_REQUEST_SIZE) { xenbus_dev_fatal(xbb->dev, EINVAL, - "Front-end specificed max_request_size " + "Front-end specified max_request_size " "of %u exceeds backend limit of %u. " "Unable to connect.", xbb->max_request_size, From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 21:57:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 565FF106564A; Thu, 16 Feb 2012 21:57:51 +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 4579E8FC13; Thu, 16 Feb 2012 21:57:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GLvpCo036145; Thu, 16 Feb 2012 21:57:51 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GLvpC0036141; Thu, 16 Feb 2012 21:57:51 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201202162157.q1GLvpC0036141@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 16 Feb 2012 21:57: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: r231838 - in head/sys/modules: ipdivert wi wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 21:57:51 -0000 Author: uqs Date: Thu Feb 16 21:57:50 2012 New Revision: 231838 URL: http://svn.freebsd.org/changeset/base/231838 Log: Fix 'make depend'. Modified: head/sys/modules/ipdivert/Makefile head/sys/modules/wi/Makefile head/sys/modules/wlan/Makefile Modified: head/sys/modules/ipdivert/Makefile ============================================================================== --- head/sys/modules/ipdivert/Makefile Thu Feb 16 21:49:28 2012 (r231837) +++ head/sys/modules/ipdivert/Makefile Thu Feb 16 21:57:50 2012 (r231838) @@ -5,7 +5,7 @@ .PATH: ${.CURDIR}/../../netinet KMOD= ipdivert -SRCS= ip_divert.c opt_inet.h opt_inet6.h +SRCS= ip_divert.c opt_inet.h opt_inet6.h opt_sctp.h .if !defined(KERNBUILDDIR) .if ${MK_INET_SUPPORT} != "no" Modified: head/sys/modules/wi/Makefile ============================================================================== --- head/sys/modules/wi/Makefile Thu Feb 16 21:49:28 2012 (r231837) +++ head/sys/modules/wi/Makefile Thu Feb 16 21:57:50 2012 (r231838) @@ -4,6 +4,7 @@ KMOD= if_wi SRCS= if_wi.c if_wi_pccard.c if_wi_pci.c \ - card_if.h device_if.h bus_if.h pci_if.h pccarddevs.h + card_if.h device_if.h bus_if.h pci_if.h pccarddevs.h \ + opt_wlan.h .include Modified: head/sys/modules/wlan/Makefile ============================================================================== --- head/sys/modules/wlan/Makefile Thu Feb 16 21:49:28 2012 (r231837) +++ head/sys/modules/wlan/Makefile Thu Feb 16 21:57:50 2012 (r231838) @@ -13,8 +13,8 @@ SRCS= ieee80211.c ieee80211_action.c iee ieee80211_ht.c ieee80211_hwmp.c ieee80211_adhoc.c ieee80211_hostap.c \ ieee80211_monitor.c ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c \ ieee80211_tdma.c -SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h opt_ipx.h opt_wlan.h \ - opt_ddb.h +SRCS+= bus_if.h device_if.h opt_ddb.h opt_inet.h opt_inet6.h opt_ipx.h \ + opt_tdma.h opt_wlan.h .if !defined(KERNBUILDDIR) opt_wlan.h: From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 21:58:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FF49106567E; Thu, 16 Feb 2012 21:58:48 +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 EC2B28FC12; Thu, 16 Feb 2012 21:58:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GLwlfJ036213; Thu, 16 Feb 2012 21:58:47 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GLwlVX036210; Thu, 16 Feb 2012 21:58:47 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201202162158.q1GLwlVX036210@svn.freebsd.org> From: "Justin T. Gibbs" Date: Thu, 16 Feb 2012 21:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231839 - head/sys/dev/xen/blkfront X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 21:58:48 -0000 Author: gibbs Date: Thu Feb 16 21:58:47 2012 New Revision: 231839 URL: http://svn.freebsd.org/changeset/base/231839 Log: Fix a bug in the calculation of the maximum I/O request size. The previous code did not limit the I/O request size based on the maximum number of segments supported by the back-end. In current practice, since the only back-end supporting chained requests is the FreeBSD implementation, this limit was never exceeded. sys/dev/xen/blkfront/block.h: Add two macros, XBF_SEGS_TO_SIZE() and XBF_SIZE_TO_SEGS(), to centralize the logic of reserving a segment to deal with non-page-aligned I/Os. sys/dev/xen/blkfront/blkfront.c: o When negotiating transfer parameters, limit the max_request_size we use and publish, if it is greater than the maximum, unaligned, I/O we can support with the number of segments advertised by the backend. o Don't unilaterally reduce the I/O size published to the disk layer by a single page. max_request_size is already properly limited in the transfer parameter negotiation code. o Fix typos in printf strings: "max_requests_segments" -> "max_request_segments" "specificed" -> "specified" MFC after: 1 day Modified: head/sys/dev/xen/blkfront/blkfront.c head/sys/dev/xen/blkfront/block.h Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Thu Feb 16 21:57:50 2012 (r231838) +++ head/sys/dev/xen/blkfront/blkfront.c Thu Feb 16 21:58:47 2012 (r231839) @@ -228,7 +228,7 @@ xlvbd_add(struct xb_softc *sc, blkif_sec sc->xb_disk->d_sectorsize = sector_size; sc->xb_disk->d_mediasize = sectors * sector_size; - sc->xb_disk->d_maxsize = sc->max_request_size - PAGE_SIZE; + sc->xb_disk->d_maxsize = sc->max_request_size; sc->xb_disk->d_flags = 0; disk_create(sc->xb_disk, DISK_VERSION_00); @@ -555,7 +555,7 @@ blkfront_initialize(struct xb_softc *sc) max_ring_page_order = 0; sc->ring_pages = 1; sc->max_request_segments = BLKIF_MAX_SEGMENTS_PER_HEADER_BLOCK; - sc->max_request_size = (sc->max_request_segments - 1) * PAGE_SIZE; + sc->max_request_size = XBF_SEGS_TO_SIZE(sc->max_request_segments); sc->max_request_blocks = BLKIF_SEGS_TO_BLOCKS(sc->max_request_segments); /* @@ -621,8 +621,8 @@ blkfront_initialize(struct xb_softc *sc) } if (sc->max_request_segments > XBF_MAX_SEGMENTS_PER_REQUEST) { - device_printf(sc->xb_dev, "Back-end specificed " - "max_requests_segments of %u limited to " + device_printf(sc->xb_dev, "Back-end specified " + "max_request_segments of %u limited to " "front-end limit of %u.\n", sc->max_request_segments, XBF_MAX_SEGMENTS_PER_REQUEST); @@ -630,12 +630,23 @@ blkfront_initialize(struct xb_softc *sc) } if (sc->max_request_size > XBF_MAX_REQUEST_SIZE) { - device_printf(sc->xb_dev, "Back-end specificed " + device_printf(sc->xb_dev, "Back-end specified " "max_request_size of %u limited to front-end " "limit of %u.\n", sc->max_request_size, XBF_MAX_REQUEST_SIZE); sc->max_request_size = XBF_MAX_REQUEST_SIZE; } + + if (sc->max_request_size > XBF_SEGS_TO_SIZE(sc->max_request_segments)) { + device_printf(sc->xb_dev, "Back-end specified " + "max_request_size of %u limited to front-end " + "limit of %u. (Too few segments.)\n", + sc->max_request_size, + XBF_SEGS_TO_SIZE(sc->max_request_segments)); + sc->max_request_size = + XBF_SEGS_TO_SIZE(sc->max_request_segments); + } + sc->max_request_blocks = BLKIF_SEGS_TO_BLOCKS(sc->max_request_segments); /* Allocate datastructures based on negotiated values. */ Modified: head/sys/dev/xen/blkfront/block.h ============================================================================== --- head/sys/dev/xen/blkfront/block.h Thu Feb 16 21:57:50 2012 (r231838) +++ head/sys/dev/xen/blkfront/block.h Thu Feb 16 21:58:47 2012 (r231839) @@ -35,6 +35,32 @@ #include /** + * Given a number of blkif segments, compute the maximum I/O size supported. + * + * \note This calculation assumes that all but the first and last segments + * of the I/O are fully utilized. + * + * \note We reserve a segement from the maximum supported by the transport to + * guarantee we can handle an unaligned transfer without the need to + * use a bounce buffer. + */ +#define XBF_SEGS_TO_SIZE(segs) \ + (((segs) - 1) * PAGE_SIZE) + +/** + * Compute the maximum number of blkif segments requried to represent + * an I/O of the given size. + * + * \note This calculation assumes that all but the first and last segments + * of the I/O are fully utilized. + * + * \note We reserve a segement to guarantee we can handle an unaligned + * transfer without the need to use a bounce buffer. + */ +#define XBF_SIZE_TO_SEGS(size) \ + ((size / PAGE_SIZE) + 1) + +/** * The maximum number of outstanding requests blocks (request headers plus * additional segment blocks) we will allow in a negotiated block-front/back * communication channel. @@ -44,13 +70,9 @@ /** * The maximum mapped region size per request we will allow in a negotiated * block-front/back communication channel. - * - * \note We reserve a segement from the maximum supported by the transport to - * guarantee we can handle an unaligned transfer without the need to - * use a bounce buffer.. */ #define XBF_MAX_REQUEST_SIZE \ - MIN(MAXPHYS, (BLKIF_MAX_SEGMENTS_PER_REQUEST - 1) * PAGE_SIZE) + MIN(MAXPHYS, XBF_SEGS_TO_SIZE(BLKIF_MAX_SEGMENTS_PER_REQUEST)) /** * The maximum number of segments (within a request header and accompanying @@ -59,7 +81,7 @@ */ #define XBF_MAX_SEGMENTS_PER_REQUEST \ (MIN(BLKIF_MAX_SEGMENTS_PER_REQUEST, \ - (XBF_MAX_REQUEST_SIZE / PAGE_SIZE) + 1)) + XBF_SIZE_TO_SEGS(XBF_MAX_REQUEST_SIZE))) /** * The maximum number of shared memory ring pages we will allow in a From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 22:28:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E4F01065672; Thu, 16 Feb 2012 22:28:18 +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 146D78FC1A; Thu, 16 Feb 2012 22:28:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GMSHXp037295; Thu, 16 Feb 2012 22:28:17 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GMSH0E037293; Thu, 16 Feb 2012 22:28:17 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202162228.q1GMSH0E037293@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 16 Feb 2012 22:28: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: r231840 - head/sys/amd64/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 22:28:18 -0000 Author: jkim Date: Thu Feb 16 22:28:17 2012 New Revision: 231840 URL: http://svn.freebsd.org/changeset/base/231840 Log: Refine r231791. Install the resume event handler unconditionally. Modified: head/sys/amd64/acpica/acpi_wakeup.c Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Thu Feb 16 21:58:47 2012 (r231839) +++ head/sys/amd64/acpica/acpi_wakeup.c Thu Feb 16 22:28:17 2012 (r231840) @@ -98,7 +98,8 @@ static void acpi_stop_beep(void *arg) { - timer_spkr_release(); + if (acpi_resume_beep != 0) + timer_spkr_release(); } #ifdef SMP @@ -219,7 +220,6 @@ acpi_wakeup_cpus(struct acpi_softc *sc, int acpi_sleep_machdep(struct acpi_softc *sc, int state) { - static eventhandler_tag stop_beep = NULL; #ifdef SMP cpuset_t wakeup_cpus; #endif @@ -236,21 +236,8 @@ acpi_sleep_machdep(struct acpi_softc *sc CPU_CLR(PCPU_GET(cpuid), &wakeup_cpus); #endif - if (acpi_resume_beep == 0) { - if (stop_beep != NULL) { - EVENTHANDLER_DEREGISTER(power_resume, stop_beep); - stop_beep = NULL; - } - } else { - if (stop_beep == NULL) - stop_beep = EVENTHANDLER_REGISTER(power_resume, - acpi_stop_beep, NULL, EVENTHANDLER_PRI_LAST); - if (stop_beep == NULL) - device_printf(sc->acpi_dev, - "Failed to set up event handler\n"); - else - timer_spkr_acquire(); - } + if (acpi_resume_beep != 0) + timer_spkr_acquire(); AcpiSetFirmwareWakingVector(WAKECODE_PADDR(sc)); @@ -267,7 +254,7 @@ acpi_sleep_machdep(struct acpi_softc *sc } #endif - WAKECODE_FIXUP(resume_beep, uint8_t, (stop_beep != NULL)); + WAKECODE_FIXUP(resume_beep, uint8_t, (acpi_resume_beep != 0)); WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); WAKECODE_FIXUP(wakeup_pcb, struct pcb *, susppcbs[0]); @@ -343,6 +330,12 @@ acpi_alloc_wakeup_handler(void) printf("%s: can't alloc wake memory\n", __func__); return (NULL); } + if (EVENTHANDLER_REGISTER(power_resume, acpi_stop_beep, NULL, + EVENTHANDLER_PRI_LAST) == NULL) { + printf("%s: can't register event handler\n", __func__); + contigfree(wakeaddr, 4 * PAGE_SIZE, M_DEVBUF); + return (NULL); + } susppcbs = malloc(mp_ncpus * sizeof(*susppcbs), M_DEVBUF, M_WAITOK); suspfpusave = malloc(mp_ncpus * sizeof(void *), M_DEVBUF, M_WAITOK); for (i = 0; i < mp_ncpus; i++) { From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 22:33:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D26B106564A; Thu, 16 Feb 2012 22:33:54 +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 1CE1C8FC1F; Thu, 16 Feb 2012 22:33:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GMXsQX037525; Thu, 16 Feb 2012 22:33:54 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GMXrbl037523; Thu, 16 Feb 2012 22:33:54 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202162233.q1GMXrbl037523@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 16 Feb 2012 22:33: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: r231841 - head/sys/dev/fb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 22:33:54 -0000 Author: jkim Date: Thu Feb 16 22:33:53 2012 New Revision: 231841 URL: http://svn.freebsd.org/changeset/base/231841 Log: Properly check VESA video mode number. Modified: head/sys/dev/fb/vesa.h Modified: head/sys/dev/fb/vesa.h ============================================================================== --- head/sys/dev/fb/vesa.h Thu Feb 16 22:28:17 2012 (r231840) +++ head/sys/dev/fb/vesa.h Thu Feb 16 22:33:53 2012 (r231841) @@ -126,7 +126,7 @@ struct vesa_mode #ifdef _KERNEL -#define VESA_MODE(x) ((x) >= M_VESA_BASE) +#define VESA_MODE(x) ((x) >= M_VESA_BASE && (x) <= M_VESA_MODE_MAX) int vesa_load_ioctl(void); int vesa_unload_ioctl(void); From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 22:46:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E493A106566C; Thu, 16 Feb 2012 22:46:00 +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 D42D18FC0C; Thu, 16 Feb 2012 22:46:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GMk0rV037941; Thu, 16 Feb 2012 22:46:00 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GMk0YA037939; Thu, 16 Feb 2012 22:46:00 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202162246.q1GMk0YA037939@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 16 Feb 2012 22:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231842 - head/sys/dev/fb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 22:46:01 -0000 Author: jkim Date: Thu Feb 16 22:46:00 2012 New Revision: 231842 URL: http://svn.freebsd.org/changeset/base/231842 Log: Make sure the VESA mode number is between 256 and 511 inclusive. Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Thu Feb 16 22:33:53 2012 (r231841) +++ head/sys/dev/fb/vesa.c Thu Feb 16 22:46:00 2012 (r231842) @@ -1311,7 +1311,9 @@ vesa_set_mode(video_adapter_t *adp, int if (!(info.vi_flags & V_INFO_GRAPHICS)) info.vi_flags &= ~V_INFO_LINEAR; - if (vesa_bios_set_mode(mode | ((info.vi_flags & V_INFO_LINEAR) ? 0x4000 : 0))) + if ((info.vi_flags & V_INFO_LINEAR) != 0) + mode |= 0x4000; + if (vesa_bios_set_mode(mode)) return (1); /* Palette format is reset by the above VBE function call. */ @@ -1329,7 +1331,7 @@ vesa_set_mode(video_adapter_t *adp, int #if VESA_DEBUG > 0 printf("VESA: mode set!\n"); #endif - vesa_adp->va_mode = mode; + vesa_adp->va_mode = mode & 0x1ff; /* Mode number is 9-bit. */ vesa_adp->va_flags &= ~V_ADP_COLOR; vesa_adp->va_flags |= (info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0; From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 22:51:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0212106566C; Thu, 16 Feb 2012 22:51:44 +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 CF9E98FC19; Thu, 16 Feb 2012 22:51:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GMpix1038160; Thu, 16 Feb 2012 22:51:44 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GMpiqs038158; Thu, 16 Feb 2012 22:51:44 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202162251.q1GMpiqs038158@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 16 Feb 2012 22:51: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: r231843 - head/sys/dev/fb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 22:51:45 -0000 Author: jkim Date: Thu Feb 16 22:51:44 2012 New Revision: 231843 URL: http://svn.freebsd.org/changeset/base/231843 Log: Set the initial mode for the adapter after executing VESA BIOS POST. There is no need to set initial mode for BIOS. Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Thu Feb 16 22:46:00 2012 (r231842) +++ head/sys/dev/fb/vesa.c Thu Feb 16 22:51:44 2012 (r231843) @@ -1469,6 +1469,7 @@ vesa_save_state(video_adapter_t *adp, vo static int vesa_load_state(video_adapter_t *adp, void *p) { + int mode; if ((adp != vesa_adp) || (((adp_state_t *)p)->sig != V_STATE_SIG)) return ((*prevvidsw->load_state)(adp, p)); @@ -1478,8 +1479,10 @@ vesa_load_state(video_adapter_t *adp, vo /* Try BIOS POST to restore a sane state. */ (void)vesa_bios_post(); - (void)int10_set_mode(adp->va_initial_bios_mode); - (void)vesa_set_mode(adp, adp->va_mode); + mode = adp->va_mode; + (void)vesa_set_mode(adp, adp->va_initial_mode); + if (mode != adp->va_initial_mode); + (void)vesa_set_mode(adp, mode); return (vesa_bios_save_restore(STATE_LOAD, ((adp_state_t *)p)->regs)); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 22:59:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 468E7106564A; Thu, 16 Feb 2012 22:59:30 +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 31CEF8FC0C; Thu, 16 Feb 2012 22:59:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GMxUY1038464; Thu, 16 Feb 2012 22:59:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GMxT4j038444; Thu, 16 Feb 2012 22:59:29 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202162259.q1GMxT4j038444@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 16 Feb 2012 22:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231844 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/co... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 22:59:30 -0000 Author: jkim Date: Thu Feb 16 22:59:29 2012 New Revision: 231844 URL: http://svn.freebsd.org/changeset/base/231844 Log: Merge ACPICA 20120215. Added: head/sys/contrib/dev/acpica/components/ - copied from r231827, head/sys/contrib/dev/acpica/debugger/ - copied from r231827, head/sys/contrib/dev/acpica/disassembler/ - copied from r231827, head/sys/contrib/dev/acpica/dispatcher/ - copied from r231827, head/sys/contrib/dev/acpica/events/ - copied from r231827, head/sys/contrib/dev/acpica/executer/ - copied from r231827, head/sys/contrib/dev/acpica/hardware/ head/sys/contrib/dev/acpica/components/hardware/hwesleep.c - copied, changed from r231801, vendor-sys/acpica/dist/source/components/hardware/hwesleep.c head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c - copied, changed from r231801, vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c - copied from r231827, head/sys/contrib/dev/acpica/namespace/ - copied from r231827, head/sys/contrib/dev/acpica/parser/ - copied from r231827, head/sys/contrib/dev/acpica/resources/ - copied from r231827, head/sys/contrib/dev/acpica/tables/ - copied from r231827, head/sys/contrib/dev/acpica/utilities/ Directory Properties: head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/disassembler/ (props changed) head/sys/contrib/dev/acpica/components/dispatcher/ (props changed) head/sys/contrib/dev/acpica/components/events/ (props changed) head/sys/contrib/dev/acpica/components/executer/ (props changed) head/sys/contrib/dev/acpica/components/hardware/ (props changed) head/sys/contrib/dev/acpica/components/namespace/ (props changed) head/sys/contrib/dev/acpica/components/parser/ (props changed) head/sys/contrib/dev/acpica/components/resources/ (props changed) head/sys/contrib/dev/acpica/components/tables/ (props changed) head/sys/contrib/dev/acpica/components/utilities/ (props changed) Deleted: head/sys/contrib/dev/acpica/debugger/ head/sys/contrib/dev/acpica/disassembler/ head/sys/contrib/dev/acpica/dispatcher/ head/sys/contrib/dev/acpica/events/ head/sys/contrib/dev/acpica/executer/ head/sys/contrib/dev/acpica/hardware/ head/sys/contrib/dev/acpica/namespace/ head/sys/contrib/dev/acpica/parser/ head/sys/contrib/dev/acpica/resources/ head/sys/contrib/dev/acpica/tables/ head/sys/contrib/dev/acpica/utilities/ Modified: head/sys/conf/files head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt (contents, props changed) head/sys/contrib/dev/acpica/compiler/aslrestype2s.c head/sys/contrib/dev/acpica/compiler/aslstubs.c head/sys/contrib/dev/acpica/components/debugger/dbcmds.c head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c head/sys/contrib/dev/acpica/components/events/evevent.c head/sys/contrib/dev/acpica/components/events/evglock.c head/sys/contrib/dev/acpica/components/events/evgpe.c head/sys/contrib/dev/acpica/components/events/evgpeblk.c head/sys/contrib/dev/acpica/components/events/evgpeinit.c head/sys/contrib/dev/acpica/components/events/evgpeutil.c head/sys/contrib/dev/acpica/components/events/evmisc.c head/sys/contrib/dev/acpica/components/events/evsci.c head/sys/contrib/dev/acpica/components/events/evxface.c head/sys/contrib/dev/acpica/components/events/evxfevnt.c head/sys/contrib/dev/acpica/components/events/evxfgpe.c head/sys/contrib/dev/acpica/components/executer/exfldio.c head/sys/contrib/dev/acpica/components/hardware/hwacpi.c head/sys/contrib/dev/acpica/components/hardware/hwgpe.c head/sys/contrib/dev/acpica/components/hardware/hwregs.c head/sys/contrib/dev/acpica/components/hardware/hwsleep.c head/sys/contrib/dev/acpica/components/hardware/hwtimer.c head/sys/contrib/dev/acpica/components/hardware/hwxface.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/components/utilities/utdecode.c head/sys/contrib/dev/acpica/components/utilities/utglobal.c head/sys/contrib/dev/acpica/components/utilities/utinit.c head/sys/contrib/dev/acpica/components/utilities/utxface.c head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acevents.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/achware.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actables.h head/sys/contrib/dev/acpica/include/actbl.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c head/sys/dev/acpica/Osd/OsdMemory.c head/sys/dev/acpica/Osd/OsdTable.c head/sys/dev/acpica/acpi.c head/sys/modules/acpi/acpi/Makefile head/usr.sbin/acpi/Makefile.inc head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/common/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) head/sys/contrib/dev/acpica/os_specific/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Feb 16 22:51:44 2012 (r231843) +++ head/sys/conf/files Thu Feb 16 22:59:29 2012 (r231844) @@ -153,155 +153,157 @@ contrib/altq/altq/altq_rio.c optional al contrib/altq/altq/altq_rmclass.c optional altq contrib/altq/altq/altq_subr.c optional altq \ compile-with "${NORMAL_C} -I$S/contrib/pf" -contrib/dev/acpica/debugger/dbcmds.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbdisply.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbexec.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbfileio.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbhistry.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbinput.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbmethod.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbnames.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbstats.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbutils.c optional acpi acpi_debug -contrib/dev/acpica/debugger/dbxface.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmbuffer.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmnames.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmopcode.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmobject.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmresrc.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmresrcl.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmresrcl2.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmresrcs.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmutils.c optional acpi acpi_debug -contrib/dev/acpica/disassembler/dmwalk.c optional acpi acpi_debug -contrib/dev/acpica/dispatcher/dsargs.c optional acpi -contrib/dev/acpica/dispatcher/dscontrol.c optional acpi -contrib/dev/acpica/dispatcher/dsfield.c optional acpi -contrib/dev/acpica/dispatcher/dsinit.c optional acpi -contrib/dev/acpica/dispatcher/dsmethod.c optional acpi -contrib/dev/acpica/dispatcher/dsmthdat.c optional acpi -contrib/dev/acpica/dispatcher/dsobject.c optional acpi -contrib/dev/acpica/dispatcher/dsopcode.c optional acpi -contrib/dev/acpica/dispatcher/dsutils.c optional acpi -contrib/dev/acpica/dispatcher/dswexec.c optional acpi -contrib/dev/acpica/dispatcher/dswload.c optional acpi -contrib/dev/acpica/dispatcher/dswload2.c optional acpi -contrib/dev/acpica/dispatcher/dswscope.c optional acpi -contrib/dev/acpica/dispatcher/dswstate.c optional acpi -contrib/dev/acpica/events/evevent.c optional acpi -contrib/dev/acpica/events/evglock.c optional acpi -contrib/dev/acpica/events/evgpe.c optional acpi -contrib/dev/acpica/events/evgpeblk.c optional acpi -contrib/dev/acpica/events/evgpeinit.c optional acpi -contrib/dev/acpica/events/evgpeutil.c optional acpi -contrib/dev/acpica/events/evmisc.c optional acpi -contrib/dev/acpica/events/evregion.c optional acpi -contrib/dev/acpica/events/evrgnini.c optional acpi -contrib/dev/acpica/events/evsci.c optional acpi -contrib/dev/acpica/events/evxface.c optional acpi -contrib/dev/acpica/events/evxfevnt.c optional acpi -contrib/dev/acpica/events/evxfgpe.c optional acpi -contrib/dev/acpica/events/evxfregn.c optional acpi -contrib/dev/acpica/executer/exconfig.c optional acpi -contrib/dev/acpica/executer/exconvrt.c optional acpi -contrib/dev/acpica/executer/excreate.c optional acpi -contrib/dev/acpica/executer/exdebug.c optional acpi -contrib/dev/acpica/executer/exdump.c optional acpi -contrib/dev/acpica/executer/exfield.c optional acpi -contrib/dev/acpica/executer/exfldio.c optional acpi -contrib/dev/acpica/executer/exmisc.c optional acpi -contrib/dev/acpica/executer/exmutex.c optional acpi -contrib/dev/acpica/executer/exnames.c optional acpi -contrib/dev/acpica/executer/exoparg1.c optional acpi -contrib/dev/acpica/executer/exoparg2.c optional acpi -contrib/dev/acpica/executer/exoparg3.c optional acpi -contrib/dev/acpica/executer/exoparg6.c optional acpi -contrib/dev/acpica/executer/exprep.c optional acpi -contrib/dev/acpica/executer/exregion.c optional acpi -contrib/dev/acpica/executer/exresnte.c optional acpi -contrib/dev/acpica/executer/exresolv.c optional acpi -contrib/dev/acpica/executer/exresop.c optional acpi -contrib/dev/acpica/executer/exstore.c optional acpi -contrib/dev/acpica/executer/exstoren.c optional acpi -contrib/dev/acpica/executer/exstorob.c optional acpi -contrib/dev/acpica/executer/exsystem.c optional acpi -contrib/dev/acpica/executer/exutils.c optional acpi -contrib/dev/acpica/hardware/hwacpi.c optional acpi -contrib/dev/acpica/hardware/hwgpe.c optional acpi -contrib/dev/acpica/hardware/hwpci.c optional acpi -contrib/dev/acpica/hardware/hwregs.c optional acpi -contrib/dev/acpica/hardware/hwsleep.c optional acpi -contrib/dev/acpica/hardware/hwtimer.c optional acpi -contrib/dev/acpica/hardware/hwvalid.c optional acpi -contrib/dev/acpica/hardware/hwxface.c optional acpi -contrib/dev/acpica/namespace/nsaccess.c optional acpi -contrib/dev/acpica/namespace/nsalloc.c optional acpi -contrib/dev/acpica/namespace/nsdump.c optional acpi -contrib/dev/acpica/namespace/nseval.c optional acpi -contrib/dev/acpica/namespace/nsinit.c optional acpi -contrib/dev/acpica/namespace/nsload.c optional acpi -contrib/dev/acpica/namespace/nsnames.c optional acpi -contrib/dev/acpica/namespace/nsobject.c optional acpi -contrib/dev/acpica/namespace/nsparse.c optional acpi -contrib/dev/acpica/namespace/nspredef.c optional acpi -contrib/dev/acpica/namespace/nsrepair.c optional acpi -contrib/dev/acpica/namespace/nsrepair2.c optional acpi -contrib/dev/acpica/namespace/nssearch.c optional acpi -contrib/dev/acpica/namespace/nsutils.c optional acpi -contrib/dev/acpica/namespace/nswalk.c optional acpi -contrib/dev/acpica/namespace/nsxfeval.c optional acpi -contrib/dev/acpica/namespace/nsxfname.c optional acpi -contrib/dev/acpica/namespace/nsxfobj.c optional acpi -contrib/dev/acpica/parser/psargs.c optional acpi -contrib/dev/acpica/parser/psloop.c optional acpi -contrib/dev/acpica/parser/psopcode.c optional acpi -contrib/dev/acpica/parser/psparse.c optional acpi -contrib/dev/acpica/parser/psscope.c optional acpi -contrib/dev/acpica/parser/pstree.c optional acpi -contrib/dev/acpica/parser/psutils.c optional acpi -contrib/dev/acpica/parser/pswalk.c optional acpi -contrib/dev/acpica/parser/psxface.c optional acpi -contrib/dev/acpica/resources/rsaddr.c optional acpi -contrib/dev/acpica/resources/rscalc.c optional acpi -contrib/dev/acpica/resources/rscreate.c optional acpi -contrib/dev/acpica/resources/rsdump.c optional acpi -contrib/dev/acpica/resources/rsinfo.c optional acpi -contrib/dev/acpica/resources/rsio.c optional acpi -contrib/dev/acpica/resources/rsirq.c optional acpi -contrib/dev/acpica/resources/rslist.c optional acpi -contrib/dev/acpica/resources/rsmemory.c optional acpi -contrib/dev/acpica/resources/rsmisc.c optional acpi -contrib/dev/acpica/resources/rsserial.c optional acpi -contrib/dev/acpica/resources/rsutils.c optional acpi -contrib/dev/acpica/resources/rsxface.c optional acpi -contrib/dev/acpica/tables/tbfadt.c optional acpi -contrib/dev/acpica/tables/tbfind.c optional acpi -contrib/dev/acpica/tables/tbinstal.c optional acpi -contrib/dev/acpica/tables/tbutils.c optional acpi -contrib/dev/acpica/tables/tbxface.c optional acpi -contrib/dev/acpica/tables/tbxfroot.c optional acpi -contrib/dev/acpica/utilities/utaddress.c optional acpi -contrib/dev/acpica/utilities/utalloc.c optional acpi -contrib/dev/acpica/utilities/utcache.c optional acpi -contrib/dev/acpica/utilities/utcopy.c optional acpi -contrib/dev/acpica/utilities/utdebug.c optional acpi -contrib/dev/acpica/utilities/utdecode.c optional acpi -contrib/dev/acpica/utilities/utdelete.c optional acpi -contrib/dev/acpica/utilities/uteval.c optional acpi -contrib/dev/acpica/utilities/utglobal.c optional acpi -contrib/dev/acpica/utilities/utids.c optional acpi -contrib/dev/acpica/utilities/utinit.c optional acpi -contrib/dev/acpica/utilities/utlock.c optional acpi -contrib/dev/acpica/utilities/utmath.c optional acpi -contrib/dev/acpica/utilities/utmisc.c optional acpi -contrib/dev/acpica/utilities/utmutex.c optional acpi -contrib/dev/acpica/utilities/utobject.c optional acpi -contrib/dev/acpica/utilities/utosi.c optional acpi -contrib/dev/acpica/utilities/utresrc.c optional acpi -contrib/dev/acpica/utilities/utstate.c optional acpi -contrib/dev/acpica/utilities/utxface.c optional acpi -contrib/dev/acpica/utilities/utxferror.c optional acpi -#contrib/dev/acpica/utilities/utxfmutex.c optional acpi +contrib/dev/acpica/components/debugger/dbcmds.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbdisply.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbexec.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbfileio.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbhistry.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbinput.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbmethod.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbnames.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbstats.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbutils.c optional acpi acpi_debug +contrib/dev/acpica/components/debugger/dbxface.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmbuffer.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmnames.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmopcode.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmobject.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmresrc.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmresrcl.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmresrcl2.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmresrcs.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmutils.c optional acpi acpi_debug +contrib/dev/acpica/components/disassembler/dmwalk.c optional acpi acpi_debug +contrib/dev/acpica/components/dispatcher/dsargs.c optional acpi +contrib/dev/acpica/components/dispatcher/dscontrol.c optional acpi +contrib/dev/acpica/components/dispatcher/dsfield.c optional acpi +contrib/dev/acpica/components/dispatcher/dsinit.c optional acpi +contrib/dev/acpica/components/dispatcher/dsmethod.c optional acpi +contrib/dev/acpica/components/dispatcher/dsmthdat.c optional acpi +contrib/dev/acpica/components/dispatcher/dsobject.c optional acpi +contrib/dev/acpica/components/dispatcher/dsopcode.c optional acpi +contrib/dev/acpica/components/dispatcher/dsutils.c optional acpi +contrib/dev/acpica/components/dispatcher/dswexec.c optional acpi +contrib/dev/acpica/components/dispatcher/dswload.c optional acpi +contrib/dev/acpica/components/dispatcher/dswload2.c optional acpi +contrib/dev/acpica/components/dispatcher/dswscope.c optional acpi +contrib/dev/acpica/components/dispatcher/dswstate.c optional acpi +contrib/dev/acpica/components/events/evevent.c optional acpi +contrib/dev/acpica/components/events/evglock.c optional acpi +contrib/dev/acpica/components/events/evgpe.c optional acpi +contrib/dev/acpica/components/events/evgpeblk.c optional acpi +contrib/dev/acpica/components/events/evgpeinit.c optional acpi +contrib/dev/acpica/components/events/evgpeutil.c optional acpi +contrib/dev/acpica/components/events/evmisc.c optional acpi +contrib/dev/acpica/components/events/evregion.c optional acpi +contrib/dev/acpica/components/events/evrgnini.c optional acpi +contrib/dev/acpica/components/events/evsci.c optional acpi +contrib/dev/acpica/components/events/evxface.c optional acpi +contrib/dev/acpica/components/events/evxfevnt.c optional acpi +contrib/dev/acpica/components/events/evxfgpe.c optional acpi +contrib/dev/acpica/components/events/evxfregn.c optional acpi +contrib/dev/acpica/components/executer/exconfig.c optional acpi +contrib/dev/acpica/components/executer/exconvrt.c optional acpi +contrib/dev/acpica/components/executer/excreate.c optional acpi +contrib/dev/acpica/components/executer/exdebug.c optional acpi +contrib/dev/acpica/components/executer/exdump.c optional acpi +contrib/dev/acpica/components/executer/exfield.c optional acpi +contrib/dev/acpica/components/executer/exfldio.c optional acpi +contrib/dev/acpica/components/executer/exmisc.c optional acpi +contrib/dev/acpica/components/executer/exmutex.c optional acpi +contrib/dev/acpica/components/executer/exnames.c optional acpi +contrib/dev/acpica/components/executer/exoparg1.c optional acpi +contrib/dev/acpica/components/executer/exoparg2.c optional acpi +contrib/dev/acpica/components/executer/exoparg3.c optional acpi +contrib/dev/acpica/components/executer/exoparg6.c optional acpi +contrib/dev/acpica/components/executer/exprep.c optional acpi +contrib/dev/acpica/components/executer/exregion.c optional acpi +contrib/dev/acpica/components/executer/exresnte.c optional acpi +contrib/dev/acpica/components/executer/exresolv.c optional acpi +contrib/dev/acpica/components/executer/exresop.c optional acpi +contrib/dev/acpica/components/executer/exstore.c optional acpi +contrib/dev/acpica/components/executer/exstoren.c optional acpi +contrib/dev/acpica/components/executer/exstorob.c optional acpi +contrib/dev/acpica/components/executer/exsystem.c optional acpi +contrib/dev/acpica/components/executer/exutils.c optional acpi +contrib/dev/acpica/components/hardware/hwacpi.c optional acpi +contrib/dev/acpica/components/hardware/hwesleep.c optional acpi +contrib/dev/acpica/components/hardware/hwgpe.c optional acpi +contrib/dev/acpica/components/hardware/hwpci.c optional acpi +contrib/dev/acpica/components/hardware/hwregs.c optional acpi +contrib/dev/acpica/components/hardware/hwsleep.c optional acpi +contrib/dev/acpica/components/hardware/hwtimer.c optional acpi +contrib/dev/acpica/components/hardware/hwvalid.c optional acpi +contrib/dev/acpica/components/hardware/hwxface.c optional acpi +contrib/dev/acpica/components/hardware/hwxfsleep.c optional acpi +contrib/dev/acpica/components/namespace/nsaccess.c optional acpi +contrib/dev/acpica/components/namespace/nsalloc.c optional acpi +contrib/dev/acpica/components/namespace/nsdump.c optional acpi +contrib/dev/acpica/components/namespace/nseval.c optional acpi +contrib/dev/acpica/components/namespace/nsinit.c optional acpi +contrib/dev/acpica/components/namespace/nsload.c optional acpi +contrib/dev/acpica/components/namespace/nsnames.c optional acpi +contrib/dev/acpica/components/namespace/nsobject.c optional acpi +contrib/dev/acpica/components/namespace/nsparse.c optional acpi +contrib/dev/acpica/components/namespace/nspredef.c optional acpi +contrib/dev/acpica/components/namespace/nsrepair.c optional acpi +contrib/dev/acpica/components/namespace/nsrepair2.c optional acpi +contrib/dev/acpica/components/namespace/nssearch.c optional acpi +contrib/dev/acpica/components/namespace/nsutils.c optional acpi +contrib/dev/acpica/components/namespace/nswalk.c optional acpi +contrib/dev/acpica/components/namespace/nsxfeval.c optional acpi +contrib/dev/acpica/components/namespace/nsxfname.c optional acpi +contrib/dev/acpica/components/namespace/nsxfobj.c optional acpi +contrib/dev/acpica/components/parser/psargs.c optional acpi +contrib/dev/acpica/components/parser/psloop.c optional acpi +contrib/dev/acpica/components/parser/psopcode.c optional acpi +contrib/dev/acpica/components/parser/psparse.c optional acpi +contrib/dev/acpica/components/parser/psscope.c optional acpi +contrib/dev/acpica/components/parser/pstree.c optional acpi +contrib/dev/acpica/components/parser/psutils.c optional acpi +contrib/dev/acpica/components/parser/pswalk.c optional acpi +contrib/dev/acpica/components/parser/psxface.c optional acpi +contrib/dev/acpica/components/resources/rsaddr.c optional acpi +contrib/dev/acpica/components/resources/rscalc.c optional acpi +contrib/dev/acpica/components/resources/rscreate.c optional acpi +contrib/dev/acpica/components/resources/rsdump.c optional acpi +contrib/dev/acpica/components/resources/rsinfo.c optional acpi +contrib/dev/acpica/components/resources/rsio.c optional acpi +contrib/dev/acpica/components/resources/rsirq.c optional acpi +contrib/dev/acpica/components/resources/rslist.c optional acpi +contrib/dev/acpica/components/resources/rsmemory.c optional acpi +contrib/dev/acpica/components/resources/rsmisc.c optional acpi +contrib/dev/acpica/components/resources/rsserial.c optional acpi +contrib/dev/acpica/components/resources/rsutils.c optional acpi +contrib/dev/acpica/components/resources/rsxface.c optional acpi +contrib/dev/acpica/components/tables/tbfadt.c optional acpi +contrib/dev/acpica/components/tables/tbfind.c optional acpi +contrib/dev/acpica/components/tables/tbinstal.c optional acpi +contrib/dev/acpica/components/tables/tbutils.c optional acpi +contrib/dev/acpica/components/tables/tbxface.c optional acpi +contrib/dev/acpica/components/tables/tbxfroot.c optional acpi +contrib/dev/acpica/components/utilities/utaddress.c optional acpi +contrib/dev/acpica/components/utilities/utalloc.c optional acpi +contrib/dev/acpica/components/utilities/utcache.c optional acpi +contrib/dev/acpica/components/utilities/utcopy.c optional acpi +contrib/dev/acpica/components/utilities/utdebug.c optional acpi +contrib/dev/acpica/components/utilities/utdecode.c optional acpi +contrib/dev/acpica/components/utilities/utdelete.c optional acpi +contrib/dev/acpica/components/utilities/uteval.c optional acpi +contrib/dev/acpica/components/utilities/utglobal.c optional acpi +contrib/dev/acpica/components/utilities/utids.c optional acpi +contrib/dev/acpica/components/utilities/utinit.c optional acpi +contrib/dev/acpica/components/utilities/utlock.c optional acpi +contrib/dev/acpica/components/utilities/utmath.c optional acpi +contrib/dev/acpica/components/utilities/utmisc.c optional acpi +contrib/dev/acpica/components/utilities/utmutex.c optional acpi +contrib/dev/acpica/components/utilities/utobject.c optional acpi +contrib/dev/acpica/components/utilities/utosi.c optional acpi +contrib/dev/acpica/components/utilities/utresrc.c optional acpi +contrib/dev/acpica/components/utilities/utstate.c optional acpi +contrib/dev/acpica/components/utilities/utxface.c optional acpi +contrib/dev/acpica/components/utilities/utxferror.c optional acpi +#contrib/dev/acpica/components/utilities/utxfmutex.c optional acpi contrib/ipfilter/netinet/fil.c optional ipfilter inet \ compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_auth.c optional ipfilter inet \ Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Thu Feb 16 22:51:44 2012 (r231843) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Thu Feb 16 22:59:29 2012 (r231844) @@ -14,12 +14,10 @@ wrk=`realpath ./_acpi_ca_unpack` dst=`realpath ./acpi_ca_destination` # files that should keep their full directory path -fulldirs="common compiler debugger disassembler dispatcher events \ - executer hardware include namespace os_specific parser \ - resources tables utilities" +fulldirs="common compiler components include os_specific" # files to remove -stripdirs="generate tests tools" +stripdirs="generate libraries tests tools" stripfiles="Makefile README acintel.h aclinux.h acmsvc.h acnetbsd.h \ acos2.h accygwin.h acefi.h acwin.h acwin64.h osunixdir.c \ oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c" Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Thu Feb 16 22:51:44 2012 (r231843) +++ head/sys/contrib/dev/acpica/changes.txt Thu Feb 16 22:59:29 2012 (r231844) @@ -1,4 +1,96 @@ ---------------------------------------- +15 February 2012. Summary of changes for version 20120215: + +This release is available at www.acpica.org/downloads. +The ACPI 5.0 specification is available at www.acpi.info. + +1) ACPICA Core Subsystem: + +There have been some major changes to the sleep/wake support code, as +described below (a - e). + +a) The AcpiLeaveSleepState has been split into two interfaces, similar to +AcpiEnterSleepStatePrep and AcpiEnterSleepState. The new interface is +AcpiLeaveSleepStatePrep. This allows the host to perform actions between the +time the _BFS method is called and the _WAK method is called. NOTE: all hosts +must update their wake/resume code or else sleep/wake will not work properly. +Rafael Wysocki. + +b) In AcpiLeaveSleepState, now enable all runtime GPEs before calling the _WAK +method. Some machines require that the GPEs are enabled before the _WAK method +is executed. Thomas Renninger. + +c) In AcpiLeaveSleepState, now always clear the WAK_STS (wake status) bit. +Some BIOS code assumes that WAK_STS will be cleared on resume and use it to +determine whether the system is rebooting or resuming. Matthew Garrett. + +d) Move the invocations of _GTS (Going To Sleep) and _BFS (Back From Sleep) to +match the ACPI specification requirement. Rafael Wysocki. + +e) Implemented full support for the ACPI 5.0 SleepStatus and SleepControl +registers within the V5 FADT. This support adds two new files: +hardware/hwesleep.c implements the support for the new registers. Moved all +sleep/wake external interfaces to hardware/hwxfsleep.c. + + +Added a new OSL interface for ACPI table overrides, +AcpiOsPhysicalTableOverride. This interface allows the host to override a +table via a physical address, instead of the logical address required by +AcpiOsTableOverride. This simplifies the host implementation. Initial +implementation by Thomas Renninger. The ACPICA implementation creates a single +shared function for table overrides that attempts both a logical and a +physical override. + +Expanded the OSL memory read/write interfaces to 64-bit data +(AcpiOsReadMemory, AcpiOsWriteMemory.) This enables full 64-bit memory +transfer support for GAS register structures passed to AcpiRead and AcpiWrite. + +Implemented the ACPI_REDUCED_HARDWARE option to allow the creation of a custom +build of ACPICA that supports only the ACPI 5.0 reduced hardware (SoC) model. +See the ACPICA reference for details. ACPICA BZ 942. This option removes about +10% of the code and 5% of the static data, and the following hardware ACPI +features become unavailable: + PM Event and Control registers + SCI interrupt (and handler) + Fixed Events + General Purpose Events (GPEs) + Global Lock + ACPI PM timer + FACS table (Waking vectors and Global Lock) + +Updated the unix tarball directory structure to match the ACPICA git source +tree. This ensures that the generic unix makefiles work properly (in +generate/unix). Also updated the Linux makefiles to match. ACPICA BZ 867. + +Updated the return value of the _REV predefined method to integer value 5 to +reflect ACPI 5.0 support. + +Moved the external ACPI PM timer interface prototypes to the public acpixf.h +file where they belong. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug +version of the code includes the debug output trace mechanism and has a much +larger code and data size. + + Previous Release: + Non-Debug Version: 92.8K Code, 24.9K Data, 117.7K Total + Debug Version: 171.7K Code, 72.9K Data, 244.5K Total + Current Release: + Non-Debug Version: 93.0K Code, 25.0K Data, 118.0K Total + Debug Version: 172.5K Code, 73.2K Data, 245.7K Total + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Fixed a problem with the new ACPI 5.0 serial resource +descriptors (I2C, SPI, UART) where the resource produce/consumer bit was +incorrectly displayed. + +AcpiHelp: Add display of ACPI/PNP device IDs that are defined in the ACPI +specification. + +---------------------------------------- 11 January 2012. Summary of changes for version 20120111: This release is available at www.acpica.org/downloads. Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2s.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2s.c Thu Feb 16 22:51:44 2012 (r231843) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2s.c Thu Feb 16 22:59:29 2012 (r231844) @@ -192,7 +192,7 @@ RsGetVendorData ( UINT16 ActualLength = 0; - /* VendorData field is always optional */ + /* Vendor Data field is always optional */ if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG) { @@ -374,7 +374,7 @@ RsDoGpioIntDescriptor ( CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.PinConfig)); break; - case 4: /* DebounceTimeout [WORD] (_DBT) */ + case 4: /* Debounce Timeout [WORD] (_DBT) */ Descriptor->Gpio.DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer; RsCreateWordField (InitializerOp, ACPI_RESTAG_DEBOUNCETIME, @@ -405,7 +405,7 @@ RsDoGpioIntDescriptor ( RsSetFlagBits16 (&Descriptor->Gpio.Flags, InitializerOp, 0, 1); break; - case 8: /* ResourceTag (Descriptor Name) */ + case 8: /* Resource Tag (Descriptor Name) */ UtAttachNamepathToOwner (Op, InitializerOp); break; @@ -566,7 +566,7 @@ RsDoGpioIoDescriptor ( CurrentByteOffset + ASL_RESDESC_OFFSET (Gpio.PinConfig)); break; - case 2: /* DebounceTimeout [WORD] (_DBT) */ + case 2: /* Debounce Timeout [WORD] (_DBT) */ Descriptor->Gpio.DebounceTimeout = (UINT16) InitializerOp->Asl.Value.Integer; RsCreateWordField (InitializerOp, ACPI_RESTAG_DEBOUNCETIME, @@ -611,7 +611,7 @@ RsDoGpioIoDescriptor ( RsSetFlagBits16 (&Descriptor->Gpio.Flags, InitializerOp, 0, 1); break; - case 8: /* ResourceTag (Descriptor Name) */ + case 8: /* Resource Tag (Descriptor Name) */ UtAttachNamepathToOwner (Op, InitializerOp); break; @@ -762,14 +762,14 @@ RsDoI2cSerialBusDescriptor ( CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.Flags), 0); break; - case 2: /* ConnectionSpeed [DWORD] (_SPE) */ + case 2: /* Connection Speed [DWORD] (_SPE) */ Descriptor->I2cSerialBus.ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer; RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED, CurrentByteOffset + ASL_RESDESC_OFFSET (I2cSerialBus.ConnectionSpeed)); break; - case 3: /* Addresssing Mode [Flag] (_MOD) */ + case 3: /* Addressing Mode [Flag] (_MOD) */ RsSetFlagBits16 (&Descriptor->I2cSerialBus.TypeSpecificFlags, InitializerOp, 0, 0); RsCreateBitField (InitializerOp, ACPI_RESTAG_MODE, @@ -800,7 +800,7 @@ RsDoI2cSerialBusDescriptor ( RsSetFlagBits (&Descriptor->I2cSerialBus.Flags, InitializerOp, 1, 1); break; - case 7: /* ResourceTag (Descriptor Name) */ + case 7: /* Resource Tag (Descriptor Name) */ UtAttachNamepathToOwner (Op, InitializerOp); break; @@ -929,7 +929,7 @@ RsDoSpiSerialBusDescriptor ( CurrentByteOffset + ASL_RESDESC_OFFSET (SpiSerialBus.Flags), 0); break; - case 5: /* ConnectionSpeed [DWORD] (_SPE) */ + case 5: /* Connection Speed [DWORD] (_SPE) */ Descriptor->SpiSerialBus.ConnectionSpeed = (UINT32) InitializerOp->Asl.Value.Integer; RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED, @@ -974,7 +974,7 @@ RsDoSpiSerialBusDescriptor ( RsSetFlagBits (&Descriptor->SpiSerialBus.Flags, InitializerOp, 1, 1); break; - case 11: /* ResourceTag (Descriptor Name) */ + case 11: /* Resource Tag (Descriptor Name) */ UtAttachNamepathToOwner (Op, InitializerOp); break; @@ -1068,7 +1068,7 @@ RsDoUartSerialBusDescriptor ( { switch (i) { - case 0: /* ConnectionSpeed (Baud Rate) [DWORD] (_SPE) */ + case 0: /* Connection Speed (Baud Rate) [DWORD] (_SPE) */ Descriptor->UartSerialBus.DefaultBaudRate = (UINT32) InitializerOp->Asl.Value.Integer; RsCreateDwordField (InitializerOp, ACPI_RESTAG_SPEED, @@ -1165,7 +1165,7 @@ RsDoUartSerialBusDescriptor ( CurrentByteOffset + ASL_RESDESC_OFFSET (UartSerialBus.Flags), 0); break; - case 12: /* ResourceTag (Descriptor Name) */ + case 12: /* Resource Tag (Descriptor Name) */ UtAttachNamepathToOwner (Op, InitializerOp); break; Modified: head/sys/contrib/dev/acpica/compiler/aslstubs.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstubs.c Thu Feb 16 22:51:44 2012 (r231843) +++ head/sys/contrib/dev/acpica/compiler/aslstubs.c Thu Feb 16 22:59:29 2012 (r231844) @@ -128,13 +128,6 @@ AcpiDsStoreObjectToLocal ( } ACPI_STATUS -AcpiEvDeleteGpeBlock ( - ACPI_GPE_BLOCK_INFO *GpeBlock) -{ - return (AE_OK); -} - -ACPI_STATUS AcpiEvQueueNotifyRequest ( ACPI_NAMESPACE_NODE *Node, UINT32 NotifyValue) @@ -149,6 +142,14 @@ AcpiEvIsNotifyObject ( return (FALSE); } +#if (!ACPI_REDUCED_HARDWARE) +ACPI_STATUS +AcpiEvDeleteGpeBlock ( + ACPI_GPE_BLOCK_INFO *GpeBlock) +{ + return (AE_OK); +} + ACPI_STATUS AcpiEvAcquireGlobalLock ( UINT16 Timeout) @@ -162,6 +163,7 @@ AcpiEvReleaseGlobalLock ( { return (AE_OK); } +#endif /* !ACPI_REDUCED_HARDWARE */ ACPI_STATUS AcpiEvInitializeRegion ( Modified: head/sys/contrib/dev/acpica/components/debugger/dbcmds.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbcmds.c Thu Feb 16 15:36:05 2012 (r231827) +++ head/sys/contrib/dev/acpica/components/debugger/dbcmds.c Thu Feb 16 22:59:29 2012 (r231844) @@ -161,28 +161,49 @@ AcpiDbSleep ( UINT8 SleepState; + ACPI_FUNCTION_TRACE (AcpiDbSleep); + + SleepState = (UINT8) ACPI_STRTOUL (ObjectArg, NULL, 0); AcpiOsPrintf ("**** Prepare to sleep ****\n"); Status = AcpiEnterSleepStatePrep (SleepState); if (ACPI_FAILURE (Status)) { - return (Status); + goto ErrorExit; } AcpiOsPrintf ("**** Going to sleep ****\n"); Status = AcpiEnterSleepState (SleepState); if (ACPI_FAILURE (Status)) { - return (Status); + goto ErrorExit; + } + + AcpiOsPrintf ("**** Prepare to return from sleep ****\n"); + Status = AcpiLeaveSleepStatePrep (SleepState); + if (ACPI_FAILURE (Status)) + { + goto ErrorExit; } - AcpiOsPrintf ("**** returning from sleep ****\n"); + AcpiOsPrintf ("**** Returning from sleep ****\n"); Status = AcpiLeaveSleepState (SleepState); + if (ACPI_FAILURE (Status)) + { + goto ErrorExit; + } + + return (Status); + +ErrorExit: + + ACPI_EXCEPTION ((AE_INFO, Status, "During sleep test")); return (Status); } + /******************************************************************************* * * FUNCTION: AcpiDbDisplayLocks @@ -1019,6 +1040,7 @@ AcpiDbDisplayResources ( } +#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiDbGenerateGpe @@ -1057,5 +1079,6 @@ AcpiDbGenerateGpe ( (void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber); } +#endif /* !ACPI_REDUCED_HARDWARE */ #endif /* ACPI_DEBUGGER */ Modified: head/sys/contrib/dev/acpica/components/debugger/dbdisply.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbdisply.c Thu Feb 16 15:36:05 2012 (r231827) +++ head/sys/contrib/dev/acpica/components/debugger/dbdisply.c Thu Feb 16 22:59:29 2012 (r231844) @@ -770,6 +770,7 @@ AcpiDbDisplayArgumentObject ( } +#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiDbDisplayGpes @@ -932,6 +933,7 @@ AcpiDbDisplayGpes ( GpeXruptInfo = GpeXruptInfo->Next; } } +#endif /* !ACPI_REDUCED_HARDWARE */ /******************************************************************************* @@ -1011,6 +1013,8 @@ AcpiDbDisplayHandlers ( } } +#if (!ACPI_REDUCED_HARDWARE) + /* Fixed event handlers */ AcpiOsPrintf ("\nFixed Event Handlers:\n"); @@ -1029,6 +1033,8 @@ AcpiDbDisplayHandlers ( } } +#endif /* !ACPI_REDUCED_HARDWARE */ + /* Miscellaneous global handlers */ AcpiOsPrintf ("\nMiscellaneous Global Handlers:\n"); Modified: head/sys/contrib/dev/acpica/components/debugger/dbinput.c ============================================================================== --- head/sys/contrib/dev/acpica/debugger/dbinput.c Thu Feb 16 15:36:05 2012 (r231827) +++ head/sys/contrib/dev/acpica/components/debugger/dbinput.c Thu Feb 16 22:59:29 2012 (r231844) @@ -662,12 +662,15 @@ AcpiDbCommandDispatch ( break; case CMD_ENABLEACPI: +#if (!ACPI_REDUCED_HARDWARE) + Status = AcpiEnable(); if (ACPI_FAILURE(Status)) { AcpiOsPrintf("AcpiEnable failed (Status=%X)\n", Status); return (Status); } +#endif /* !ACPI_REDUCED_HARDWARE */ break; case CMD_EVENT: Modified: head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c ============================================================================== --- head/sys/contrib/dev/acpica/disassembler/dmresrcl2.c Thu Feb 16 15:36:05 2012 (r231827) +++ head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c Thu Feb 16 22:59:29 2012 (r231844) @@ -503,7 +503,7 @@ AcpiDmI2cSerialBusDescriptor ( AcpiOsPrintf ("0x%2.2X, ", Resource->I2cSerialBus.ResSourceIndex); AcpiOsPrintf ("%s, ", - AcpiGbl_ConsumeDecode [(Resource->I2cSerialBus.Flags & 1)]); + AcpiGbl_ConsumeDecode [(Resource->I2cSerialBus.Flags >> 1) & 1]); /* Insert a descriptor name */ @@ -578,7 +578,7 @@ AcpiDmSpiSerialBusDescriptor ( AcpiOsPrintf ("0x%2.2X, ", Resource->SpiSerialBus.ResSourceIndex); AcpiOsPrintf ("%s, ", - AcpiGbl_ConsumeDecode [(Resource->SpiSerialBus.Flags & 1)]); + AcpiGbl_ConsumeDecode [(Resource->SpiSerialBus.Flags >> 1) & 1]); /* Insert a descriptor name */ @@ -656,7 +656,7 @@ AcpiDmUartSerialBusDescriptor ( AcpiOsPrintf ("0x%2.2X, ", Resource->UartSerialBus.ResSourceIndex); AcpiOsPrintf ("%s, ", - AcpiGbl_ConsumeDecode [(Resource->UartSerialBus.Flags & 1)]); + AcpiGbl_ConsumeDecode [(Resource->UartSerialBus.Flags >> 1) & 1]); /* Insert a descriptor name */ Modified: head/sys/contrib/dev/acpica/components/events/evevent.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evevent.c Thu Feb 16 15:36:05 2012 (r231827) +++ head/sys/contrib/dev/acpica/components/events/evevent.c Thu Feb 16 22:59:29 2012 (r231844) @@ -48,6 +48,8 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evevent") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static ACPI_STATUS @@ -329,4 +331,6 @@ AcpiEvFixedEventDispatch ( AcpiGbl_FixedEventHandlers[Event].Context)); } +#endif /* !ACPI_REDUCED_HARDWARE */ + Modified: head/sys/contrib/dev/acpica/components/events/evglock.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evglock.c Thu Feb 16 15:36:05 2012 (r231827) +++ head/sys/contrib/dev/acpica/components/events/evglock.c Thu Feb 16 22:59:29 2012 (r231844) @@ -49,6 +49,7 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evglock") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /* Local prototypes */ @@ -372,3 +373,5 @@ AcpiEvReleaseGlobalLock ( AcpiOsReleaseMutex (AcpiGbl_GlobalLockMutex->Mutex.OsMutex); return_ACPI_STATUS (Status); } + +#endif /* !ACPI_REDUCED_HARDWARE */ Modified: head/sys/contrib/dev/acpica/components/events/evgpe.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evgpe.c Thu Feb 16 15:36:05 2012 (r231827) +++ head/sys/contrib/dev/acpica/components/events/evgpe.c Thu Feb 16 22:59:29 2012 (r231844) @@ -49,6 +49,8 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evgpe") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static void ACPI_SYSTEM_XFACE @@ -826,3 +828,4 @@ AcpiEvGpeDispatch ( return_UINT32 (ACPI_INTERRUPT_HANDLED); } +#endif /* !ACPI_REDUCED_HARDWARE */ Modified: head/sys/contrib/dev/acpica/components/events/evgpeblk.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evgpeblk.c Thu Feb 16 15:36:05 2012 (r231827) +++ head/sys/contrib/dev/acpica/components/events/evgpeblk.c Thu Feb 16 22:59:29 2012 (r231844) @@ -49,6 +49,8 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evgpeblk") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static ACPI_STATUS @@ -545,3 +547,4 @@ AcpiEvInitializeGpeBlock ( return_ACPI_STATUS (AE_OK); } +#endif /* !ACPI_REDUCED_HARDWARE */ Modified: head/sys/contrib/dev/acpica/components/events/evgpeinit.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evgpeinit.c Thu Feb 16 15:36:05 2012 (r231827) +++ head/sys/contrib/dev/acpica/components/events/evgpeinit.c Thu Feb 16 22:59:29 2012 (r231844) @@ -50,6 +50,7 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evgpeinit") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /* * Note: History of _PRW support in ACPICA @@ -457,3 +458,5 @@ AcpiEvMatchGpeMethod ( Name, GpeNumber)); return_ACPI_STATUS (AE_OK); } + +#endif /* !ACPI_REDUCED_HARDWARE */ Modified: head/sys/contrib/dev/acpica/components/events/evgpeutil.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evgpeutil.c Thu Feb 16 15:36:05 2012 (r231827) +++ head/sys/contrib/dev/acpica/components/events/evgpeutil.c Thu Feb 16 22:59:29 2012 (r231844) @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGES. */ - #include #include #include @@ -50,6 +49,7 @@ ACPI_MODULE_NAME ("evgpeutil") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /******************************************************************************* * * FUNCTION: AcpiEvWalkGpeList @@ -422,3 +422,4 @@ AcpiEvDeleteGpeHandlers ( return_ACPI_STATUS (AE_OK); } +#endif /* !ACPI_REDUCED_HARDWARE */ Modified: head/sys/contrib/dev/acpica/components/events/evmisc.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evmisc.c Thu Feb 16 15:36:05 2012 (r231827) +++ head/sys/contrib/dev/acpica/components/events/evmisc.c Thu Feb 16 22:59:29 2012 (r231844) @@ -120,27 +120,29 @@ AcpiEvQueueNotifyRequest ( /* - * For value 3 (Ejection Request), some device method may need to be run. - * For value 2 (Device Wake) if _PRW exists, the _PS0 method may need - * to be run. + * For value 0x03 (Ejection Request), may need to run a device method. + * For value 0x02 (Device Wake), if _PRW exists, may need to run + * the _PS0 method. * For value 0x80 (Status Change) on the power button or sleep button, - * initiate soft-off or sleep operation? + * initiate soft-off or sleep operation. + * + * For all cases, simply dispatch the notify to the handler. */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Dispatching Notify on [%4.4s] Node %p Value 0x%2.2X (%s)\n", - AcpiUtGetNodeName (Node), Node, NotifyValue, - AcpiUtGetNotifyName (NotifyValue))); + "Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n", + AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type), + NotifyValue, AcpiUtGetNotifyName (NotifyValue), Node)); /* Get the notify object attached to the NS Node */ ObjDesc = AcpiNsGetAttachedObject (Node); if (ObjDesc) { - /* We have the notify object, Get the right handler */ + /* We have the notify object, Get the correct handler */ switch (Node->Type) { - /* Notify allowed only on these types */ + /* Notify is allowed only on these types */ case ACPI_TYPE_DEVICE: case ACPI_TYPE_THERMAL: @@ -165,7 +167,7 @@ AcpiEvQueueNotifyRequest ( } /* - * If there is any handler to run, schedule the dispatcher. + * If there is a handler to run, schedule the dispatcher. * Check for: * 1) Global system notify handler * 2) Global device notify handler @@ -291,6 +293,7 @@ AcpiEvNotifyDispatch ( } +#if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * * FUNCTION: AcpiEvTerminate @@ -370,3 +373,5 @@ AcpiEvTerminate ( } return_VOID; } + +#endif /* !ACPI_REDUCED_HARDWARE */ Modified: head/sys/contrib/dev/acpica/components/events/evsci.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evsci.c Thu Feb 16 15:36:05 2012 (r231827) +++ head/sys/contrib/dev/acpica/components/events/evsci.c Thu Feb 16 22:59:29 2012 (r231844) @@ -50,6 +50,8 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evsci") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static UINT32 ACPI_SYSTEM_XFACE @@ -204,4 +206,4 @@ AcpiEvRemoveSciHandler ( return_ACPI_STATUS (Status); } - +#endif /* !ACPI_REDUCED_HARDWARE */ Modified: head/sys/contrib/dev/acpica/components/events/evxface.c ============================================================================== --- head/sys/contrib/dev/acpica/events/evxface.c Thu Feb 16 15:36:05 2012 (r231827) +++ head/sys/contrib/dev/acpica/components/events/evxface.c Thu Feb 16 22:59:29 2012 (r231844) @@ -56,257 +56,6 @@ /******************************************************************************* * - * FUNCTION: AcpiInstallExceptionHandler - * - * PARAMETERS: Handler - Pointer to the handler function for the - * event - * - * RETURN: Status - * - * DESCRIPTION: Saves the pointer to the handler function - * - ******************************************************************************/ - -ACPI_STATUS -AcpiInstallExceptionHandler ( - ACPI_EXCEPTION_HANDLER Handler) -{ - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (AcpiInstallExceptionHandler); - - - Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Don't allow two handlers. */ - - if (AcpiGbl_ExceptionHandler) - { - Status = AE_ALREADY_EXISTS; - goto Cleanup; - } - - /* Install the handler */ - - AcpiGbl_ExceptionHandler = Handler; - -Cleanup: - (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); - return_ACPI_STATUS (Status); -} - -ACPI_EXPORT_SYMBOL (AcpiInstallExceptionHandler) - - -/******************************************************************************* - * - * FUNCTION: AcpiInstallGlobalEventHandler - * - * PARAMETERS: Handler - Pointer to the global event handler function - * Context - Value passed to the handler on each event - * - * RETURN: Status - * - * DESCRIPTION: Saves the pointer to the handler function. The global handler - * is invoked upon each incoming GPE and Fixed Event. It is - * invoked at interrupt level at the time of the event dispatch. - * Can be used to update event counters, etc. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiInstallGlobalEventHandler ( - ACPI_GBL_EVENT_HANDLER Handler, - void *Context) -{ - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (AcpiInstallGlobalEventHandler); - - - /* Parameter validation */ - - if (!Handler) - { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - - Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Feb 16 23:05:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 224CF106566B; Thu, 16 Feb 2012 23:05:10 +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 1213D8FC16; Thu, 16 Feb 2012 23:05:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1GN59nv038713; Thu, 16 Feb 2012 23:05:09 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1GN596l038711; Thu, 16 Feb 2012 23:05:09 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202162305.q1GN596l038711@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 16 Feb 2012 23:05: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: r231845 - head/usr.sbin/acpi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2012 23:05:10 -0000 Author: jkim Date: Thu Feb 16 23:05:09 2012 New Revision: 231845 URL: http://svn.freebsd.org/changeset/base/231845 Log: Fix a stupid typo. Modified: head/usr.sbin/acpi/Makefile.inc Modified: head/usr.sbin/acpi/Makefile.inc ============================================================================== --- head/usr.sbin/acpi/Makefile.inc Thu Feb 16 22:59:29 2012 (r231844) +++ head/usr.sbin/acpi/Makefile.inc Thu Feb 16 23:05:09 2012 (r231845) @@ -22,4 +22,4 @@ CFLAGS+= -I${.CURDIR}/../../../sys ${ACPICA_DIR}/components/resources \ ${ACPICA_DIR}/components/tables \ ${ACPICA_DIR}/components/utilities \ - ${ACPICA_DIR}/os_specific/service_layers \ + ${ACPICA_DIR}/os_specific/service_layers From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 00:08:57 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDDCB1065674; Fri, 17 Feb 2012 00:08:57 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 98CCC8FC12; Fri, 17 Feb 2012 00:08:54 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id q1H08k56009720; Thu, 16 Feb 2012 17:08:46 -0700 (MST) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id q1H08kO2009719; Thu, 16 Feb 2012 17:08:46 -0700 (MST) (envelope-from ken) Date: Thu, 16 Feb 2012 17:08:46 -0700 From: "Kenneth D. Merry" To: Bruce Evans Message-ID: <20120217000846.GA7641@nargothrond.kdm.org> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120217053341.R1256@besplex.bde.org> User-Agent: Mutt/1.4.2i Cc: marcel@FreeBSD.org, Eitan Adler , svn-src-all@FreeBSD.org, Andriy Gapon , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 00:08:57 -0000 On Fri, Feb 17, 2012 at 06:25:42 +1100, Bruce Evans wrote: > On Thu, 16 Feb 2012, Kenneth D. Merry wrote: > > >On Thu, Feb 16, 2012 at 11:13:09 +0200, Andriy Gapon wrote: > >>on 16/02/2012 11:00 Andriy Gapon said the following: > >>>on 16/02/2012 10:53 Julian Elischer said the following: > >>>>Bruce, this is a good example of a legitimate gripe going un-noticed > >>>>because > >>>>you didn't shout loud enough at the right time, at the right people. > >>>>It's been about 20 years since we started working on this but I've > >>>>finally > >>>>come to the point of saying that we need you to do more when you see > >>>>problems. > >>>>object officially if you think things should be backed out! > >>>> > >>>>your reasons here seem sound, so it's hard to see why you haven't been > >>>>more > >>>>public about it. > >>> > >>>Just for the record: Bruce and I voiced opinions against the commit when > >>>it went > >>>in after a rather short notice for such an important thing. The opinions > >>>can be found in the archives of these lists. > >> > >>To be more precise: s/opinions against/concerns about behavior in the > >>edge cases/. > >> > >>For me personally the immediate benefits in the common situations > >>outweighed the > >>problems in the edge cases, although I still believe that we can get the > >>former > >>without sacrifices in the latter. > > > >I will happily back the message buffer locking changes out if you and Bruce > >agree that that is the best thing to do. > > Thanks. I'm not sure what backing it out would take us back to. In theory, what I'm suggesting is backing out r222537, r222550, and probably r231814 (which is the one that started this most recent thread), since I think it depends on the previous two changes. It looks like r226435 (done by marcel) would also need to be removed since I think it was to fix bugs introduced in my changes. So I think we need some comment from Eitan on r231814, since that would probably need to come out as well. If he is okay with backing out r231814, and avg agrees as well, then I will back out all four changes. > >I can also review any proposed fixes to the message buffer locking code, > >but I really don't have the bandwidth right now to come up with the "real" > >solution. > > > >Sorry I didn't get around to dealing with it, I should have said something > >months ago. > > > >Now that you know a fix won't be coming from me, you two can let me know > >whether you'd like the changes backed out, or you are certainly free to > >commit a solution yourselves. > > I seem to remember that I asked you to test my old simple changes for > printf serialization on your larger systems that apparently generates > lots of contending printfs. Yes. I never got around to that, unfortunately. > Kernel printfs should be a very rare operation, and kernel syslog messages > not much more so, so concurrent printfs should be rare-squared. They > are a non-problem for me, so my old changes haven't been tested much. > But I needed serialization the other day for my printfs in trap() to > debug a deadlock in ddb, since the deadlock is related to to trap() > racing itself. I actually used PRINTF_BUFR_SIZE in a ~2008 kernel for > this. This is actually a good test of printf() under heavy load. Any > line buffering for printf() would have either broken the output format > (I wanted to show many checkpoint passes per line) or changed the timing > enough to make the race go away. > > My changes do the following to serialize per printf (not per line): > - try to acquire a nonstandard spinlock implemented using atomic_cmpset. > - spin for up to ~1 second (or more like 1 ms if you want) waiting for it > - ignore the lock after the timeout and proceeed (with complications to > not let multiple CPUs proceed at the same time, I hope) > - when multiple CPUs proceed, use atomic atomic ops as before to avoid > races in msgbuf accesses, and depend on console drivers being correct > to avoid deadlocks and races in them. Most aren't correct. > The worst that is supposed to happen is for deadlock on the nonstandard > spinlock to occur except for the timeout; then the timeout reduces to > interleaved output with bugs limited to console drivers by correct > msgbuf code. The deadlock on the nonstanded spinlock occurs in buggy > trap handlers for traps in code holding the lock (mainly ddb traps). > Then it mainly gives the amusing behaviour that the buggy code is > punished by printing its output very slowly. It sounds fine, but I don't have sufficient time to spend on this right now. So I can either back out the changes I mentioned above (assuming we get agreement from avg), or leave things as is. Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 00:19:51 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7933B106566B; Fri, 17 Feb 2012 00:19:51 +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 8F7CE8FC15; Fri, 17 Feb 2012 00:19:49 +0000 (UTC) Received: from porto.starpoint.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 CAA27948; Fri, 17 Feb 2012 02:19:47 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RyBYA-0004b6-Uk; Fri, 17 Feb 2012 02:19:46 +0200 Message-ID: <4F3D9D03.6020507@FreeBSD.org> Date: Fri, 17 Feb 2012 02:19:15 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0) Gecko/20120202 Thunderbird/10.0 MIME-Version: 1.0 To: "Kenneth D. Merry" References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> In-Reply-To: <20120217000846.GA7641@nargothrond.kdm.org> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: marcel@FreeBSD.org, Eitan Adler , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans , svn-src-head@FreeBSD.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 00:19:51 -0000 on 17/02/2012 02:08 Kenneth D. Merry said the following: [snip] >>> On Thu, Feb 16, 2012 at 11:13:09 +0200, Andriy Gapon wrote: [snip] >>>> For me personally the immediate benefits in the common situations >>>> outweighed the >>>> problems in the edge cases, although I still believe that we can get the >>>> former >>>> without sacrifices in the latter. [snip] > It sounds fine, but I don't have sufficient time to spend on this right > now. So I can either back out the changes I mentioned above (assuming we > get agreement from avg), or leave things as is. I stick to what I wrote above and so chose the status quo. The backout would make sense if it is immediately followed by commit of a better solution. Unfortunately, a lack of time here too. P.S. Nobody yet complained about actually running into an edge case, while I personally know at least one person to whom the intermingled messages caused some grief, especially given that they happened in /var/log/security. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 01:21:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF17F1065672; Fri, 17 Feb 2012 01:21:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E8978FC08; Fri, 17 Feb 2012 01:21:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1H1L8Zm043326; Fri, 17 Feb 2012 01:21:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1H1L8V5043324; Fri, 17 Feb 2012 01:21:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202170121.q1H1L8V5043324@svn.freebsd.org> From: Eitan Adler Date: Fri, 17 Feb 2012 01:21: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: r231849 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 01:21:08 -0000 Author: eadler Date: Fri Feb 17 01:21:08 2012 New Revision: 231849 URL: http://svn.freebsd.org/changeset/base/231849 Log: Style: prefer the use of line continuations to += Requested by: marcel, dougb, bde Approved by: cperciva MFC after: 3 days Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Fri Feb 17 00:56:17 2012 (r231848) +++ head/etc/Makefile Fri Feb 17 01:21:08 2012 (r231849) @@ -7,48 +7,48 @@ SUBDIR= sendmail .endif -BIN1= auth.conf -BIN1+= crontab -BIN1+= devd.conf -BIN1+= devfs.conf -BIN1+= ddb.conf -BIN1+= dhclient.conf -BIN1+= disktab -BIN1+= fbtab -BIN1+= ftpusers -BIN1+= gettytab -BIN1+= group -BIN1+= hosts -BIN1+= hosts.allow -BIN1+= hosts.equiv -BIN1+= inetd.conf -BIN1+= libalias.conf -BIN1+= login.access -BIN1+= login.conf -BIN1+= mac.conf -BIN1+= motd -BIN1+= netconfig -BIN1+= network.subr -BIN1+= networks -BIN1+= newsyslog.conf -BIN1+= nsswitch.conf -BIN1+= phones -BIN1+= profile -BIN1+= protocols -BIN1+= rc -BIN1+= rc.bsdextended -BIN1+= rc.firewall -BIN1+= rc.initdiskless -BIN1+= rc.sendmail -BIN1+= rc.shutdown -BIN1+= rc.subr -BIN1+= remote -BIN1+= rpc -BIN1+= services -BIN1+= shells -BIN1+= sysctl.conf -BIN1+= syslog.conf -BIN1+= termcap.small +BIN1= auth.conf \ + crontab \ + devd.conf \ + devfs.conf \ + ddb.conf \ + dhclient.conf \ + disktab \ + fbtab \ + ftpusers \ + gettytab \ + group \ + hosts \ + hosts.allow \ + hosts.equiv \ + inetd.conf \ + libalias.conf \ + login.access \ + login.conf \ + mac.conf \ + motd \ + netconfig \ + network.subr \ + networks \ + newsyslog.conf \ + nsswitch.conf \ + phones \ + profile \ + protocols \ + rc \ + rc.bsdextended \ + rc.firewall \ + rc.initdiskless \ + rc.sendmail \ + rc.shutdown \ + rc.subr \ + remote \ + rpc \ + services \ + shells \ + sysctl.conf \ + syslog.conf \ + termcap.small .if exists(${.CURDIR}/etc.${MACHINE}/ttys) BIN1+= etc.${MACHINE}/ttys From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 02:39:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92A44106567B; Fri, 17 Feb 2012 02:39:59 +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 7E0B28FC22; Fri, 17 Feb 2012 02:39:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1H2dxps045906; Fri, 17 Feb 2012 02:39:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1H2dxWp045886; Fri, 17 Feb 2012 02:39:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202170239.q1H2dxWp045886@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 17 Feb 2012 02:39: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: r231852 - in head: contrib/netcat contrib/pf/pfctl etc/rc.d share/man/man4 sys/contrib/dev/acpica sys/contrib/pf/net sys/fs/nfsclient sys/kern sys/net sys/netinet sys/netinet/ipfw sys/n... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 02:39:59 -0000 Author: bz Date: Fri Feb 17 02:39:58 2012 New Revision: 231852 URL: http://svn.freebsd.org/changeset/base/231852 Log: Merge multi-FIB IPv6 support from projects/multi-fibv6/head/: Extend the so far IPv4-only support for multiple routing tables (FIBs) introduced in r178888 to IPv6 providing feature parity. This includes an extended rtalloc(9) KPI for IPv6, the necessary adjustments to the network stack, and user land support as in netstat. Sponsored by: Cisco Systems, Inc. Reviewed by: melifaro (basically) MFC after: 10 days Modified: head/contrib/netcat/netcat.c head/contrib/pf/pfctl/parse.y head/etc/rc.d/routing head/share/man/man4/faith.4 head/sys/contrib/pf/net/pf.c head/sys/contrib/pf/net/pf_ioctl.c head/sys/contrib/pf/net/pf_lb.c head/sys/contrib/pf/net/pf_norm.c head/sys/contrib/pf/net/pfvar.h head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/kern/uipc_socket.c head/sys/net/flowtable.c head/sys/net/if_faith.c head/sys/net/route.c head/sys/net/route.h head/sys/netinet/in.c head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/tcp_subr.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6.c head/sys/netinet6/in6_gif.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/in6_src.c head/sys/netinet6/in6_var.h head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_output.c head/sys/netinet6/ip6_var.h head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c head/sys/netinet6/raw_ip6.c head/sys/netipsec/ipsec_output.c head/sys/nfs/bootp_subr.c head/sys/nfsclient/nfs_vfsops.c head/usr.bin/netstat/route.c Directory Properties: head/ (props changed) head/cddl/contrib/opensolaris/ (props changed) head/contrib/gcc/ (props changed) head/contrib/llvm/ (props changed) head/contrib/netcat/ (props changed) head/contrib/pf/ (props changed) head/crypto/openssh/ (props changed) head/gnu/usr.bin/cc/cc_tools/ (props changed) head/lib/libc/ (props changed) head/lib/libutil/ (props changed) head/sbin/ (props changed) head/sbin/ipfw/ (props changed) head/share/man/man4/ (props changed) head/sys/ (props changed) head/sys/boot/ (props changed) head/sys/boot/powerpc/boot1.chrp/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) head/sys/conf/ (props changed) head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/changes.txt (props changed) head/sys/contrib/dev/acpica/common/ (props changed) head/sys/contrib/dev/acpica/compiler/ (props changed) head/sys/contrib/dev/acpica/components/debugger/ (props changed) head/sys/contrib/dev/acpica/components/disassembler/ (props changed) head/sys/contrib/dev/acpica/components/dispatcher/ (props changed) head/sys/contrib/dev/acpica/components/events/ (props changed) head/sys/contrib/dev/acpica/components/executer/ (props changed) head/sys/contrib/dev/acpica/components/hardware/ (props changed) head/sys/contrib/dev/acpica/components/namespace/ (props changed) head/sys/contrib/dev/acpica/components/parser/ (props changed) head/sys/contrib/dev/acpica/components/resources/ (props changed) head/sys/contrib/dev/acpica/components/tables/ (props changed) head/sys/contrib/dev/acpica/components/utilities/ (props changed) head/sys/contrib/dev/acpica/include/ (props changed) head/sys/contrib/dev/acpica/os_specific/ (props changed) head/sys/contrib/pf/ (props changed) head/usr.bin/calendar/ (props changed) Modified: head/contrib/netcat/netcat.c ============================================================================== --- head/contrib/netcat/netcat.c Fri Feb 17 01:45:49 2012 (r231851) +++ head/contrib/netcat/netcat.c Fri Feb 17 02:39:58 2012 (r231852) @@ -605,8 +605,10 @@ remote_connect(const char *host, const c #endif if (rtableid) { - if (setfib(rtableid) == -1) - err(1, "setfib"); + if (setsockopt(s, SOL_SOCKET, SO_SETFIB, &rtableid, + sizeof(rtableid)) == -1) + err(1, "setsockopt(.., SO_SETFIB, %u, ..)", + rtableid); } /* Bind to a local port or source address if specified. */ @@ -678,8 +680,11 @@ local_listen(char *host, char *port, str continue; if (rtableid) { - if (setfib(rtableid) == -1) - err(1, "setfib"); + ret = setsockopt(s, SOL_SOCKET, SO_SETFIB, &rtableid, + sizeof(rtableid)); + if (ret == -1) + err(1, "setsockopt(.., SO_SETFIB, %u, ..)", + rtableid); } ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x)); Modified: head/contrib/pf/pfctl/parse.y ============================================================================== --- head/contrib/pf/pfctl/parse.y Fri Feb 17 01:45:49 2012 (r231851) +++ head/contrib/pf/pfctl/parse.y Fri Feb 17 02:39:58 2012 (r231852) @@ -33,6 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -335,6 +338,7 @@ int expand_skip_interface(struct node_ int check_rulestate(int); int getservice(char *); int rule_label(struct pf_rule *, char *); +int rt_tableid_max(void); void mv_rules(struct pf_ruleset *, struct pf_ruleset *); void decide_address_family(struct node_host *, sa_family_t *); @@ -1174,7 +1178,7 @@ scrub_opt : NODF { scrub_opts.randomid = 1; } | RTABLE NUMBER { - if ($2 < 0 /* || $2 > RT_TABLEID_MAX */) { + if ($2 < 0 || $2 > rt_tableid_max()) { yyerror("invalid rtable id"); YYERROR; } @@ -1322,7 +1326,7 @@ antispoof_opt : label { antispoof_opts.label = $1; } | RTABLE NUMBER { - if ($2 < 0 /* || $2 > RT_TABLEID_MAX */ ) { + if ($2 < 0 || $2 > rt_tableid_max()) { yyerror("invalid rtable id"); YYERROR; } @@ -2361,7 +2365,7 @@ filter_opt : USER uids { filter_opts.prob = 1; } | RTABLE NUMBER { - if ($2 < 0 /* || $2 > RT_TABLEID_MAX */ ) { + if ($2 < 0 || $2 > rt_tableid_max()) { yyerror("invalid rtable id"); YYERROR; } @@ -4190,7 +4194,7 @@ tagged : /* empty */ { $$.neg = 0; $$. rtable : /* empty */ { $$ = -1; } | RTABLE NUMBER { - if ($2 < 0 /* || $2 > RT_TABLEID_MAX */ ) { + if ($2 < 0 || $2 > rt_tableid_max()) { yyerror("invalid rtable id"); YYERROR; } @@ -6051,3 +6055,23 @@ pfctl_load_anchors(int dev, struct pfctl return (0); } + +int +rt_tableid_max(void) +{ +#ifdef __FreeBSD__ + int fibs; + size_t l = sizeof(fibs); + + if (sysctlbyname("net.fibs", &fibs, &l, NULL, 0) == -1) + fibs = 16; /* XXX RT_MAXFIBS, at least limit it some. */ + /* + * As the OpenBSD code only compares > and not >= we need to adjust + * here given we only accept values of 0..n and want to avoid #ifdefs + * in the grammer. + */ + return (fibs - 1); +#else + return (RT_TABLEID_MAX); +#endif +} Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Fri Feb 17 01:45:49 2012 (r231851) +++ head/etc/rc.d/routing Fri Feb 17 02:39:58 2012 (r231852) @@ -139,12 +139,22 @@ static_inet() static_inet6() { - local _action i + local _action i fibs _action=$1 + # get the number of FIBs supported. + fibs=`sysctl -n net.fibs` + : ${fibs:=1} + # disallow "internal" addresses to appear on the wire - route ${_action} -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject - route ${_action} -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject + i=0 + while test ${i} -lt ${fibs}; do + setfib -F ${i} route ${_action} \ + -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject + setfib -F ${i} route ${_action} \ + -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject + i=$((i + 1)) + done case ${ipv6_defaultrouter} in [Nn][Oo] | '') @@ -216,8 +226,14 @@ static_inet6() # for the host case, you will allow to omit the identifiers. # Under this configuration, the packets will go to the default # interface. - route ${_action} -inet6 fe80:: -prefixlen 10 ::1 -reject - route ${_action} -inet6 ff02:: -prefixlen 16 ::1 -reject + i=0 + while test ${i} -lt ${fibs}; do + setfib -F ${i} route ${_action} \ + -inet6 fe80:: -prefixlen 10 ::1 -reject + setfib -F ${i} route ${_action} \ + -inet6 ff02:: -prefixlen 16 ::1 -reject + i=$((i + 1)) + done case ${ipv6_default_interface} in '') Modified: head/share/man/man4/faith.4 ============================================================================== --- head/share/man/man4/faith.4 Fri Feb 17 01:45:49 2012 (r231851) +++ head/share/man/man4/faith.4 Fri Feb 17 02:39:58 2012 (r231852) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 1999 +.Dd January 23, 2012 .Dt FAITH 4 .Os .Sh NAME @@ -58,7 +58,7 @@ variable in .Xr rc.conf 5 . .Pp Special action will be taken when IPv6 TCP traffic is seen on a router, -and the routing table suggests to route it to the +and the default routing table suggests to route it to the .Nm interface. In this case, the packet will be accepted by the router, Modified: head/sys/contrib/pf/net/pf.c ============================================================================== --- head/sys/contrib/pf/net/pf.c Fri Feb 17 01:45:49 2012 (r231851) +++ head/sys/contrib/pf/net/pf.c Fri Feb 17 02:39:58 2012 (r231852) @@ -320,7 +320,7 @@ u_int8_t pf_get_wscale(struct mbuf *, u_int16_t pf_get_mss(struct mbuf *, int, u_int16_t, sa_family_t); u_int16_t pf_calc_mss(struct pf_addr *, sa_family_t, - u_int16_t); + int, u_int16_t); void pf_set_rt_ifp(struct pf_state *, struct pf_addr *); int pf_check_proto_cksum(struct mbuf *, int, int, @@ -3137,7 +3137,7 @@ pf_get_mss(struct mbuf *m, int off, u_in } u_int16_t -pf_calc_mss(struct pf_addr *addr, sa_family_t af, u_int16_t offer) +pf_calc_mss(struct pf_addr *addr, sa_family_t af, int rtableid, u_int16_t offer) { #ifdef INET struct sockaddr_in *dst; @@ -3166,11 +3166,7 @@ pf_calc_mss(struct pf_addr *addr, sa_fam dst->sin_len = sizeof(*dst); dst->sin_addr = addr->v4; #ifdef __FreeBSD__ -#ifdef RTF_PRCLONING - rtalloc_ign(&ro, (RTF_CLONING | RTF_PRCLONING)); -#else /* !RTF_PRCLONING */ - in_rtalloc_ign(&ro, 0, 0); -#endif + in_rtalloc_ign(&ro, 0, rtableid); #else /* ! __FreeBSD__ */ rtalloc_noclone(&ro, NO_CLONING); #endif @@ -3186,12 +3182,7 @@ pf_calc_mss(struct pf_addr *addr, sa_fam dst6->sin6_len = sizeof(*dst6); dst6->sin6_addr = addr->v6; #ifdef __FreeBSD__ -#ifdef RTF_PRCLONING - rtalloc_ign((struct route *)&ro6, - (RTF_CLONING | RTF_PRCLONING)); -#else /* !RTF_PRCLONING */ - rtalloc_ign((struct route *)&ro6, 0); -#endif + in6_rtalloc_ign(&ro6, 0, rtableid); #else /* ! __FreeBSD__ */ rtalloc_noclone((struct route *)&ro6, NO_CLONING); #endif @@ -3532,14 +3523,14 @@ pf_test_rule(struct pf_rule **rm, struct else if (r->proto && r->proto != pd->proto) r = r->skip[PF_SKIP_PROTO].ptr; else if (PF_MISMATCHAW(&r->src.addr, saddr, af, - r->src.neg, kif)) + r->src.neg, kif, M_GETFIB(m))) r = r->skip[PF_SKIP_SRC_ADDR].ptr; /* tcp/udp only. port_op always 0 in other cases */ else if (r->src.port_op && !pf_match_port(r->src.port_op, r->src.port[0], r->src.port[1], sport)) r = r->skip[PF_SKIP_SRC_PORT].ptr; else if (PF_MISMATCHAW(&r->dst.addr, daddr, af, - r->dst.neg, NULL)) + r->dst.neg, NULL, M_GETFIB(m))) r = r->skip[PF_SKIP_DST_ADDR].ptr; /* tcp/udp only. port_op always 0 in other cases */ else if (r->dst.port_op && !pf_match_port(r->dst.port_op, @@ -3988,9 +3979,10 @@ pf_create_state(struct pf_rule *r, struc } s->src.seqhi = htonl(arc4random()); /* Find mss option */ + int rtid = M_GETFIB(m); mss = pf_get_mss(m, off, th->th_off, pd->af); - mss = pf_calc_mss(pd->src, pd->af, mss); - mss = pf_calc_mss(pd->dst, pd->af, mss); + mss = pf_calc_mss(pd->src, pd->af, rtid, mss); + mss = pf_calc_mss(pd->dst, pd->af, rtid, mss); s->src.mss = mss; #ifdef __FreeBSD__ pf_send_tcp(NULL, r, pd->af, pd->dst, pd->src, th->th_dport, @@ -4072,10 +4064,10 @@ pf_test_fragment(struct pf_rule **rm, in else if (r->proto && r->proto != pd->proto) r = r->skip[PF_SKIP_PROTO].ptr; else if (PF_MISMATCHAW(&r->src.addr, pd->src, af, - r->src.neg, kif)) + r->src.neg, kif, M_GETFIB(m))) r = r->skip[PF_SKIP_SRC_ADDR].ptr; else if (PF_MISMATCHAW(&r->dst.addr, pd->dst, af, - r->dst.neg, NULL)) + r->dst.neg, NULL, M_GETFIB(m))) r = r->skip[PF_SKIP_DST_ADDR].ptr; else if (r->tos && !(r->tos == pd->tos)) r = TAILQ_NEXT(r, entries); @@ -5677,7 +5669,8 @@ pf_pull_hdr(struct mbuf *m, int off, voi } int -pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *kif) +pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *kif, + int rtableid) { #ifdef __FreeBSD__ #ifdef RADIX_MPATH @@ -5751,13 +5744,21 @@ pf_routable(struct pf_addr *addr, sa_fam goto out; #ifdef __FreeBSD__ -/* XXX MRT not always INET */ /* stick with table 0 though */ + switch (af) { +#ifdef INET6 + case AF_INET6: + in6_rtalloc_ign(&ro, 0, rtableid); + break; +#endif #ifdef INET - if (af == AF_INET) - in_rtalloc_ign((struct route *)&ro, 0, 0); - else + case AF_INET: + in_rtalloc_ign((struct route *)&ro, 0, rtableid); + break; #endif - rtalloc_ign((struct route *)&ro, 0); + default: + rtalloc_ign((struct route *)&ro, 0); /* No/default FIB. */ + break; + } #else /* ! __FreeBSD__ */ rtalloc_noclone((struct route *)&ro, NO_CLONING); #endif @@ -5803,7 +5804,8 @@ out: } int -pf_rtlabel_match(struct pf_addr *addr, sa_family_t af, struct pf_addr_wrap *aw) +pf_rtlabel_match(struct pf_addr *addr, sa_family_t af, struct pf_addr_wrap *aw, + int rtableid) { struct sockaddr_in *dst; #ifdef INET6 @@ -5835,16 +5837,21 @@ pf_rtlabel_match(struct pf_addr *addr, s } #ifdef __FreeBSD__ -# ifdef RTF_PRCLONING - rtalloc_ign((struct route *)&ro, (RTF_CLONING|RTF_PRCLONING)); -# else /* !RTF_PRCLONING */ + switch (af) { +#ifdef INET6 + case AF_INET6: + in6_rtalloc_ign(&ro, 0, rtableid); + break; +#endif #ifdef INET - if (af == AF_INET) - in_rtalloc_ign((struct route *)&ro, 0, 0); - else + case AF_INET: + in_rtalloc_ign((struct route *)&ro, 0, rtableid); + break; #endif + default: rtalloc_ign((struct route *)&ro, 0); -# endif + break; + } #else /* ! __FreeBSD__ */ rtalloc_noclone((struct route *)&ro, NO_CLONING); #endif @@ -5927,7 +5934,7 @@ pf_route(struct mbuf **m, struct pf_rule if (r->rt == PF_FASTROUTE) { #ifdef __FreeBSD__ - in_rtalloc(ro, 0); + in_rtalloc_ign(ro, 0, M_GETFIB(m0)); #else rtalloc(ro); #endif @@ -6893,7 +6900,7 @@ done: ("pf: dropping packet with ip options\n")); } - if ((s && s->tag) || r->rtableid) + if ((s && s->tag) || r->rtableid >= 0) #ifdef __FreeBSD__ pf_tag_packet(m, s ? s->tag : 0, r->rtableid, pd.pf_mtag); #else @@ -7437,7 +7444,7 @@ done: ("pf: dropping packet with dangerous v6 headers\n")); } - if ((s && s->tag) || r->rtableid) + if ((s && s->tag) || r->rtableid >= 0) #ifdef __FreeBSD__ pf_tag_packet(m, s ? s->tag : 0, r->rtableid, pd.pf_mtag); #else Modified: head/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- head/sys/contrib/pf/net/pf_ioctl.c Fri Feb 17 01:45:49 2012 (r231851) +++ head/sys/contrib/pf/net/pf_ioctl.c Fri Feb 17 02:39:58 2012 (r231852) @@ -1754,7 +1754,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t a } #ifdef __FreeBSD__ /* ROUTING */ - if (rule->rtableid > 0 && rule->rtableid > rt_numfibs) + if (rule->rtableid > 0 && rule->rtableid >= rt_numfibs) #else if (rule->rtableid > 0 && !rtable_exists(rule->rtableid)) #endif @@ -2035,7 +2035,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t a if (newrule->rtableid > 0 && #ifdef __FreeBSD__ /* ROUTING */ - newrule->rtableid > rt_numfibs) + newrule->rtableid >= rt_numfibs) #else !rtable_exists(newrule->rtableid)) #endif Modified: head/sys/contrib/pf/net/pf_lb.c ============================================================================== --- head/sys/contrib/pf/net/pf_lb.c Fri Feb 17 01:45:49 2012 (r231851) +++ head/sys/contrib/pf/net/pf_lb.c Fri Feb 17 02:39:58 2012 (r231852) @@ -261,7 +261,7 @@ pf_match_translation(struct pf_pdesc *pd else if (r->proto && r->proto != pd->proto) r = r->skip[PF_SKIP_PROTO].ptr; else if (PF_MISMATCHAW(&src->addr, saddr, pd->af, - src->neg, kif)) + src->neg, kif, M_GETFIB(m))) r = r->skip[src == &r->src ? PF_SKIP_SRC_ADDR : PF_SKIP_DST_ADDR].ptr; else if (src->port_op && !pf_match_port(src->port_op, @@ -269,10 +269,11 @@ pf_match_translation(struct pf_pdesc *pd r = r->skip[src == &r->src ? PF_SKIP_SRC_PORT : PF_SKIP_DST_PORT].ptr; else if (dst != NULL && - PF_MISMATCHAW(&dst->addr, daddr, pd->af, dst->neg, NULL)) + PF_MISMATCHAW(&dst->addr, daddr, pd->af, dst->neg, NULL, + M_GETFIB(m))) r = r->skip[PF_SKIP_DST_ADDR].ptr; else if (xdst != NULL && PF_MISMATCHAW(xdst, daddr, pd->af, - 0, NULL)) + 0, NULL, M_GETFIB(m))) r = TAILQ_NEXT(r, entries); else if (dst != NULL && dst->port_op && !pf_match_port(dst->port_op, dst->port[0], Modified: head/sys/contrib/pf/net/pf_norm.c ============================================================================== --- head/sys/contrib/pf/net/pf_norm.c Fri Feb 17 01:45:49 2012 (r231851) +++ head/sys/contrib/pf/net/pf_norm.c Fri Feb 17 02:39:58 2012 (r231852) @@ -1163,11 +1163,11 @@ pf_normalize_ip(struct mbuf **m0, int di r = r->skip[PF_SKIP_PROTO].ptr; else if (PF_MISMATCHAW(&r->src.addr, (struct pf_addr *)&h->ip_src.s_addr, AF_INET, - r->src.neg, kif)) + r->src.neg, kif, M_GETFIB(m))) r = r->skip[PF_SKIP_SRC_ADDR].ptr; else if (PF_MISMATCHAW(&r->dst.addr, (struct pf_addr *)&h->ip_dst.s_addr, AF_INET, - r->dst.neg, NULL)) + r->dst.neg, NULL, M_GETFIB(m))) r = r->skip[PF_SKIP_DST_ADDR].ptr; #ifdef __FreeBSD__ else if (r->match_tag && !pf_match_tag(m, r, &tag, pd->pf_mtag)) @@ -1428,11 +1428,11 @@ pf_normalize_ip6(struct mbuf **m0, int d #endif else if (PF_MISMATCHAW(&r->src.addr, (struct pf_addr *)&h->ip6_src, AF_INET6, - r->src.neg, kif)) + r->src.neg, kif, M_GETFIB(m))) r = r->skip[PF_SKIP_SRC_ADDR].ptr; else if (PF_MISMATCHAW(&r->dst.addr, (struct pf_addr *)&h->ip6_dst, AF_INET6, - r->dst.neg, NULL)) + r->dst.neg, NULL, M_GETFIB(m))) r = r->skip[PF_SKIP_DST_ADDR].ptr; else break; @@ -1593,13 +1593,13 @@ pf_normalize_tcp(int dir, struct pfi_kif else if (r->proto && r->proto != pd->proto) r = r->skip[PF_SKIP_PROTO].ptr; else if (PF_MISMATCHAW(&r->src.addr, pd->src, af, - r->src.neg, kif)) + r->src.neg, kif, M_GETFIB(m))) r = r->skip[PF_SKIP_SRC_ADDR].ptr; else if (r->src.port_op && !pf_match_port(r->src.port_op, r->src.port[0], r->src.port[1], th->th_sport)) r = r->skip[PF_SKIP_SRC_PORT].ptr; else if (PF_MISMATCHAW(&r->dst.addr, pd->dst, af, - r->dst.neg, NULL)) + r->dst.neg, NULL, M_GETFIB(m))) r = r->skip[PF_SKIP_DST_ADDR].ptr; else if (r->dst.port_op && !pf_match_port(r->dst.port_op, r->dst.port[0], r->dst.port[1], th->th_dport)) Modified: head/sys/contrib/pf/net/pfvar.h ============================================================================== --- head/sys/contrib/pf/net/pfvar.h Fri Feb 17 01:45:49 2012 (r231851) +++ head/sys/contrib/pf/net/pfvar.h Fri Feb 17 02:39:58 2012 (r231852) @@ -402,14 +402,18 @@ extern struct mtx pf_task_mtx; #endif /* PF_INET6_ONLY */ #endif /* PF_INET_INET6 */ -#define PF_MISMATCHAW(aw, x, af, neg, ifp) \ +/* + * XXX callers not FIB-aware in our version of pf yet. + * OpenBSD fixed it later it seems, 2010/05/07 13:33:16 claudio. + */ +#define PF_MISMATCHAW(aw, x, af, neg, ifp, rtid) \ ( \ (((aw)->type == PF_ADDR_NOROUTE && \ - pf_routable((x), (af), NULL)) || \ + pf_routable((x), (af), NULL, (rtid))) || \ (((aw)->type == PF_ADDR_URPFFAILED && (ifp) != NULL && \ - pf_routable((x), (af), (ifp))) || \ + pf_routable((x), (af), (ifp), (rtid))) || \ ((aw)->type == PF_ADDR_RTLABEL && \ - !pf_rtlabel_match((x), (af), (aw))) || \ + !pf_rtlabel_match((x), (af), (aw), (rtid))) || \ ((aw)->type == PF_ADDR_TABLE && \ !pfr_match_addr((aw)->p.tbl, (x), (af))) || \ ((aw)->type == PF_ADDR_DYNIFTL && \ @@ -1977,8 +1981,10 @@ int pf_normalize_tcp_stateful(struct mbu u_int32_t pf_state_expires(const struct pf_state *); void pf_purge_expired_fragments(void); -int pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *); -int pf_rtlabel_match(struct pf_addr *, sa_family_t, struct pf_addr_wrap *); +int pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *, + int); +int pf_rtlabel_match(struct pf_addr *, sa_family_t, struct pf_addr_wrap *, + int); #ifdef __FreeBSD__ int pf_socket_lookup(int, struct pf_pdesc *, struct inpcb *); #else Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Fri Feb 17 01:45:49 2012 (r231851) +++ head/sys/fs/nfsclient/nfs_clport.c Fri Feb 17 02:39:58 2012 (r231852) @@ -976,7 +976,8 @@ nfscl_getmyip(struct nfsmount *nmp, int sad.sin_len = sizeof (struct sockaddr_in); sad.sin_addr.s_addr = sin->sin_addr.s_addr; CURVNET_SET(CRED_TO_VNET(nmp->nm_sockreq.nr_cred)); - rt = rtalloc1((struct sockaddr *)&sad, 0, 0UL); + rt = rtalloc1_fib((struct sockaddr *)&sad, 0, 0UL, + curthread->td_proc->p_fibnum); if (rt != NULL) { if (rt->rt_ifp != NULL && rt->rt_ifa != NULL && @@ -1001,7 +1002,8 @@ nfscl_getmyip(struct nfsmount *nmp, int sad6.sin6_len = sizeof (struct sockaddr_in6); sad6.sin6_addr = sin6->sin6_addr; CURVNET_SET(CRED_TO_VNET(nmp->nm_sockreq.nr_cred)); - rt = rtalloc1((struct sockaddr *)&sad6, 0, 0UL); + rt = rtalloc1_fib((struct sockaddr *)&sad6, 0, 0UL, + curthread->td_proc->p_fibnum); if (rt != NULL) { if (rt->rt_ifp != NULL && rt->rt_ifa != NULL && Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Fri Feb 17 01:45:49 2012 (r231851) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Fri Feb 17 02:39:58 2012 (r231852) @@ -459,10 +459,10 @@ nfs_mountroot(struct mount *mp) sin.sin_len = sizeof(sin); /* XXX MRT use table 0 for this sort of thing */ CURVNET_SET(TD_TO_VNET(td)); - error = rtrequest(RTM_ADD, (struct sockaddr *)&sin, + error = rtrequest_fib(RTM_ADD, (struct sockaddr *)&sin, (struct sockaddr *)&nd->mygateway, (struct sockaddr *)&mask, - RTF_UP | RTF_GATEWAY, NULL); + RTF_UP | RTF_GATEWAY, NULL, RT_DEFAULT_FIB); CURVNET_RESTORE(); if (error) panic("nfs_mountroot: RTM_ADD: %d", error); Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Feb 17 01:45:49 2012 (r231851) +++ head/sys/kern/uipc_socket.c Fri Feb 17 02:39:58 2012 (r231852) @@ -392,6 +392,7 @@ socreate(int dom, struct socket **aso, i so->so_type = type; so->so_cred = crhold(cred); if ((prp->pr_domain->dom_family == PF_INET) || + (prp->pr_domain->dom_family == PF_INET6) || (prp->pr_domain->dom_family == PF_ROUTE)) so->so_fibnum = td->td_proc->p_fibnum; else @@ -2504,6 +2505,7 @@ sosetopt(struct socket *so, struct socko } if (so->so_proto != NULL && ((so->so_proto->pr_domain->dom_family == PF_INET) || + (so->so_proto->pr_domain->dom_family == PF_INET6) || (so->so_proto->pr_domain->dom_family == PF_ROUTE))) { so->so_fibnum = optval; /* Note: ignore error */ Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Fri Feb 17 01:45:49 2012 (r231851) +++ head/sys/net/flowtable.c Fri Feb 17 02:39:58 2012 (r231852) @@ -374,7 +374,7 @@ SYSCTL_VNET_PROC(_net_inet_flowtable, OI #ifndef RADIX_MPATH static void -in_rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fibnum) +rtalloc_ign_wrapper(struct route *ro, uint32_t hash, u_int fibnum) { rtalloc_ign_fib(ro, 0, fibnum); @@ -1315,7 +1315,7 @@ flowtable_alloc(char *name, int nentry, #ifdef RADIX_MPATH ft->ft_rtalloc = rtalloc_mpath_fib; #else - ft->ft_rtalloc = in_rtalloc_ign_wrapper; + ft->ft_rtalloc = rtalloc_ign_wrapper; #endif if (flags & FL_PCPU) { ft->ft_lock = flowtable_pcpu_lock; Modified: head/sys/net/if_faith.c ============================================================================== --- head/sys/net/if_faith.c Fri Feb 17 01:45:49 2012 (r231851) +++ head/sys/net/if_faith.c Fri Feb 17 02:39:58 2012 (r231852) @@ -338,7 +338,7 @@ faithprefix(in6) sin6.sin6_family = AF_INET6; sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_addr = *in6; - rt = rtalloc1((struct sockaddr *)&sin6, 0, 0UL); + rt = in6_rtalloc1((struct sockaddr *)&sin6, 0, 0UL, RT_DEFAULT_FIB); if (rt && rt->rt_ifp && rt->rt_ifp->if_type == IFT_FAITH && (rt->rt_ifp->if_flags & IFF_UP) != 0) ret = 1; Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Fri Feb 17 01:45:49 2012 (r231851) +++ head/sys/net/route.c Fri Feb 17 02:39:58 2012 (r231852) @@ -35,6 +35,7 @@ ***********************************************************************/ #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_route.h" #include "opt_mrouting.h" #include "opt_mpath.h" @@ -72,7 +73,11 @@ SYSCTL_UINT(_net, OID_AUTO, fibs, CTLFLA /* * Allow the boot code to allow LESS than RT_MAXFIBS to be used. * We can't do more because storage is statically allocated for now. - * (for compatibility reasons.. this will change). + * (for compatibility reasons.. this will change. When this changes, code should + * be refactored to protocol independent parts and protocol dependent parts, + * probably hanging of domain(9) specific storage to not need the full + * fib * af RNH allocation etc. but allow tuning the number of tables per + * address family). */ TUNABLE_INT("net.fibs", &rt_numfibs); @@ -82,6 +87,9 @@ TUNABLE_INT("net.fibs", &rt_numfibs); * changes for the FIB of the caller when adding a new set of addresses * to an interface. XXX this is a shotgun aproach to a problem that needs * a more fine grained solution.. that will come. + * XXX also has the problems getting the FIB from curthread which will not + * always work given the fib can be overridden and prefixes can be added + * from the network stack context. */ u_int rt_add_addr_allfibs = 1; SYSCTL_UINT(_net, OID_AUTO, add_addr_allfibs, CTLFLAG_RW, @@ -196,27 +204,23 @@ vnet_route_init(const void *unused __unu V_rtzone = uma_zcreate("rtentry", sizeof(struct rtentry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); for (dom = domains; dom; dom = dom->dom_next) { - if (dom->dom_rtattach) { - for (table = 0; table < rt_numfibs; table++) { - if ( (fam = dom->dom_family) == AF_INET || - table == 0) { - /* for now only AF_INET has > 1 table */ - /* XXX MRT - * rtattach will be also called - * from vfs_export.c but the - * offset will be 0 - * (only for AF_INET and AF_INET6 - * which don't need it anyhow) - */ - rnh = rt_tables_get_rnh_ptr(table, fam); - if (rnh == NULL) - panic("%s: rnh NULL", __func__); - dom->dom_rtattach((void **)rnh, - dom->dom_rtoffset); - } else { - break; - } - } + if (dom->dom_rtattach == NULL) + continue; + + for (table = 0; table < rt_numfibs; table++) { + fam = dom->dom_family; + if (table != 0 && fam != AF_INET6 && fam != AF_INET) + break; + + /* + * XXX MRT rtattach will be also called from + * vfs_export.c but the offset will be 0 (only for + * AF_INET and AF_INET6 which don't need it anyhow). + */ + rnh = rt_tables_get_rnh_ptr(table, fam); + if (rnh == NULL) + panic("%s: rnh NULL", __func__); + dom->dom_rtattach((void **)rnh, dom->dom_rtoffset); } } } @@ -233,20 +237,19 @@ vnet_route_uninit(const void *unused __u struct radix_node_head **rnh; for (dom = domains; dom; dom = dom->dom_next) { - if (dom->dom_rtdetach) { - for (table = 0; table < rt_numfibs; table++) { - if ( (fam = dom->dom_family) == AF_INET || - table == 0) { - /* For now only AF_INET has > 1 tbl. */ - rnh = rt_tables_get_rnh_ptr(table, fam); - if (rnh == NULL) - panic("%s: rnh NULL", __func__); - dom->dom_rtdetach((void **)rnh, - dom->dom_rtoffset); - } else { - break; - } - } + if (dom->dom_rtdetach == NULL) + continue; + + for (table = 0; table < rt_numfibs; table++) { + fam = dom->dom_family; + + if (table != 0 && fam != AF_INET6 && fam != AF_INET) + break; + + rnh = rt_tables_get_rnh_ptr(table, fam); + if (rnh == NULL) + panic("%s: rnh NULL", __func__); + dom->dom_rtdetach((void **)rnh, dom->dom_rtoffset); } } } @@ -274,7 +277,8 @@ sys_setfib(struct thread *td, struct set void rtalloc(struct route *ro) { - rtalloc_ign_fib(ro, 0UL, 0); + + rtalloc_ign_fib(ro, 0UL, RT_DEFAULT_FIB); } void @@ -294,7 +298,7 @@ rtalloc_ign(struct route *ro, u_long ign RTFREE(rt); ro->ro_rt = NULL; } - ro->ro_rt = rtalloc1_fib(&ro->ro_dst, 1, ignore, 0); + ro->ro_rt = rtalloc1_fib(&ro->ro_dst, 1, ignore, RT_DEFAULT_FIB); if (ro->ro_rt) RT_UNLOCK(ro->ro_rt); } @@ -324,7 +328,8 @@ rtalloc_ign_fib(struct route *ro, u_long struct rtentry * rtalloc1(struct sockaddr *dst, int report, u_long ignflags) { - return (rtalloc1_fib(dst, report, ignflags, 0)); + + return (rtalloc1_fib(dst, report, ignflags, RT_DEFAULT_FIB)); } struct rtentry * @@ -339,8 +344,15 @@ rtalloc1_fib(struct sockaddr *dst, int r int needlock; KASSERT((fibnum < rt_numfibs), ("rtalloc1_fib: bad fibnum")); - if (dst->sa_family != AF_INET) /* Only INET supports > 1 fib now */ - fibnum = 0; + switch (dst->sa_family) { + case AF_INET6: + case AF_INET: + /* We support multiple FIBs. */ + break; + default: + fibnum = RT_DEFAULT_FIB; + break; + } rnh = rt_tables_get_rnh(fibnum, dst->sa_family); newrt = NULL; if (rnh == NULL) @@ -486,7 +498,8 @@ rtredirect(struct sockaddr *dst, int flags, struct sockaddr *src) { - rtredirect_fib(dst, gateway, netmask, flags, src, 0); + + rtredirect_fib(dst, gateway, netmask, flags, src, RT_DEFAULT_FIB); } void @@ -617,7 +630,8 @@ out: int rtioctl(u_long req, caddr_t data) { - return (rtioctl_fib(req, data, 0)); + + return (rtioctl_fib(req, data, RT_DEFAULT_FIB)); } /* @@ -647,7 +661,8 @@ rtioctl_fib(u_long req, caddr_t data, u_ struct ifaddr * ifa_ifwithroute(int flags, struct sockaddr *dst, struct sockaddr *gateway) { - return (ifa_ifwithroute_fib(flags, dst, gateway, 0)); + + return (ifa_ifwithroute_fib(flags, dst, gateway, RT_DEFAULT_FIB)); } struct ifaddr * @@ -732,7 +747,9 @@ rtrequest(int req, int flags, struct rtentry **ret_nrt) { - return (rtrequest_fib(req, dst, gateway, netmask, flags, ret_nrt, 0)); + + return (rtrequest_fib(req, dst, gateway, netmask, flags, ret_nrt, + RT_DEFAULT_FIB)); } int @@ -771,7 +788,8 @@ rtrequest_fib(int req, int rt_getifa(struct rt_addrinfo *info) { - return (rt_getifa_fib(info, 0)); + + return (rt_getifa_fib(info, RT_DEFAULT_FIB)); } /* @@ -1029,8 +1047,16 @@ rtrequest1_fib(int req, struct rt_addrin #define senderr(x) { error = x ; goto bad; } KASSERT((fibnum < rt_numfibs), ("rtrequest1_fib: bad fibnum")); - if (dst->sa_family != AF_INET) /* Only INET supports > 1 fib now */ - fibnum = 0; + switch (dst->sa_family) { + case AF_INET6: + case AF_INET: + /* We support multiple FIBs. */ + break; + default: + fibnum = RT_DEFAULT_FIB; + break; + } + /* * Find the correct routing tree to use for this Address Family */ @@ -1135,8 +1161,7 @@ rtrequest1_fib(int req, struct rt_addrin rt->rt_flags = RTF_UP | flags; rt->rt_fibnum = fibnum; /* - * Add the gateway. Possibly re-malloc-ing the storage for it - * + * Add the gateway. Possibly re-malloc-ing the storage for it. */ RT_LOCK(rt); if ((error = rt_setgate(rt, dst, gateway)) != 0) { @@ -1182,12 +1207,15 @@ rtrequest1_fib(int req, struct rt_addrin #ifdef FLOWTABLE rt0 = NULL; - /* XXX - * "flow-table" only support IPv4 at the moment. - * XXX-BZ as of r205066 it would support IPv6. - */ + /* "flow-table" only supports IPv6 and IPv4 at the moment. */ + switch (dst->sa_family) { +#ifdef INET6 + case AF_INET6: +#endif #ifdef INET - if (dst->sa_family == AF_INET) { + case AF_INET: +#endif +#if defined(INET6) || defined(INET) rn = rnh->rnh_matchaddr(dst, rnh); if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { struct sockaddr *mask; @@ -1226,9 +1254,9 @@ rtrequest1_fib(int req, struct rt_addrin } } } +#endif/* INET6 || INET */ } -#endif -#endif +#endif /* FLOWTABLE */ /* XXX mtu manipulation will be done in rnh_addaddr -- itojun */ rn = rnh->rnh_addaddr(ndst, netmask, rnh, rt->rt_nodes); @@ -1249,9 +1277,18 @@ rtrequest1_fib(int req, struct rt_addrin } #ifdef FLOWTABLE else if (rt0 != NULL) { + switch (dst->sa_family) { +#ifdef INET6 + case AF_INET6: + flowtable_route_flush(V_ip6_ft, rt0); + break; +#endif #ifdef INET - flowtable_route_flush(V_ip_ft, rt0); + case AF_INET: + flowtable_route_flush(V_ip_ft, rt0); + break; #endif + } RTFREE(rt0); } #endif @@ -1383,8 +1420,17 @@ rtinit1(struct ifaddr *ifa, int cmd, int dst = ifa->ifa_addr; netmask = ifa->ifa_netmask; } - if ( dst->sa_family != AF_INET) - fibnum = 0; + if (dst->sa_len == 0) + return(EINVAL); + switch (dst->sa_family) { + case AF_INET6: + case AF_INET: + /* We support multiple FIBs. */ + break; + default: + fibnum = RT_DEFAULT_FIB; + break; + } if (fibnum == -1) { if (rt_add_addr_allfibs == 0 && cmd == (int)RTM_ADD) { startfib = endfib = curthread->td_proc->p_fibnum; @@ -1397,8 +1443,6 @@ rtinit1(struct ifaddr *ifa, int cmd, int startfib = fibnum; endfib = fibnum; } - if (dst->sa_len == 0) - return(EINVAL); /* * If it's a delete, check that if it exists, @@ -1422,9 +1466,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int * Now go through all the requested tables (fibs) and do the * requested action. Realistically, this will either be fib 0 * for protocols that don't do multiple tables or all the - * tables for those that do. XXX For this version only AF_INET. - * When that changes code should be refactored to protocol - * independent parts and protocol dependent parts. + * tables for those that do. */ for ( fibnum = startfib; fibnum <= endfib; fibnum++) { if (cmd == RTM_DELETE) { @@ -1564,12 +1606,14 @@ rtinit1(struct ifaddr *ifa, int cmd, int return (error); } +#ifndef BURN_BRIDGES /* special one for inet internal use. may not use. */ int rtinit_fib(struct ifaddr *ifa, int cmd, int flags) { return (rtinit1(ifa, cmd, flags, -1)); } +#endif /* * Set up a routing table entry, normally @@ -1579,7 +1623,7 @@ int rtinit(struct ifaddr *ifa, int cmd, int flags) { struct sockaddr *dst; - int fib = 0; + int fib = RT_DEFAULT_FIB; if (flags & RTF_HOST) { dst = ifa->ifa_dstaddr; @@ -1587,7 +1631,12 @@ rtinit(struct ifaddr *ifa, int cmd, int dst = ifa->ifa_addr; } - if (dst->sa_family == AF_INET) + switch (dst->sa_family) { + case AF_INET6: + case AF_INET: + /* We do support multiple FIBs. */ fib = -1; + break; + } return (rtinit1(ifa, cmd, flags, fib)); } Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Fri Feb 17 01:45:49 2012 (r231851) +++ head/sys/net/route.h Fri Feb 17 02:39:58 2012 (r231852) @@ -111,6 +111,7 @@ struct rt_metrics { #endif #endif +#define RT_DEFAULT_FIB 0 /* Explicitly mark fib=0 restricted cases */ extern u_int rt_numfibs; /* number fo usable routing tables */ /* * XXX kernel function pointer `rt_output' is visible to applications. @@ -405,8 +406,10 @@ void rtredirect(struct sockaddr *, stru int rtrequest(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **); +#ifndef BURN_BRIDGES /* defaults to "all" FIBs */ int rtinit_fib(struct ifaddr *, int, int); +#endif /* XXX MRT NEW VERSIONS THAT USE FIBs * For now the protocol indepedent versions are the same as the AF_INET ones Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Fri Feb 17 01:45:49 2012 (r231851) +++ head/sys/netinet/in.c Fri Feb 17 02:39:58 2012 (r231852) @@ -879,7 +879,7 @@ in_ifinit(struct ifnet *ifp, struct in_i bzero(&ia_ro, sizeof(ia_ro)); *((struct sockaddr_in *)(&ia_ro.ro_dst)) = ia->ia_addr; - rtalloc_ign_fib(&ia_ro, 0, 0); + rtalloc_ign_fib(&ia_ro, 0, RT_DEFAULT_FIB); if ((ia_ro.ro_rt != NULL) && (ia_ro.ro_rt->rt_ifp != NULL) && (ia_ro.ro_rt->rt_ifp == V_loif)) { RT_LOCK(ia_ro.ro_rt); Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Fri Feb 17 01:45:49 2012 (r231851) +++ head/sys/netinet/ipfw/ip_fw2.c Fri Feb 17 02:39:58 2012 (r231852) @@ -496,7 +496,7 @@ search_ip6_addr_net (struct in6_addr * i } static int -verify_path6(struct in6_addr *src, struct ifnet *ifp) +verify_path6(struct in6_addr *src, struct ifnet *ifp, u_int fib) { struct route_in6 ro; struct sockaddr_in6 *dst; @@ -507,9 +507,8 @@ verify_path6(struct in6_addr *src, struc dst->sin6_family = AF_INET6; dst->sin6_len = sizeof(*dst); dst->sin6_addr = *src; - /* XXX MRT 0 for ipv6 at this time */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 03:11:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id AE52B1065672; Fri, 17 Feb 2012 03:11:39 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 590FD1510CC; Fri, 17 Feb 2012 03:11:38 +0000 (UTC) Message-ID: <4F3DC569.40501@FreeBSD.org> Date: Thu, 16 Feb 2012 19:11:37 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0.1) Gecko/20120213 Thunderbird/10.0.1 MIME-Version: 1.0 To: Eitan Adler References: <201202170121.q1H1L8V5043324@svn.freebsd.org> In-Reply-To: <201202170121.q1H1L8V5043324@svn.freebsd.org> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231849 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 03:11:39 -0000 On 02/16/2012 17:21, Eitan Adler wrote: > Style: prefer the use of line continuations to += Thanks! -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 03:23:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 790F41065672; Fri, 17 Feb 2012 03:23:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 689E98FC26; Fri, 17 Feb 2012 03:23:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1H3N2fP047630; Fri, 17 Feb 2012 03:23:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1H3N1SW047628; Fri, 17 Feb 2012 03:23:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202170323.q1H3N1SW047628@svn.freebsd.org> From: Adrian Chadd Date: Fri, 17 Feb 2012 03:23: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: r231854 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 03:23:02 -0000 Author: adrian Date: Fri Feb 17 03:23:01 2012 New Revision: 231854 URL: http://svn.freebsd.org/changeset/base/231854 Log: Begin breaking out the txrx stop code into a locked and unlocked variant. PR: kern/165220 Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Feb 17 03:01:29 2012 (r231853) +++ head/sys/dev/ath/if_ath.c Fri Feb 17 03:23:01 2012 (r231854) @@ -1903,15 +1903,16 @@ ath_stop_locked(struct ifnet *ifp) #define MAX_TXRX_ITERATIONS 1000 static void -ath_txrx_stop(struct ath_softc *sc) +ath_txrx_stop_locked(struct ath_softc *sc) { int i = MAX_TXRX_ITERATIONS; ATH_UNLOCK_ASSERT(sc); + ATH_PCU_LOCK_ASSERT(sc); + /* Stop any new TX/RX from occuring */ taskqueue_block(sc->sc_tq); - ATH_PCU_LOCK(sc); /* * Sleep until all the pending operations have completed. * @@ -1925,7 +1926,6 @@ ath_txrx_stop(struct ath_softc *sc) msleep(sc, &sc->sc_pcu_mtx, 0, "ath_txrx_stop", 1); i--; } - ATH_PCU_UNLOCK(sc); if (i <= 0) device_printf(sc->sc_dev, @@ -1935,6 +1935,17 @@ ath_txrx_stop(struct ath_softc *sc) #undef MAX_TXRX_ITERATIONS static void +ath_txrx_stop(struct ath_softc *sc) +{ + ATH_UNLOCK_ASSERT(sc); + ATH_PCU_UNLOCK_ASSERT(sc); + + ATH_PCU_LOCK(sc); + ath_txrx_stop_locked(sc); + ATH_PCU_UNLOCK(sc); +} + +static void ath_txrx_start(struct ath_softc *sc) { From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 03:25:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14855106564A; Fri, 17 Feb 2012 03:25:27 +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 01FA58FC16; Fri, 17 Feb 2012 03:25:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1H3PQV0047760; Fri, 17 Feb 2012 03:25:26 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1H3PQR1047757; Fri, 17 Feb 2012 03:25:26 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202170325.q1H3PQR1047757@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 17 Feb 2012 03:25: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: r231855 - head/tools/regression/sockets/so_setfib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 03:25:27 -0000 Author: bz Date: Fri Feb 17 03:25:26 2012 New Revision: 231855 URL: http://svn.freebsd.org/changeset/base/231855 Log: Add regression tests for the setsockopt(2) SO_SETFIB socket option. Check that the expected domain(9) families all handle the socket option correctly and do proper bounds checks. This would catch bugs as fixed in (r230938,)r230981. Sponsored by: Cisco Systems, Inc. Added: head/tools/regression/sockets/so_setfib/ head/tools/regression/sockets/so_setfib/Makefile (contents, props changed) head/tools/regression/sockets/so_setfib/so_setfib.c (contents, props changed) head/tools/regression/sockets/so_setfib/so_setfib.t (contents, props changed) Added: head/tools/regression/sockets/so_setfib/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/so_setfib/Makefile Fri Feb 17 03:25:26 2012 (r231855) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +PROG= so_setfib +NO_MAN= +WARNS?= 6 + +.ifdef INET6 +CFLAGS+= -DINET6 +.endif +.ifdef INET +CFLAGS+= -DINET +.endif + +.include Added: head/tools/regression/sockets/so_setfib/so_setfib.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/so_setfib/so_setfib.c Fri Feb 17 03:25:26 2012 (r231855) @@ -0,0 +1,189 @@ +/*- + * Copyright (c) 2012 Cisco Systems, Inc. + * All rights reserved. + * + * This software was developed by Bjoern Zeeb under contract to + * Cisco Systems, 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Regression test on SO_SETFIB setsockopt(2). + * + * Check that the expected domain(9) families all handle the socket option + * correctly and do proper bounds checks. + * + * Test plan: + * 1. Get system wide number of FIBs from sysctl and convert to index (-= 1). + * 2. For each protocol family (INET, INET6, ROUTE and LOCAL) open socketes of + * type (STREAM, DGRAM and RAW) as supported. + * 3. Do a sequence of -2, -1, 0, .. n, n+1, n+2 SO_SETFIB sockopt calls, + * expecting the first two and last two to fail (valid 0 ... n). + * 4. Try 3 random numbers. Calculate result based on valid range. + * 5. Repeat for next domain family and type from (2) on. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +static struct t_dom { + int domain; + const char *name; +} t_dom[] = { +#ifdef INET6 + { .domain = PF_INET6, .name = "PF_INET6" }, +#endif +#ifdef INET + { .domain = PF_INET, .name = "PF_INET" }, +#endif + { .domain = PF_ROUTE, .name = "PF_ROUTE" }, + { .domain = PF_LOCAL, .name = "PF_LOCAL" }, +}; + +static struct t_type { + int type; + const char *name; +} t_type[] = { + { .type = SOCK_STREAM, .name = "SOCK_STREAM" }, + { .type = SOCK_DGRAM, .name = "SOCK_DGRAM" }, + { .type = SOCK_RAW, .name = "SOCK_RAW" }, +}; + +/* + * Number of FIBs as read from net.fibs sysctl - 1. Initialize to clear out of + * bounds value to not accidentally run on a limited range. + */ +static int rt_numfibs = -42; + +/* Number of test case. */ +static int testno = 1; + + +/* + * Try the setsockopt with given FIB number i on socket s. + * Handle result given on error and valid range and errno. + */ +static void +so_setfib(int s, int i, u_int dom, u_int type) +{ + int error; + + error = setsockopt(s, SOL_SOCKET, SO_SETFIB, &i, sizeof(i)); + /* For out of bounds we expect an error. */ + if (error == -1 && (i < 0 || i > rt_numfibs)) + printf("ok %d %s_%s_%d\n", testno, t_dom[dom].name, + t_type[type].name, i); + else if (error != -1 && (i < 0 || i > rt_numfibs)) + printf("not ok %d %s_%s_%d # setsockopt(%d, SOL_SOCKET, " + "SO_SETFIB, %d, ..) unexpectedly succeeded\n", testno, + t_dom[dom].name, t_type[type].name, i, s, i); + else if (error == 0) + printf("ok %d %s_%s_%d\n", testno, t_dom[dom].name, + t_type[type].name, i); + else if (errno != EINVAL) + printf("not ok %d %s_%s_%d # setsockopt(%d, SOL_SOCKET, " + "SO_SETFIB, %d, ..) unexpected error: %s\n", testno, + t_dom[dom].name, t_type[type].name, i, s, i, + strerror(errno)); + else + printf("not ok %d %s_%s_%d\n", testno, t_dom[dom].name, + t_type[type].name, i); + + /* Test run done, next please. */ + testno++; +} + +/* + * Main test. Open socket given domain family and type. For each FIB, out of + * bounds FIB numbers and 3 random FIB numbers set the socket option. + */ +static void +t(u_int dom, u_int type) +{ + int i, s; + + /* PF_ROUTE only supports RAW socket types, while PF_LOCAL does not. */ + if (t_dom[dom].domain == PF_ROUTE && t_type[type].type != SOCK_RAW) + return; + if (t_dom[dom].domain == PF_LOCAL && t_type[type].type == SOCK_RAW) + return; + + /* Open socket for given combination. */ + s = socket(t_dom[dom].domain, t_type[type].type, 0); + if (s == -1) { + printf("not ok %d %s_%s # socket(): %s\n", testno, + t_dom[dom].name, t_type[type].name, strerror(errno)); + return; + } + + /* Test FIBs -2, -1, 0, .. n, n + 1, n + 2. */ + for (i = -2; i <= (rt_numfibs + 2); i++) + so_setfib(s, i, dom, type); + + /* Test 3 random FIB numbers. */ + for (i = 0; i < 3; i++) + so_setfib(s, (int)random(), dom, type); + + /* Close socket. */ + close(s); +} + +/* + * Returns 0 if no program error, 1 on sysctlbyname error. + * Test results are communicated by printf("[not ]ok .."). + */ +int +main(int argc __unused, char *argv[] __unused) +{ + u_int i, j; + size_t s; + + /* Initalize randomness. */ + srandomdev(); + + /* Get number of FIBs supported by kernel. */ + s = sizeof(rt_numfibs); + if (sysctlbyname("net.fibs", &rt_numfibs, &s, NULL, 0) == -1) + err(1, "sysctlbyname(net.fibs, ..)"); + /* Adjust from number to index. */ + rt_numfibs -= 1; + + /* Run tests. */ + for (i = 0; i < sizeof(t_dom) / sizeof(struct t_dom); i++) + for (j = 0; j < sizeof(t_type) / sizeof(struct t_type); j++) + t(i, j); + + return (0); +} + +/* end */ Added: head/tools/regression/sockets/so_setfib/so_setfib.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/so_setfib/so_setfib.t Fri Feb 17 03:25:26 2012 (r231855) @@ -0,0 +1,59 @@ +#!/bin/sh +#- +# Copyright (c) 2012 Cisco Systems, Inc. +# All rights reserved. +# +# This software was developed by Bjoern Zeeb under contract to +# Cisco Systems, 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. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +cd `dirname $0` + +EXECUTABLE=`basename $0 .t` + +FIBS=`sysctl -n net.fibs` +INET=`sysctl -n kern.features.inet` +INET6=`sysctl -n kern.features.inet6` + +case "${INET}" in +1) OPTS="${OPTS} -DINET" ;; +*) INET=0 ;; +esac +case "${INET6}" in +1) OPTS="${OPTS} -DINET6" ;; +*) INET6=0 ;; +esac + +make ${EXECUTABLE} ${OPTS} 2>&1 > /dev/null + +# two out of bounds on each side + 3 random +FIBS=$((2 + FIBS + 2 + 3)) +# ROUTE and LOCAL are 1 domain together given 2 or 1 types only +TESTS=$(((1 + ${INET} + ${INET6}) * 3 * ${FIBS})) + +echo "1..${TESTS}" + +exec ./${EXECUTABLE} From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 03:46:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2F6C106566B; Fri, 17 Feb 2012 03:46:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B89048FC1B; Fri, 17 Feb 2012 03:46:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1H3kckm048481; Fri, 17 Feb 2012 03:46:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1H3kcv0048479; Fri, 17 Feb 2012 03:46:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202170346.q1H3kcv0048479@svn.freebsd.org> From: Adrian Chadd Date: Fri, 17 Feb 2012 03:46: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: r231857 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 03:46:39 -0000 Author: adrian Date: Fri Feb 17 03:46:38 2012 New Revision: 231857 URL: http://svn.freebsd.org/changeset/base/231857 Log: Enforce some consistent ordering and handling of interrupt disable/enable with RX/TX halting. * Always disable/enable interrupts during a channel change, just to simply things. * Ensure that the ath taskqueue has completed and is paused before continuing. This dramatically reduces the instances of overlapping RX and reset conditions. PR: kern/165220 Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Feb 17 03:39:06 2012 (r231856) +++ head/sys/dev/ath/if_ath.c Fri Feb 17 03:46:38 2012 (r231857) @@ -1934,6 +1934,7 @@ ath_txrx_stop_locked(struct ath_softc *s } #undef MAX_TXRX_ITERATIONS +#if 0 static void ath_txrx_stop(struct ath_softc *sc) { @@ -1944,6 +1945,7 @@ ath_txrx_stop(struct ath_softc *sc) ath_txrx_stop_locked(sc); ATH_PCU_UNLOCK(sc); } +#endif static void ath_txrx_start(struct ath_softc *sc) @@ -2049,11 +2051,12 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T ATH_UNLOCK_ASSERT(sc); ATH_PCU_LOCK(sc); + ath_hal_intrset(ah, 0); /* disable interrupts */ + ath_txrx_stop_locked(sc); /* Ensure TX/RX is stopped */ if (ath_reset_grablock(sc, 1) == 0) { device_printf(sc->sc_dev, "%s: concurrent reset! Danger!\n", __func__); } - ath_hal_intrset(ah, 0); /* disable interrupts */ ATH_PCU_UNLOCK(sc); /* @@ -2061,7 +2064,6 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T * and block future ones from occuring. This needs to be * done before the TX queue is drained. */ - ath_txrx_stop(sc); ath_draintxq(sc, reset_type); /* stop xmit side */ /* @@ -5383,21 +5385,16 @@ ath_chan_set(struct ath_softc *sc, struc struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; int ret = 0; - int dointr = 0; /* Treat this as an interface reset */ ATH_PCU_LOCK(sc); + ath_hal_intrset(ah, 0); /* Stop new RX/TX completion */ + ath_txrx_stop_locked(sc); /* Stop pending RX/TX completion */ if (ath_reset_grablock(sc, 1) == 0) { device_printf(sc->sc_dev, "%s: concurrent reset! Danger!\n", __func__); } - if (chan != sc->sc_curchan) { - dointr = 1; - /* XXX only do this if inreset_cnt is 1? */ - ath_hal_intrset(ah, 0); - } ATH_PCU_UNLOCK(sc); - ath_txrx_stop(sc); DPRINTF(sc, ATH_DEBUG_RESET, "%s: %u (%u MHz, flags 0x%x)\n", __func__, ieee80211_chan2ieee(ic, chan), @@ -5466,10 +5463,10 @@ ath_chan_set(struct ath_softc *sc, struc ath_beacon_config(sc, NULL); } -#if 0 /* * Re-enable interrupts. */ +#if 0 ath_hal_intrset(ah, sc->sc_imask); #endif } @@ -5478,8 +5475,7 @@ finish: ATH_PCU_LOCK(sc); sc->sc_inreset_cnt--; /* XXX only do this if sc_inreset_cnt == 0? */ - if (dointr) - ath_hal_intrset(ah, sc->sc_imask); + ath_hal_intrset(ah, sc->sc_imask); ATH_PCU_UNLOCK(sc); /* XXX do this inside of IF_LOCK? */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 03:50:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2FCE106566C; Fri, 17 Feb 2012 03:50:25 +0000 (UTC) (envelope-from lists@eitanadler.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 4692A8FC19; Fri, 17 Feb 2012 03:50:23 +0000 (UTC) Received: by wgbdq11 with SMTP id dq11so2350548wgb.31 for ; Thu, 16 Feb 2012 19:50:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=Hjaq/9WaC5U0YHtQ8kM3GduSRyKNEGl6kaK7Gg8sWpo=; b=MSpGOudvzngYxHzXXa65H9TF1S3JdOiIzu8rQLd4BJRx7856lFOYohQjjFl6B4xlOB xsf0GKLu+lpnywFGIPczU4lgT4RHO7QzwyXC4gxjujyF83aKY4NYGB7ZxLoHfw6r7afE o3QxC2YhN+LPQuaMWX6N9ng5lVJoc3m8v9Ihs= Received: by 10.216.138.234 with SMTP id a84mr2825542wej.40.1329450623249; Thu, 16 Feb 2012 19:50:23 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.15.90 with HTTP; Thu, 16 Feb 2012 19:49:53 -0800 (PST) In-Reply-To: <4F3D9D03.6020507@FreeBSD.org> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> From: Eitan Adler Date: Thu, 16 Feb 2012 22:49:53 -0500 X-Google-Sender-Auth: WINN2QE1n0Co7S75ojDc3aVOTJU Message-ID: To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmPzRNzlY8hQbLvteFGcEo81Z1aSwBju889ByW3/YBvZUC1sFW7dxBgrIIZbO97p+w02m4F Cc: marcel@freebsd.org, svn-src-all@freebsd.org, "Kenneth D. Merry" , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 03:50:25 -0000 Replying to the thread so people don't think I'm ignoring it. I will likely have time this weekend to fix the errors and come up with a patch. On Thu, Feb 16, 2012 at 7:19 PM, Andriy Gapon wrote: > on 17/02/2012 02:08 Kenneth D. Merry said the following: > [snip] >>>> On Thu, Feb 16, 2012 at 11:13:09 +0200, Andriy Gapon wrote: > [snip] >>>>> For me personally the immediate benefits in the common situations >>>>> outweighed the >>>>> problems in the edge cases, although I still believe that we can get = the >>>>> former >>>>> without sacrifices in the latter. > [snip] >> It sounds fine, but I don't have sufficient time to spend on this right >> now. =C2=A0So I can either back out the changes I mentioned above (assum= ing we >> get agreement from avg), or leave things as is. > > I stick to what I wrote above and so chose the status quo. > The backout would make sense if it is immediately followed by commit of a= better > solution. =C2=A0Unfortunately, a lack of time here too. > > P.S. > Nobody yet complained about actually running into an edge case, while I > personally know at least one person to whom the intermingled messages cau= sed > some grief, especially given that they happened in /var/log/security. > > -- > Andriy Gapon > --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 03:57:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E98A1065670; Fri, 17 Feb 2012 03:57:06 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 243A88FC0C; Fri, 17 Feb 2012 03:57:04 +0000 (UTC) Received: by werm13 with SMTP id m13so2527532wer.13 for ; Thu, 16 Feb 2012 19:57:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=+CRTTl88fZGjd1Vcp4x7/uCEPLOvxZmSTGHRxCStI5M=; b=VJqVcmpiRf1F+PMCf4LiiCLwNmy347xK4I16S/sYUwg+bnsL6ZYL15TsjOLP2yPyun bGHMIcEvilEnnaFzqbG7lXEYps8zdhTXN+ISqVOILagrTUu9ISflDMs1i6zSH+AYCdjI N3Vk6BpB20pAfbBmtQawmrdmA91Fmvb9fgoFA= Received: by 10.180.77.228 with SMTP id v4mr743985wiw.2.1329451024189; Thu, 16 Feb 2012 19:57:04 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.15.90 with HTTP; Thu, 16 Feb 2012 19:56:34 -0800 (PST) In-Reply-To: <20120216.164332.2209961872967607025.hrs@allbsd.org> References: <201202160517.q1G5H6Z0000155@svn.freebsd.org> <201202160517.q1G5H14i000118@svn.freebsd.org> <20120216.164332.2209961872967607025.hrs@allbsd.org> From: Eitan Adler Date: Thu, 16 Feb 2012 22:56:34 -0500 X-Google-Sender-Auth: sokSp9cPrty2vxqHi_O2yYuEXpk Message-ID: To: Hiroki Sato Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQn1ntCqS4wT+S7KvdRjw3l5mV1u+7XiUhjYwY3Ud62KjoC0323bU8avNci/oDMtcG+ziIOm Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231817 - head/usr.sbin/IPXrouted X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 03:57:06 -0000 On Thu, Feb 16, 2012 at 2:43 AM, Hiroki Sato wrote: > Eitan Adler wrote > =C2=A0The oldroute is still used in the #ifdef section at the end of this > =C2=A0function. :( I will try to come up with a fix this weekend. > =C2=A0This file was from NetBSD and this change just increased the diff. > I do not understand why the prototype declaration of MCReadCat() was > =C2=A0left while the main body was removed. My fault, I should have removed both (if the commit was valid in the first place). > =C2=A0IMHO it is not a good idea to remove unused code partially like thi= s > =C2=A0or unused code in one from another project if you just want to > =C2=A0suppress a compiler warning. I have a slightly larger goal in mind: a usable world built with gcc46. How soon, if ever, we will see this goal realized is a different question. It would be nice to not be restricted to one (or two) compiler options. > It may suppress the warning, but > =C2=A0remaining bits in comments and/or conditional parts where the > =C2=A0compiler does not complain make developers confused. =C2=A0I think = it is > =C2=A0more harmful than the warning. I need to be more vigilant about ensuring that I am not removing useful code. This warning is either indicative of a bug or results in useless code. There are some cases where fixing the warning results in problems but I try to avoid them, but a few inevitably slip through. --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 03:57:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DA911065675; Fri, 17 Feb 2012 03:57:50 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 851E18FC14; Fri, 17 Feb 2012 03:57:49 +0000 (UTC) Received: by wibhn14 with SMTP id hn14so2006482wib.13 for ; Thu, 16 Feb 2012 19:57:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=4ieiy2lHXKlttA/qaHNv4YvwpfuwRYolDwWehHkKhZM=; b=QJmKINknMnAyE7NqmjmPwyunBeUJlpGpE+CRzjzCuBB1luoFpQ5CI0YqUmHmTJFE12 b2TLoJd/rxO/mCXXhkNphUZxmREGY5tFSBt9VPkq33xyEovzPU4o726eYO0d1XdR+6qG 5vhAicgkxNOcIEs13Sg6CRKsWc6AuHPnsaLSM= Received: by 10.180.107.99 with SMTP id hb3mr752408wib.5.1329451068619; Thu, 16 Feb 2012 19:57:48 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.15.90 with HTTP; Thu, 16 Feb 2012 19:57:18 -0800 (PST) In-Reply-To: <20120216194921.X1656@besplex.bde.org> References: <201202160517.q1G5H6Z0000155@svn.freebsd.org> <20120216.164332.2209961872967607025.hrs@allbsd.org> <20120216194921.X1656@besplex.bde.org> From: Eitan Adler Date: Thu, 16 Feb 2012 22:57:18 -0500 X-Google-Sender-Auth: sFq9qfJV0wH61CIfJbyo_P0ssjo Message-ID: To: Bruce Evans Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmMKDXOHVCCWKN6PUcSYQiO2OJWwtSGL1PJ5+tUZfxrpWv1F7DA8aAyw8dil5LsMRs8S7gQ Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , src-committers@freebsd.org Subject: Re: svn commit: r231817 - head/usr.sbin/IPXrouted X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 03:57:50 -0000 On Thu, Feb 16, 2012 at 3:56 AM, Bruce Evans wrote: > This is another example of the phenomenon that small bikesheds are the > hardest to paint :-). =C2=A0It is surprisingly difficult to make many sma= ll > harmless-looking changes correctly without knowing their full context, > since just determining their full context may take a day or three. > Each. And yet the painting still needs to be done. --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 04:23:50 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F36E106579D; Fri, 17 Feb 2012 04:23:50 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id B929E8FC21; Fri, 17 Feb 2012 04:23:49 +0000 (UTC) Received: from [172.23.7.53] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q1H4Nf4f099191 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 16 Feb 2012 20:23:48 -0800 (PST) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201202170121.q1H1L8V5043324@svn.freebsd.org> Date: Thu, 16 Feb 2012 20:23:38 -0800 Content-Transfer-Encoding: 7bit Message-Id: <71F4F826-D4A4-497E-9716-B51F983698D3@xcllnt.net> References: <201202170121.q1H1L8V5043324@svn.freebsd.org> To: Eitan Adler X-Mailer: Apple Mail (2.1257) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231849 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 04:23:50 -0000 On Feb 16, 2012, at 5:21 PM, Eitan Adler wrote: > Author: eadler > Date: Fri Feb 17 01:21:08 2012 > New Revision: 231849 > URL: http://svn.freebsd.org/changeset/base/231849 > > Log: > Style: prefer the use of line continuations to += Thanks Eitan! -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 04:26:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DF46106566C; Fri, 17 Feb 2012 04:26:25 +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 5BB488FC16; Fri, 17 Feb 2012 04:26:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1H4QP4Y049772; Fri, 17 Feb 2012 04:26:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1H4QP02049768; Fri, 17 Feb 2012 04:26:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202170426.q1H4QP02049768@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 17 Feb 2012 04:26: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: r231858 - in head/tools/test: . netfibs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 04:26:25 -0000 Author: bz Date: Fri Feb 17 04:26:24 2012 New Revision: 231858 URL: http://svn.freebsd.org/changeset/base/231858 Log: Add regression tests scripts for multi-IP FIBs exercising the send, receive and forward path tagging packets with both the ifconfig fib option or using ipfw, running ICMP6, TCP/v6 and UDP/v6 tests and testing both setfib(2) as well as the SO_SETFIB socket option. At 16 FIBs a total of over 64k return codes/replies/stati are checked, sometimes multiple times (in different ways, e.g. the reflected request as well as ipfw counter values). The scripts need two or three machines to run and are thus not added to the tools/regression framework but only to tools/test. Sponsored by: Cisco Systems, Inc. Added: head/tools/test/netfibs/ head/tools/test/netfibs/Makefile (contents, props changed) head/tools/test/netfibs/README (contents, props changed) head/tools/test/netfibs/forwarding.sh (contents, props changed) head/tools/test/netfibs/initiator.sh (contents, props changed) head/tools/test/netfibs/reflect.c (contents, props changed) head/tools/test/netfibs/reflector.sh (contents, props changed) Modified: head/tools/test/README Modified: head/tools/test/README ============================================================================== --- head/tools/test/README Fri Feb 17 03:46:38 2012 (r231857) +++ head/tools/test/README Fri Feb 17 04:26:24 2012 (r231858) @@ -10,5 +10,6 @@ Please make a subdir per program, and ad devrandom Programs to test /dev/*random. dtrace DTrace test suite malloc A program to test and benchmark malloc(). +netfibs Programs to test multi-FIB network stacks. posixshm A program to test POSIX shared memory. testfloat Programs to test floating-point implementations Added: head/tools/test/netfibs/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/netfibs/Makefile Fri Feb 17 04:26:24 2012 (r231858) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= reflect +NO_MAN= +WARNS?= 6 + +.include Added: head/tools/test/netfibs/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/netfibs/README Fri Feb 17 04:26:24 2012 (r231858) @@ -0,0 +1,64 @@ +# $FreeBSD$ + +This directory holds scripts and a support program for multiple test cases +exercising multi-IP FIBs. At this time only IPv6 test cases are provided. + +Makefile +reflect.c + + Makefile just builds reflect, a program to echo data on a TCP or UDP + socket in very simplistic ways. It has a couple of options to provide + an address or port, a FIB to bind to or a FIB to add to a reflected + message as well as some "magic" keyword handling to let the intiators + control it. + +initiator.sh and reflector.sh + + intiator.sh runs two local test cases, one which shows a documented + limitation. + + All further tests are either exercising the sending or receiving of + ICMP6, TCP or UDP packets with multiple FIBs. initiator.sh and + reflector.sh must run on two different nodes both having a network + interface in the same broadcast domain (be it cross-over or on a + bridge/switch). The tests will use the IPv6 benchmarking working + group (BMWG) prefix. The prefix is hard coded into some tests. + Control messages will synchronize reflector with initiator. The + reflector needs the reflect binary. Apart from that the scripts + depend on ping6, netcat, awk, tr and ipfw. The interface to use can + be set from the environment. The commands can be run like: + + env IFACE=ifname sh intiator.sh + env IFACE=ifname sh reflector.sh + + Both scripts also support a DEBUG environment variable for additional + output. A special value of 42 will enable sh(1) xtrace printing. + + The output format is modeled after Test::Harness Perl as used in + tools/regression/ but not always complaint following the test case name. + + NOTE: at the time of writing reflector.sh can trigger kernel races + unrelated to multi-FIB test leading to a panic(9). "delay" calls + are used to mitigate the problem some but are not always good enough. + It is suggested to run one test case at a time manually disabling + the others in both scripts. + +forwarding.sh + + forwarding.sh tests FIBs in the forwarding path, making sure that + packets tagged on input are leaving on the correct FIB. + The script must be run on three nodes with both edge nodes (left + and right) being connected to the middle node on separate interfaces. + + The script operates on the same principles and requirements as the + two afore described ones. Environment options equally apply, with + the middle node also taking an IFACEFAR variable to name the interface + to the right. See the ASCII art at the beginning of the script for + details. The script needs to be told which node it is running with + the first argument: + + env IFACE=ifname sh forwarding.sh left + env IFACE=leftifname IFACEFAR=rightifname sh forwarding.sh middle + env IFACE=ifname sh forwarding.sh right + +# end Added: head/tools/test/netfibs/forwarding.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/netfibs/forwarding.sh Fri Feb 17 04:26:24 2012 (r231858) @@ -0,0 +1,1652 @@ +#!/bin/sh +#- +# Copyright (c) 2012 Cisco Systems, Inc. +# All rights reserved. +# +# This software was developed by Bjoern Zeeb under contract to +# Cisco Systems, 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. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# Test setup: +# +# left ------------------------- middle ------------------------- right +# IFACE IFACE IFACEFAR IFACE +# LEFTADDR MIDDLELEFTADDR MIDDLERIGHTADDR RIGHTADDR +# forwarding=1 +# initiator FIB tests reflector + +# We will use the RFC5180 (and Errata) benchmarking working group prefix +# 2001:0002::/48 for testing. +PREFIX="2001:2:" + +# Set IFACE to the real interface you want to run the test on. +# IFACEFAR is only relevant on the middle (forwarding) node and will be the +# 'right' side (far end) one. +: ${IFACE:=lo0} +: ${IFACEFAR:=lo0} + +# Number of seconds to wait for peer node to synchronize for test. +: ${WAITS:=120} + +# Control port we use to exchange messages between nodes to sync. tests, etc. +: ${CTRLPORT:=6666} + +# Get the number of FIBs from the kernel. +RT_NUMFIBS=`sysctl -n net.fibs` + +# This is the initiator and connected middle node. +LEFTADDR="2001:2:fe00::1" +MIDDLELEFTADDR="2001:2:fe00::2" +# This is the far end middle node and receiver side. +MIDDLERIGHTADDR="2001:2:ff00::1" +RIGHTADDR="2001:2:ff00::2" + +# By default all commands must succeed. Individual tests may disable this +# temporary. +set -e + +# Debug magic. +case "${DEBUG}" in +42) set -x ;; +esac + + +################################################################################ +# +# Input validation. +# + +node=$1 +case ${node} in +left) ;; +middle) ;; +right) ;; +*) echo "ERROR: invalid node name '${node}'. Must be left, middle or" \ + " right" >&1 + exit 1 + ;; +esac + +################################################################################ +# +# Helper functions. +# +check_rc() +{ + local _rc _exp _testno _testname _msg _r + _rc=$1 + _exp=$2 + _testno=$3 + _testname="$4" + _msg="$5" + + _r="not ok" + if test ${_rc} -eq ${_exp}; then + _r="ok" + fi + echo "${_r} ${_testno} ${_testname} # ${_msg} ${_rc} ${_exp}" +} + +print_debug() +{ + local _msg + _msg="$*" + + case ${DEBUG} in + ''|0) ;; + *) echo "DEBUG: ${_msg}" >&2 ;; + esac +} + +die() +{ + local _msg + _msg="$*" + + echo "ERROR: ${_msg}" >&2 + exit 1 +} + + +################################################################################ +# +# Functions to configure networking and do a basic reachability check. +# + +setup_networking() +{ + + print_debug "Setting up networking" + case ${node} in + left) ifconfig ${IFACE} inet6 ${LEFTADDR}/64 -alias \ + > /dev/null 2>&1 || true + ifconfig ${IFACE} inet6 ${LEFTADDR}/64 alias up + ifconfig ${IFACE} fib 0 + sysctl net.inet6.ip6.forwarding=0 > /dev/null + route delete -net -inet6 default > /dev/null 2>&1 || true + route delete -host -inet6 ${RIGHTADDR} ${MIDDLELEFTADDR} \ + > /dev/null 2>&1 || true + route add -host -inet6 ${RIGHTADDR} ${MIDDLELEFTADDR} \ + > /dev/null + route delete -host -inet6 ${MIDDLERIGHTADDR} ${MIDDLELEFTADDR} \ + > /dev/null 2>&1 || true + route add -host -inet6 ${MIDDLERIGHTADDR} ${MIDDLELEFTADDR} \ + > /dev/null 2>&1 || true + ;; + middle) ifconfig ${IFACE} inet6 ${MIDDLELEFTADDR}/64 -alias \ + > /dev/null 2>&1 || true + ifconfig ${IFACE} inet6 ${MIDDLELEFTADDR}/64 alias up + ifconfig ${IFACE} fib 0 + ifconfig ${IFACEFAR} inet6 ${MIDDLERIGHTADDR}/64 -alias \ + > /dev/null 2>&1 || true + ifconfig ${IFACEFAR} inet6 ${MIDDLERIGHTADDR}/64 alias up + ifconfig ${IFACEFAR} fib 0 + sysctl net.inet6.ip6.forwarding=1 > /dev/null + ;; + right) ifconfig ${IFACE} inet6 ${RIGHTADDR}/64 -alias \ + > /dev/null 2>&1 || true + ifconfig ${IFACE} inet6 ${RIGHTADDR}/64 alias up + ifconfig ${IFACE} fib 0 + sysctl net.inet6.ip6.forwarding=0 > /dev/null + route delete -net -inet6 default > /dev/null 2>&1 || true + route delete -host -inet6 ${LEFTADDR} ${MIDDLERIGHTADDR} \ + > /dev/null 2>&1 || true + route add -host -inet6 ${LEFTADDR} ${MIDDLERIGHTADDR} \ + > /dev/null + route delete -host -inet6 ${MIDDLELEFTADDR} ${MIDDLERIGHTADDR} \ + > /dev/null 2>&1 || true + route add -host -inet6 ${MIDDLELEFTADDR} ${MIDDLERIGHTADDR} \ + > /dev/null + ;; + esac + + # Let things settle. + print_debug "Waiting 4 seconds for things to settle" + sleep 4 +} + +cleanup_networking() +{ + + case ${node} in + left) ifconfig ${IFACE} inet6 ${LEFTADDR}/64 -alias + ;; + middle) ifconfig ${IFACE} inet6 ${MIDDLELEFTADDR}/64 -alias + ifconfig ${IFACEFAR} inet6 ${MIDDLERIGHTADDR}/64 -alias + sysctl net.inet6.ip6.forwarding=0 > /dev/null + ;; + right) ifconfig ${IFACE} inet6 ${RIGHTADDR}/64 -alias + ;; + esac + print_debug "Cleaned up networking" +} + +_reachability_check() +{ + local _addr _rc + _addr="$1" + + ping6 -n -c1 ${_addr} > /dev/null 2>&1 + _rc=$? + case ${_rc} in + 0) ;; + *) print_debug "cannot ping6 ${_addr}, rc=${_rc}" + return 1 + ;; + esac + return 0 +} + +reachability_check() +{ + local _i _rc + + # Try to reach all control addresses on other nodes. + # We need to loop for a while as we cannot expect all to be up + # the very same moment. + i=1 + _rc=42 + while test ${_rc} -ne 0 -a ${i} -le ${WAITS}; do + print_debug "${i}/${WAITS} trying to ping6 control addresses." + _rc=0 + set +e + case ${node} in + left) _reachability_check ${MIDDLELEFTADDR} + _rc=$((_rc + $?)) + _reachability_check ${MIDDLERIGHTADDR} + _rc=$((_rc + $?)) + _reachability_check ${RIGHTADDR} + _rc=$((_rc + $?)) + ;; + middle) _reachability_check ${LEFTADDR} + _rc=$((_rc + $?)) + _reachability_check ${RIGHTADDR} + _rc=$((_rc + $?)) + ;; + right) _reachability_check ${MIDDLERIGHTADDR} + _rc=$((_rc + $?)) + _reachability_check ${MIDDLELEFTADDR} + _rc=$((_rc + $?)) + _reachability_check ${LEFTADDR} + _rc=$((_rc + $?)) + ;; + esac + set -e + sleep 1 + i=$((i + 1)) + done +} + +################################################################################ +# +# "Greeting" handling to sync notes to the agreed upon next test case. +# +send_control_msg() +{ + local _case _addr i rc _msg _keyword _fibs + _case="$1" + _addr="$2" + + set +e + i=0 + rc=-1 + while test ${i} -lt ${WAITS} -a ${rc} -ne 0; do + print_debug "Sending control msg #${i} to peer ${_addr}" + _msg=`echo "${_case} ${RT_NUMFIBS}" | \ + nc -6 -w 1 ${_addr} ${CTRLPORT}` + rc=$? + i=$((i + 1)) + # Might sleep longer in total but better than to DoS + # and not get anywhere. + sleep 1 + done + set -e + + read _keyword _fibs < /dev/null 2>&1 + _ec=$? + # We need to normalize the exit code of ping6. + case ${_ec} in + 0) ;; + *) _ec=1 ;; + esac + check_rc ${_ec} ${_rc} ${_testno} "${_txt}" "FIB ${i} ${_addr}" + testno=$((testno + 1)) + i=$((i + 1)) + done + set -e +} + +test_ulp_reflect_one() +{ + local _txt _opts _port _fib + _txt="$1" + _opts="$2" + _port=$3 + _fib=$4 + + print_debug "./reflect -p $((_port + 1 + _fib)) -t ${_txt}" "${_opts}" + ./reflect -p $((_port + 1 + _fib)) -t ${_txt} ${_opts} + print_debug "reflect '${_txt}' terminated without error." +} + +test_ulp_reflect_multiple() +{ + local _maxfibs _txt _opts i _jobs _p + _maxfibs=$1 + _txt="$2" + _opts="$3" + + i=0 + _jobs="" + while test ${i} -lt ${_maxfibs}; do + print_debug "./reflect -p $((CTRLPORT + 1000 + i))" \ + "-t ${_txt} ${_opts} -N -f ${i} &" + ./reflect -p $((CTRLPORT + 1000 + i)) \ + -t ${_txt} ${_opts} -N -f ${i} & + _p=$! + _jobs="${_jobs}${_p} " + i=$((i + 1)) + done + + # Start OOB control connection for START/DONE. + testrx_run_one "${_txt}" "${_opts}" + print_debug "KILL ${_jobs}" + for i in ${_jobs}; do + kill ${i} || true + done + #killall reflect || true + print_debug "reflects for '${_txt}' terminated without error." +} + +nc_send_recv() +{ + local _loops _msg _expreply _addr _port _opts i + _loops=$1 + _msg="$2" + _expreply="$3" + _addr=$4 + _port=$5 + _opts="$6" + + i=0 + while test ${i} -lt ${_loops}; do + i=$((i + 1)) + print_debug "e ${_msg} | nc -6 -w1 ${_opts} ${_addr} ${_port}" + _reply=`echo "${_msg}" | nc -6 -w1 ${_opts} ${_addr} ${_port}` + if test "${_reply}" != "${_expreply}"; then + if test ${i} -lt ${_loops}; then + sleep 1 + else + # Must let caller decide how to handle the error. + # die "Got invalid reply from peer." \ + # "Expected '${_expreply}', got '${_reply}'" + return 1 + fi + else + break + fi + done + return 0 +} + +test_ulp() +{ + local _maxfibs _msg _addr _port _fib i _txt testno _rc _reply + _maxfibs=$1 + _msg="$2" + _addr=$3 + _port=$4 + _fib=$5 + + printf "1..%d\n" $((${_maxfibs} * 2)) + testno=1 + i=0 + while test ${i} -lt ${_maxfibs}; do + + if test ${i} -eq $((${_maxfibs} - 1)); then + # Last one; signal DONE. + _txt="DONE ${_msg}_${i}" + else + _txt="DONE ${_msg}_${i}" + fi + + eval _rc="\${rc_${i}}" + + # Test TCP. + nc_send_recv ${_maxfibs} "${_txt}" "${_txt}" ${_addr} \ + $((${_port} + 1 + _fib)) "" + check_rc $? ${_rc} ${testno} "${_msg}_${i}_tcp" \ + "[${_addr}]:$((${_port} + 1 + _fib)) ${_reply}" + testno=$((testno + 1)) + sleep 1 + + # Test UDP. + nc_send_recv ${_maxfibs} "${_txt}" "${_txt}" ${_addr} \ + $((${_port} + 1 + _fib)) "-u" + check_rc $? ${_rc} ${testno} "${_msg}_${i}_udp" \ + "[${_addr}]:$((${_port} + 1 + _fib)) ${_reply}" + sleep 1 + + i=$((i + 1)) + testno=$((testno + 1)) + done +} + +setup_ipfw_count() +{ + local i _port _maxfib _p _fib _ofib + _port=$1 + _maxfib=$2 + _fib=$3 + _ofib=$4 + + i=0 + while test ${i} -lt ${_maxfib}; do + + case ${_ofib} in + -1) _p=$((_port + 1 + i)) ;; + *) _p=$((_port + 1 + _maxfib - 1 - i)) ;; + esac + + # Only count ICMP6 echo replies. + ipfw add $((10000 + i)) count ipv6-icmp from any to any \ + icmp6types 129 fib ${i} via ${IFACE} out > /dev/null + ipfw add $((10000 + i)) count tcp from any to any \ + src-port ${_p} fib ${i} via ${IFACE} out > /dev/null + ipfw add $((10000 + i)) count udp from any to any \ + src-port ${_p} fib ${i} via ${IFACE} out > /dev/null + + # Only count ICMP6 echo requests. + ipfw add $((20000 + i)) count ipv6-icmp from any to any \ + icmp6types 128 fib ${i} via ${IFACEFAR} out > /dev/null + ipfw add $((20000 + i)) count tcp from any to any \ + dst-port $((${_port} + 1 + i)) fib ${i} \ + via ${IFACEFAR} out > /dev/null + ipfw add $((20000 + i)) count udp from any to any \ + dst-port $((${_port} + 1 + i)) fib ${i} \ + via ${IFACEFAR} out > /dev/null + + i=$((i + 1)) + done +} + +report_ipfw_count() +{ + local _fib _o i _rstr _c _req _p _opts + _o="$2" + + case ${DEBUG} in + ''|0) ;; + *) ipfw show ;; + esac + + _rstr="RESULTS " + for _base in 10000 20000; do + for _o in i t u; do + case ${_base} in + 10000) _rstr="${_rstr}\nLEFT " ;; + 20000) _rstr="${_rstr}\nRIGHT " ;; + esac + case ${_o} in + i) _rstr="${_rstr}ICMP6 " ;; + t) _rstr="${_rstr}TCP " ;; + u) _rstr="${_rstr}UDP " ;; + esac + i=0 + while test ${i} -lt ${RT_NUMFIBS}; do + + case "${_o}" in + i) _c=`ipfw show $((${_base} + i)) | \ + awk '/ ipv6-icmp / { print $2 }'` ;; + t) _c=`ipfw show $((${_base} + i)) | \ + awk '/ tcp / { print $2 }'` ;; + u) _c=`ipfw show $((${_base} + i)) | \ + awk '/ udp / { print $2 }'` ;; + esac + _rstr="${_rstr}${i} ${_c}," + + i=$((i + 1)) + done + done + i=0 + while test ${i} -lt ${RT_NUMFIBS}; do + ipfw delete $((${_base} + i)) > /dev/null 2>&1 || true + i=$((i + 1)) + done + done + + # We do not care about the request. + _req=`printf "${_rstr}" | nc -6 -l $((${CTRLPORT} - 1))` + print_debug "$? -- ${_req} -- ${_rstr}" +} + +fetch_ipfw_count() +{ + local _n _reply _line _edge _type _fib _count _rc _ec _status + _n="$1" + + # Leave node some time to build result set. + sleep 3 + + print_debug "Asking for ipfw count results..." + set +e + nc_send_recv 1 "RESULT REQUEST" "" ${MIDDLELEFTADDR} \ + $((${CTRLPORT} - 1)) "" + set -e + case "${_reply}" in + RESULTS\ *) ;; + *) die "Got invalid reply from peer." \ + "Expected 'RESULTS ...', got '${_reply}'" ;; + esac + + # Trim "RESULTS " + _reply=${_reply#* } + + # FIBs * {left, right} * {icmp6, tcp, udp} + printf "1..%d\n" $((RT_NUMFIBS * 2 * 3)) + testno=1 + while read _line; do + print_debug "_line == ${_line}" + _edge=${_line%% *} + _line=${_line#* } + _type=${_line%% *} + _line=${_line#* } + + while read _fib _count; do + eval _em="\${rc_${_n}_${_edge}_${_type}_${_fib}}" + : ${_em:=-42} + if test ${_count} -gt 0; then + _rc=1 + else + _rc=0 + fi + if test ${_rc} -eq ${_em}; then + _status="ok" + else + _status="not ok" + fi + printf "%s %d %s # count=%s _rc=%d _em=%d\n" \ + "${_status}" ${testno} "${_n}_${_edge}_${_type}_${_fib}" \ + ${_count} ${_rc} ${_em} + testno=$((testno + 1)) + done < /dev/null + # Nothing to do for the middle node testing the default. + sleep 1 + wait_remote_ready "STOP_${_n}" + report_ipfw_count +} + +_fwd_default_fib_symmetric_right() +{ + local _n + _n="$1" + + wait_remote_ready "START_${_n}" + + # No need to do anything for ICMPv6. + # Start reflect for TCP and UDP. + test_ulp_reflect_one "${_n}_tcp" "-N -T TCP6" 0 ${CTRLPORT} + test_ulp_reflect_one "${_n}_udp" "-N -T UDP6" 0 ${CTRLPORT} + + wait_remote_ready "STOP_${_n}" +} + +fwd_default_fib_symmetric() +{ + local _n + + _n="fwd_default_fib_symmetric" + + print_debug "${_n}" + case ${node} in + left) _fwd_default_fib_symmetric_left ${_n} ;; + middle) _fwd_default_fib_symmetric_middle ${_n} ;; + right) _fwd_default_fib_symmetric_right ${_n} ;; + esac +} + +_fwd_default_fib_symmetric_middle_ifconfig() +{ + local _n + _n="$1" + + ifconfig ${IFACE} fib 0 + ifconfig ${IFACEFAR} fib 0 + setup_ipfw_count ${CTRLPORT} ${RT_NUMFIBS} 0 -1 + wait_remote_ready "START_${_n}" + ipfw -q zero > /dev/null + # Nothing to do for the middle node testing the default. + sleep 1 + wait_remote_ready "STOP_${_n}" + report_ipfw_count +} + +fwd_default_fib_symmetric_ifconfig() +{ + local _n + + _n="fwd_default_fib_symmetric_ifconfig" + + print_debug "${_n}" + case ${node} in + left) _fwd_default_fib_symmetric_left ${_n} ;; + middle) _fwd_default_fib_symmetric_middle_ifconfig ${_n} ;; + right) _fwd_default_fib_symmetric_right ${_n} ;; + esac +} + +_fwd_default_fib_symmetric_middle_ipfw() +{ + local _n + _n="$1" + + ipfw add 100 setfib 0 ipv6-icmp from any to any \ + icmp6types 128 via ${IFACE} in > /dev/null + ipfw add 100 setfib 0 ip6 from any to any \ + proto tcp dst-port ${CTRLPORT} via ${IFACE} in > /dev/null + ipfw add 100 setfib 0 ip6 from any to any \ + proto udp dst-port ${CTRLPORT} via ${IFACE} in > /dev/null + + ipfw add 100 setfib 0 ipv6-icmp from any to any \ + icmp6types 128 via ${IFACEFAR} in > /dev/null + ipfw add 100 setfib 0 tcp from any to any \ + dst-port ${CTRLPORT} via ${IFACEFAR} in > /dev/null + ipfw add 100 setfib 0 udp from any to any \ + dst-port ${CTRLPORT} via ${IFACEFAR} in > /dev/null + + setup_ipfw_count ${CTRLPORT} ${RT_NUMFIBS} 0 -1 + wait_remote_ready "START_${_n}" + ipfw -q zero > /dev/null + # Nothing to do for the middle node testing the default. + sleep 1 + wait_remote_ready "STOP_${_n}" + report_ipfw_count + + ipfw delete 100 > /dev/null +} + +fwd_default_fib_symmetric_ipfw() +{ + local _n + + _n="fwd_default_fib_symmetric_ipfw" + + print_debug "${_n}" + case ${node} in + left) _fwd_default_fib_symmetric_left ${_n} ;; + middle) _fwd_default_fib_symmetric_middle_ipfw ${_n} ;; + right) _fwd_default_fib_symmetric_right ${_n} ;; + esac +} + +################################################################################ + +_fwd_fib_symmetric_results() +{ + local _n _fib i _edge _type _rc + _n="$1" + _fib=$2 + + i=0 + while test ${i} -lt ${RT_NUMFIBS}; do + for _edge in "LEFT" "RIGHT"; do + for _type in "ICMP6" "TCP" "UDP"; do + + case ${i} in + ${_fib}) eval rc_${_n}_${_edge}_${_type}_${i}=1 + #print_debug \ + # "rc_${_n}_${_edge}_${_type}_${i}=1" + ;; + *) eval rc_${_n}_${_edge}_${_type}_${i}=0 + #print_debug \ + # "rc_${_n}_${_edge}_${_type}_${i}=0" + ;; + esac + + done + done + i=$((i + 1)) + done +} + +_fwd_fib_symmetric_left() +{ + local _n _maxfib i + _n="$1" + _maxfib=$2 + + # Setup expected return code + i=0 + while test ${i} -lt ${_maxfib}; do + eval rc_${i}=0 + i=$((i + 1)) + done + + # Initiate probes for ICMP6, TCP and UDP. + i=0 + while test ${i} -lt ${_maxfib}; do + + sleep 1 + + send_control_msgs "START_${_n}_${i}" + + test_icmp6 1 ${RIGHTADDR} "${_n}_${i}_icmp6" + test_ulp 1 "${_n}_${i}" ${RIGHTADDR} ${CTRLPORT} ${i} + + send_control_msgs "STOP_${_n}_${i}" + _fwd_fib_symmetric_results "${_n}_${i}" ${i} + fetch_ipfw_count "${_n}_${i}" + i=$((i + 1)) + done +} + +_fwd_fib_symmetric_right() +{ + local _n _maxfib i + _n="$1" + _maxfib=$2 + + i=0 + while test ${i} -lt ${_maxfib}; do + wait_remote_ready "START_${_n}_${i}" + + # No need to do anything for ICMPv6. + # Start reflect for TCP and UDP. + test_ulp_reflect_one "${_n}_tcp" "-N -T TCP6" ${i} ${CTRLPORT} + test_ulp_reflect_one "${_n}_udp" "-N -T UDP6" ${i} ${CTRLPORT} + + wait_remote_ready "STOP_${_n}_${i}" + i=$((i + 1)) + done +} + +_fwd_fib_symmetric_middle_ifconfig() +{ + local _n _maxfib i + _n="$1" + _maxfib=$2 + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 04:49:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FC8D1065673; Fri, 17 Feb 2012 04:49:27 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id E14768FC0A; Fri, 17 Feb 2012 04:49:26 +0000 (UTC) Received: from [172.23.7.53] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q1H4n9OJ099284 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 16 Feb 2012 20:49:17 -0800 (PST) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=iso-8859-1 From: Marcel Moolenaar In-Reply-To: <4F3D9D03.6020507@FreeBSD.org> Date: Thu, 16 Feb 2012 20:49:05 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> To: Andriy Gapon X-Mailer: Apple Mail (2.1257) Cc: marcel@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, "Kenneth D. Merry" , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 04:49:27 -0000 On Feb 16, 2012, at 4:19 PM, Andriy Gapon wrote: > on 17/02/2012 02:08 Kenneth D. Merry said the following: > [snip] >>>> On Thu, Feb 16, 2012 at 11:13:09 +0200, Andriy Gapon wrote: > [snip] >>>>> For me personally the immediate benefits in the common situations=20= >>>>> outweighed the >>>>> problems in the edge cases, although I still believe that we can = get the=20 >>>>> former >>>>> without sacrifices in the latter. > [snip] >> It sounds fine, but I don't have sufficient time to spend on this = right >> now. So I can either back out the changes I mentioned above = (assuming we >> get agreement from avg), or leave things as is. >=20 > I stick to what I wrote above and so chose the status quo. > The backout would make sense if it is immediately followed by commit = of a better > solution. Unfortunately, a lack of time here too. I think we should lift above the immediate problem and allow for single- and multi-line messages that are atomically appended to the message buffer. Console output and propagation of messages outside of the kernel should all come out of the message buffer and preserving the atomicity of the messages. The message buffer does not have to be a chunk of memory that we circularly scribble to. It can be a per-cpu linked list of messages even. The advantage of thinking along these lines is that: 1. Console output can be made optional very easily, allowing us to implement quiet boots without loosing the ability to look at messages collected during boot. 2. Atomicity allows us to parse the messages reliably, which works very well in the embedded space where monitoring of kernel messages is common. 3. You can decouple writing into the message buffer from extracting messages out of the message buffer, allowing the low-level console to become just another channel to send messages to, rather than be fundamental for printf. 4. A linked list (for example) eliminates the problem of scribbling over old messages and possibly leaving partial output that gets misinterpreted. 5. A per-cpu message buffer eliminates serialization to guarantee atomcity and with timestamping can very easily be turned into a sequential log. 6. We haven't introduced complications (e.g. locking) to solve these problems and that make using printf in low- level code impossible. Thank trap handlers or interrupt handlers. Just a thought that this may be a good time to think bigger or broader and address more problems while we're at it, --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 06:12:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06CB8106566B; Fri, 17 Feb 2012 06:12:36 +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 961908FC08; Fri, 17 Feb 2012 06:12:35 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1H6CVEh010148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Feb 2012 17:12:33 +1100 Date: Fri, 17 Feb 2012 17:12:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh In-Reply-To: <201202162104.q1GL4lLm034261@svn.freebsd.org> Message-ID: <20120217163759.J1187@besplex.bde.org> References: <201202162104.q1GL4lLm034261@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231834 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 06:12:36 -0000 On Thu, 16 Feb 2012, Warner Losh wrote: > Log: > Fix comma splice, can't ambiguity and quoting. > > Submitted by: bde@ > MFC after: 2 weeks Thanks, but this introduces 3 of 4 new style bugs: > Modified: head/share/mk/bsd.kmod.mk > ============================================================================== > --- head/share/mk/bsd.kmod.mk Thu Feb 16 19:40:17 2012 (r231833) > +++ head/share/mk/bsd.kmod.mk Thu Feb 16 21:04:47 2012 (r231834) > @@ -9,7 +9,7 @@ SYSDIR= ${_dir} > .endfor > .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \ > !exists(${SYSDIR}/conf/kmod.mk) > -.error "can't locate the kernel source tree, set SYSDIR to override." > +.error Unable to locate the kernel source tree. Set SYSDIR to override. > .endif 1. I think I asked for more quoting, not less. 2. Error messages are not capitalized in KNF. The existing error messages in *.mk don't provide good examples of following this rule, since they mostly begin with a proper name with its normal case. 3. Sentence breaks are 2 spaces in KNF. This is also the rule in gnu sources. It is a good rule. More than 95% of sentence breaks in gcc/*.c follow it. gnu even requires 2 spaces after '.' before '*/', which made it unnecessary for me to write complicated regexps to check for comformance to the rule in gcc. In the 1996 version of gnu standards.text, it is explained that this is so that the Emacs sentence commands will work. Apparently, Emacs is too small for unsimple regexps :-). gnu standards.text the rules in much more detail than style(9) (or this mail). Even in 1996, it was about 5 times larger than style(9) is now. 4. The rule in (2) is not so good for multiple sentences, but error messages should be single sentences unless they are very long or complicated, but they shouldn't be very long or complicated either. The rule in (3) is null for single sentences in error messages and comments, so code that would otherwise break it is saved by only using single sentences. 5. I think I asked for following the rule for not terminating error messages, but it is consistently not followed in *.mk. gnu style requires complete sentences, (and thus normal capitalization and punctuation) more forcefully than KNF. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 06:47:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15F58106566C; Fri, 17 Feb 2012 06:47:17 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 051558FC0C; Fri, 17 Feb 2012 06:47:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1H6lG8k054290; Fri, 17 Feb 2012 06:47:16 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1H6lGqH054288; Fri, 17 Feb 2012 06:47:16 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201202170647.q1H6lGqH054288@svn.freebsd.org> From: Sean Bruno Date: Fri, 17 Feb 2012 06:47: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: r231860 - head/sys/dev/isci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 06:47:17 -0000 Author: sbruno Date: Fri Feb 17 06:47:16 2012 New Revision: 231860 URL: http://svn.freebsd.org/changeset/base/231860 Log: During work to port isci(4) to stable/7 I noted that the maxio portion of struct ccb_pathinq from sys/cam/cam_ccb.h wasn't added to stable/7 at all and didn't appear in stable/8 until svn R195534. Since __FreeBSD_version did not get bumped until svn R195634, assume that maxio is valid at 800102 or higher. Obtained from: Yahoo! Inc. MFC after: 0 days Modified: head/sys/dev/isci/isci_controller.c Modified: head/sys/dev/isci/isci_controller.c ============================================================================== --- head/sys/dev/isci/isci_controller.c Fri Feb 17 06:26:11 2012 (r231859) +++ head/sys/dev/isci/isci_controller.c Fri Feb 17 06:47:16 2012 (r231860) @@ -549,7 +549,7 @@ void isci_action(struct cam_sim *sim, un cpi->hba_eng_cnt = 0; cpi->max_target = SCI_MAX_REMOTE_DEVICES - 1; cpi->max_lun = ISCI_MAX_LUN; -#if __FreeBSD_version >= 704100 +#if __FreeBSD_version >= 800102 cpi->maxio = isci_io_request_get_max_io_size(); #endif cpi->unit_number = cam_sim_unit(sim); From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 07:44:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38409106579B; Fri, 17 Feb 2012 07:44:10 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id B9E078FC13; Fri, 17 Feb 2012 07:44:09 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id q1H7hskZ017551 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 16 Feb 2012 23:43:55 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4F3E0596.6040808@freebsd.org> Date: Thu, 16 Feb 2012 23:45:26 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.26) Gecko/20120129 Thunderbird/3.1.18 MIME-Version: 1.0 To: Marcel Moolenaar References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> In-Reply-To: <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: marcel@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, "Kenneth D. Merry" , Andriy Gapon , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 07:44:10 -0000 On 2/16/12 8:49 PM, Marcel Moolenaar wrote: > On Feb 16, 2012, at 4:19 PM, Andriy Gapon wrote: > >> on 17/02/2012 02:08 Kenneth D. Merry said the following: >> [snip] >>>>> On Thu, Feb 16, 2012 at 11:13:09 +0200, Andriy Gapon wrote: >> [snip] >>>>>> For me personally the immediate benefits in the common situations >>>>>> outweighed the >>>>>> problems in the edge cases, although I still believe that we can get the >>>>>> former >>>>>> without sacrifices in the latter. >> [snip] >>> It sounds fine, but I don't have sufficient time to spend on this right >>> now. So I can either back out the changes I mentioned above (assuming we >>> get agreement from avg), or leave things as is. >> I stick to what I wrote above and so chose the status quo. >> The backout would make sense if it is immediately followed by commit of a better >> solution. Unfortunately, a lack of time here too. > I think we should lift above the immediate problem and allow for > single- and multi-line messages that are atomically appended to > the message buffer. Console output and propagation of messages > outside of the kernel should all come out of the message buffer > and preserving the atomicity of the messages. > > The message buffer does not have to be a chunk of memory that > we circularly scribble to. It can be a per-cpu linked list of > messages even. > > The advantage of thinking along these lines is that: > 1. Console output can be made optional very easily, allowing > us to implement quiet boots without loosing the ability > to look at messages collected during boot. > 2. Atomicity allows us to parse the messages reliably, which > works very well in the embedded space where monitoring of > kernel messages is common. > 3. You can decouple writing into the message buffer from > extracting messages out of the message buffer, allowing > the low-level console to become just another channel to > send messages to, rather than be fundamental for printf. > 4. A linked list (for example) eliminates the problem of > scribbling over old messages and possibly leaving partial > output that gets misinterpreted. > 5. A per-cpu message buffer eliminates serialization to > guarantee atomcity and with timestamping can very easily > be turned into a sequential log. > 6. We haven't introduced complications (e.g. locking) to > solve these problems and that make using printf in low- > level code impossible. Thank trap handlers or interrupt > handlers. > > Just a thought that this may be a good time to think > bigger or broader and address more problems while we're > at it, that is an intersting thought.. though.. how would you sort them into order for printing? maybe a single atomic 64 bit int that is incremented per message. From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 07:59:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8BA2106566B; Fri, 17 Feb 2012 07:59:37 +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 D42488FC14; Fri, 17 Feb 2012 07:59:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1H7xb1m056665; Fri, 17 Feb 2012 07:59:37 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1H7xbUW056663; Fri, 17 Feb 2012 07:59:37 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202170759.q1H7xbUW056663@svn.freebsd.org> From: Doug Barton Date: Fri, 17 Feb 2012 07:59: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: r231862 - head/etc/defaults X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 07:59:38 -0000 Author: dougb Date: Fri Feb 17 07:59:37 2012 New Revision: 231862 URL: http://svn.freebsd.org/changeset/base/231862 Log: Increase the default shutdown timer to 90 seconds. This will allow certain systems that take a long time to shut down, without adversely affecting things that shut down quickly. It's also 30 seconds less than the default hard limit of 120 seconds in kern.init_shutdown_timeout. PR: conf/109272 Submitted by: Radim Kolar SF.NET Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Fri Feb 17 06:58:40 2012 (r231861) +++ head/etc/defaults/rc.conf Fri Feb 17 07:59:37 2012 (r231862) @@ -24,7 +24,7 @@ rc_debug="NO" # Set to YES to enable debugging output from rc.d rc_info="NO" # Enables display of informational messages at boot. rc_startmsgs="YES" # Show "Starting foo:" messages at boot -rcshutdown_timeout="30" # Seconds to wait before terminating rc.shutdown +rcshutdown_timeout="90" # Seconds to wait before terminating rc.shutdown early_late_divider="FILESYSTEMS" # Script that separates early/late # stages of the boot process. Make sure you know # the ramifications if you change this. From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 08:14:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD62E1065675; Fri, 17 Feb 2012 08:14:53 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id ADB748FC0C; Fri, 17 Feb 2012 08:14:52 +0000 (UTC) Received: by lagz14 with SMTP id z14so5129845lag.13 for ; Fri, 17 Feb 2012 00:14:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=KjkoyB+tjuibbbYFPM/x4/eQDYmykLy8G/VTflHmMl0=; b=DoYDB4MJn6MB68wghECdja5b2mCkiEGyrNTVPWR1JWU/IloZoyG6bbGQ18rCLXGlVF MWDSk72ZrjN+XF3nfarh4Fc9vIkttll3GWxYDaLTqx3JnLxxnOycE+6lLkqevNCMi5SI J60PWLaRcCkS5eLCtQRdwEvDmO74VuB7IUdtc= MIME-Version: 1.0 Received: by 10.112.98.103 with SMTP id eh7mr2169620lbb.81.1329466491167; Fri, 17 Feb 2012 00:14:51 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.152.18.4 with HTTP; Fri, 17 Feb 2012 00:14:51 -0800 (PST) In-Reply-To: <201112291825.pBTIPIrp067447@svn.freebsd.org> References: <201112291825.pBTIPIrp067447@svn.freebsd.org> Date: Fri, 17 Feb 2012 11:14:51 +0300 X-Google-Sender-Auth: 3R9fTRQeO9EvzvyZsRqK8n6b0j0 Message-ID: From: Sergey Kandaurov To: John Baldwin 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: r228966 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 08:14:53 -0000 On 29 December 2011 22:25, John Baldwin wrote: > Author: jhb > Date: Thu Dec 29 18:25:18 2011 > New Revision: 228966 > URL: http://svn.freebsd.org/changeset/base/228966 > > Log: > =A0Use queue(3) macros instead of home-rolled versions in several places = in > =A0the INET6 code. =A0This includes retiring the 'ndpr_next' and 'pfr_nex= t' > =A0macros. > > =A0Submitted by: pluknet (earlier version) > =A0Reviewed by: =A0pluknet > > Modified: > =A0head/sys/netinet/sctp_output.c > =A0head/sys/netinet6/icmp6.c > =A0head/sys/netinet6/in6.c > =A0head/sys/netinet6/in6_ifattach.c > =A0head/sys/netinet6/nd6.c > =A0head/sys/netinet6/nd6.h > =A0head/sys/netinet6/nd6_rtr.c Hi. Do you intend to merge this change to stable branches? --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 08:24:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3CD91065670; Fri, 17 Feb 2012 08:24:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE0AE8FC0A; Fri, 17 Feb 2012 08:24:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1H8OwUj057536; Fri, 17 Feb 2012 08:24:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1H8OwX0057533; Fri, 17 Feb 2012 08:24:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202170824.q1H8OwX0057533@svn.freebsd.org> From: Adrian Chadd Date: Fri, 17 Feb 2012 08:24: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: r231863 - head/tools/tools/ath/athstats X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 08:24:59 -0000 Author: adrian Date: Fri Feb 17 08:24:58 2012 New Revision: 231863 URL: http://svn.freebsd.org/changeset/base/231863 Log: Fix up this local copy of statfoo to support > 128 statistics. This allows all of the athstats statistics to work again. Specifics: * The previous code used chars < 0x80 as printable, and chars >= 0x80 as "statistics" * .. which meant any statistic above 127 would wrap around to 0; * .. so once I added the 802.11n TX/RX statistics to athstats, the tail end of the statistics list weren't accessible. This patch: * adds a define which represents the magic character, rather than a hard coded one * the statistic in question is little endian encoded after the magic character. Notes: * statfoo is useful enough to possibly warrant turning into a library API. Modified: head/tools/tools/ath/athstats/statfoo.c head/tools/tools/ath/athstats/statfoo.h Modified: head/tools/tools/ath/athstats/statfoo.c ============================================================================== --- head/tools/tools/ath/athstats/statfoo.c Fri Feb 17 07:59:37 2012 (r231862) +++ head/tools/tools/ath/athstats/statfoo.c Fri Feb 17 08:24:58 2012 (r231863) @@ -60,7 +60,9 @@ statfoo_setfmt(struct statfoo *sf, const } if (j != 0) sf->fmts[j++] = ' '; - sf->fmts[j++] = 0x80 | i; + sf->fmts[j++] = FMTS_IS_STAT; + sf->fmts[j++] = i & 0xff; + sf->fmts[j++] = (i >> 8) & 0xff; } sf->fmts[j] = '\0'; #undef N @@ -89,10 +91,14 @@ static void statfoo_print_header(struct statfoo *sf, FILE *fd) { const unsigned char *cp; + int i; + const struct fmt *f; for (cp = sf->fmts; *cp != '\0'; cp++) { - if (*cp & 0x80) { - const struct fmt *f = &sf->stats[*cp &~ 0x80]; + if (*cp == FMTS_IS_STAT) { + i = *(++cp); + i |= ((int) *(++cp)) << 8; + f = &sf->stats[i]; fprintf(fd, "%*s", f->width, f->label); } else putc(*cp, fd); @@ -105,11 +111,15 @@ statfoo_print_current(struct statfoo *sf { char buf[32]; const unsigned char *cp; + int i; + const struct fmt *f; for (cp = sf->fmts; *cp != '\0'; cp++) { - if (*cp & 0x80) { - const struct fmt *f = &sf->stats[*cp &~ 0x80]; - if (sf->get_curstat(sf, *cp &~ 0x80, buf, sizeof(buf))) + if (*cp == FMTS_IS_STAT) { + i = *(++cp); + i |= ((int) *(++cp)) << 8; + f = &sf->stats[i]; + if (sf->get_curstat(sf, i, buf, sizeof(buf))) fprintf(fd, "%*s", f->width, buf); } else putc(*cp, fd); @@ -122,11 +132,15 @@ statfoo_print_total(struct statfoo *sf, { char buf[32]; const unsigned char *cp; + const struct fmt *f; + int i; for (cp = sf->fmts; *cp != '\0'; cp++) { - if (*cp & 0x80) { - const struct fmt *f = &sf->stats[*cp &~ 0x80]; - if (sf->get_totstat(sf, *cp &~ 0x80, buf, sizeof(buf))) + if (*cp == FMTS_IS_STAT) { + i = *(++cp); + i |= ((int) *(++cp)) << 8; + f = &sf->stats[i]; + if (sf->get_totstat(sf, i, buf, sizeof(buf))) fprintf(fd, "%*s", f->width, buf); } else putc(*cp, fd); Modified: head/tools/tools/ath/athstats/statfoo.h ============================================================================== --- head/tools/tools/ath/athstats/statfoo.h Fri Feb 17 07:59:37 2012 (r231862) +++ head/tools/tools/ath/athstats/statfoo.h Fri Feb 17 08:24:58 2012 (r231863) @@ -79,6 +79,7 @@ struct statfoo { const char *name; /* statistics name, e.g. wlanstats */ const struct fmt *stats; /* statistics in class */ int nstats; /* number of stats */ +#define FMTS_IS_STAT 0x80 /* the following two bytes are the stat id */ unsigned char fmts[4096]; /* private: compiled stats to display */ STATFOO_DECL_METHODS(struct statfoo *); From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 08:45:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1871A106564A; Fri, 17 Feb 2012 08:45:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03B198FC12; Fri, 17 Feb 2012 08:45:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1H8j8mW058236; Fri, 17 Feb 2012 08:45:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1H8j8TL058234; Fri, 17 Feb 2012 08:45:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202170845.q1H8j8TL058234@svn.freebsd.org> From: Adrian Chadd Date: Fri, 17 Feb 2012 08:45: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: r231864 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 08:45:09 -0000 Author: adrian Date: Fri Feb 17 08:45:08 2012 New Revision: 231864 URL: http://svn.freebsd.org/changeset/base/231864 Log: Fix the return type. Submitted by: arundel Found by: clang/llvm Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Fri Feb 17 08:24:58 2012 (r231863) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Fri Feb 17 08:45:08 2012 (r231864) @@ -446,7 +446,7 @@ ar5416SetCapability(struct ath_hal *ah, pCap->halRxStreams = 2; else pCap->halRxStreams = 1; - return HAL_OK; + return AH_TRUE; case HAL_CAP_TX_CHAINMASK: setting &= ath_hal_eepromGet(ah, AR_EEP_TXMASK, NULL); pCap->halTxChainMask = setting; @@ -454,7 +454,7 @@ ar5416SetCapability(struct ath_hal *ah, pCap->halTxStreams = 2; else pCap->halTxStreams = 1; - return HAL_OK; + return AH_TRUE; default: break; } From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 09:44:32 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90F89106566B; Fri, 17 Feb 2012 09:44:32 +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 85ED48FC0C; Fri, 17 Feb 2012 09:44:29 +0000 (UTC) Received: from porto.starpoint.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 LAA03411; Fri, 17 Feb 2012 11:44:16 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RyKMR-0007Y7-Ik; Fri, 17 Feb 2012 11:44:15 +0200 Message-ID: <4F3E2150.8030504@FreeBSD.org> Date: Fri, 17 Feb 2012 11:43:44 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0) Gecko/20120202 Thunderbird/10.0 MIME-Version: 1.0 To: Marcel Moolenaar , "Kenneth D. Merry" , Julian Elischer References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> In-Reply-To: <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: marcel@FreeBSD.org, Eitan Adler , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans , svn-src-head@FreeBSD.org Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 09:44:32 -0000 Since this issue has generated a sudden interest, I would like to use this opportunity to point my older proposal as well: http://lists.freebsd.org/pipermail/freebsd-arch/2011-August/011405.html Essentially the algorithm is: 1. atomically (CAS) reserve a space in the message data buffer 2. output full message to the reserved space (no contention here) 3. atomically (CAS) append a pointer to the message in the message pointers buffer on 17/02/2012 06:49 Marcel Moolenaar said the following: > I think we should lift above the immediate problem and allow for > single- and multi-line messages that are atomically appended to > the message buffer. Console output and propagation of messages > outside of the kernel should all come out of the message buffer > and preserving the atomicity of the messages. > > The message buffer does not have to be a chunk of memory that > we circularly scribble to. It can be a per-cpu linked list of > messages even. > > The advantage of thinking along these lines is that: > 1. Console output can be made optional very easily, allowing > us to implement quiet boots without loosing the ability > to look at messages collected during boot. > 2. Atomicity allows us to parse the messages reliably, which > works very well in the embedded space where monitoring of > kernel messages is common. > 3. You can decouple writing into the message buffer from > extracting messages out of the message buffer, allowing > the low-level console to become just another channel to > send messages to, rather than be fundamental for printf. > 4. A linked list (for example) eliminates the problem of > scribbling over old messages and possibly leaving partial > output that gets misinterpreted. > 5. A per-cpu message buffer eliminates serialization to > guarantee atomcity and with timestamping can very easily > be turned into a sequential log. > 6. We haven't introduced complications (e.g. locking) to > solve these problems and that make using printf in low- > level code impossible. Thank trap handlers or interrupt > handlers. > > Just a thought that this may be a good time to think > bigger or broader and address more problems while we're > at it, > -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 10:49:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E2231065670; Fri, 17 Feb 2012 10:49:30 +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 1E7268FC20; Fri, 17 Feb 2012 10:49:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1HAnTJF074924; Fri, 17 Feb 2012 10:49:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1HAnTWx074920; Fri, 17 Feb 2012 10:49:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202171049.q1HAnTWx074920@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 17 Feb 2012 10:49: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: r231868 - in head/lib/libc: gen include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 10:49:30 -0000 Author: kib Date: Fri Feb 17 10:49:29 2012 New Revision: 231868 URL: http://svn.freebsd.org/changeset/base/231868 Log: Fetch the aux vector for the static libc, and use the entries to initialize the cache of the system information as it was done for the dynamic libc. This removes several sysctls from the static binary startup. Use the aux vector to fill the single struct dl_phdr_info describing the static binary itself, to implement dl_iterate_phdr(3) for the static binaries. [1] Based on the submission by: John Marino [1] Tested by: flo (sparc64) MFC after: 2 weeks Modified: head/lib/libc/gen/aux.c head/lib/libc/gen/dlfcn.c head/lib/libc/include/libc_private.h Modified: head/lib/libc/gen/aux.c ============================================================================== --- head/lib/libc/gen/aux.c Fri Feb 17 10:39:28 2012 (r231867) +++ head/lib/libc/gen/aux.c Fri Feb 17 10:49:29 2012 (r231868) @@ -1,5 +1,5 @@ /*- - * Copyright 2010 Konstantin Belousov . + * Copyright 2010, 2012 Konstantin Belousov . * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,10 +36,34 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "libc_private.h" -Elf_Auxinfo *__elf_aux_vector; +extern char **environ; +extern int _DYNAMIC; +#pragma weak _DYNAMIC -static pthread_once_t aux_once = PTHREAD_ONCE_INIT; +void *__elf_aux_vector; +static pthread_once_t aux_vector_once = PTHREAD_ONCE_INIT; + +static void +init_aux_vector_once(void) +{ + Elf_Addr *sp; + + sp = (Elf_Addr *)environ; + while (*sp++ != 0) + ; + __elf_aux_vector = (Elf_Auxinfo *)sp; +} +void +__init_elf_aux_vector(void) +{ + + if (&_DYNAMIC != NULL) + return; + _once(&aux_vector_once, init_aux_vector_once); +} + +static pthread_once_t aux_once = PTHREAD_ONCE_INIT; static int pagesize, osreldate, canary_len, ncpus, pagesizes_len; static char *canary, *pagesizes; @@ -86,6 +110,7 @@ _elf_aux_info(int aux, void *buf, int bu { int res; + __init_elf_aux_vector(); if (__elf_aux_vector == NULL) return (ENOSYS); _once(&aux_once, init_aux); Modified: head/lib/libc/gen/dlfcn.c ============================================================================== --- head/lib/libc/gen/dlfcn.c Fri Feb 17 10:39:28 2012 (r231867) +++ head/lib/libc/gen/dlfcn.c Fri Feb 17 10:49:29 2012 (r231868) @@ -34,6 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include "namespace.h" +#include +#include "un-namespace.h" +#include "libc_private.h" static char sorry[] = "Service unavailable"; @@ -138,13 +142,58 @@ _rtld_thread_init(void * li) _rtld_error(sorry); } +static pthread_once_t dl_phdr_info_once = PTHREAD_ONCE_INIT; +static struct dl_phdr_info phdr_info; + +static void +dl_init_phdr_info(void) +{ + Elf_Auxinfo *auxp; + size_t phent; + unsigned int i; + + phent = 0; + for (auxp = __elf_aux_vector; auxp->a_type != AT_NULL; auxp++) { + switch (auxp->a_type) { + case AT_BASE: + phdr_info.dlpi_addr = (Elf_Addr)auxp->a_un.a_ptr; + break; + case AT_EXECPATH: + phdr_info.dlpi_name = (const char *)auxp->a_un.a_ptr; + break; + case AT_PHDR: + phdr_info.dlpi_phdr = + (const Elf_Phdr *)auxp->a_un.a_ptr; + break; + case AT_PHENT: + phent = auxp->a_un.a_val; + break; + case AT_PHNUM: + phdr_info.dlpi_phnum = (Elf_Half)auxp->a_un.a_val; + break; + } + } + for (i = 0; i < phdr_info.dlpi_phnum; i++) { + if (phdr_info.dlpi_phdr[i].p_type == PT_TLS) { + phdr_info.dlpi_tls_modid = 1; + phdr_info.dlpi_tls_data = + (void*)phdr_info.dlpi_phdr[i].p_vaddr; + } + } + phdr_info.dlpi_adds = 1; +} + #pragma weak dl_iterate_phdr int dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *), void *data) { - _rtld_error(sorry); - return 0; + + __init_elf_aux_vector(); + if (__elf_aux_vector == NULL) + return (1); + _once(&dl_phdr_info_once, dl_init_phdr_info); + return (callback(&phdr_info, sizeof(phdr_info), data)); } #pragma weak fdlopen Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Fri Feb 17 10:39:28 2012 (r231867) +++ head/lib/libc/include/libc_private.h Fri Feb 17 10:49:29 2012 (r231868) @@ -44,6 +44,15 @@ extern int __isthreaded; /* + * Elf_Auxinfo *__elf_aux_vector, the pointer to the ELF aux vector + * provided by kernel. Either set for us by rtld, or found at runtime + * on stack for static binaries. + * + * Type is void to avoid polluting whole libc with ELF types. + */ +extern void *__elf_aux_vector; + +/* * libc should use libc_dlopen internally, which respects a global * flag where loading of new shared objects can be restricted. */ @@ -229,6 +238,7 @@ int _execvpe(const char *, char * const int _elf_aux_info(int aux, void *buf, int buflen); struct dl_phdr_info; int __elf_phdr_match_addr(struct dl_phdr_info *, void *); +void __init_elf_aux_vector(void); void _pthread_cancel_enter(int); void _pthread_cancel_leave(int); From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 10:51:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3ABF51065672; Fri, 17 Feb 2012 10:51:41 +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 254D38FC15; Fri, 17 Feb 2012 10:51:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1HApfxd075042; Fri, 17 Feb 2012 10:51:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1HApedV075040; Fri, 17 Feb 2012 10:51:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202171051.q1HApedV075040@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 17 Feb 2012 10:51: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: r231869 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 10:51:41 -0000 Author: kib Date: Fri Feb 17 10:51:40 2012 New Revision: 231869 URL: http://svn.freebsd.org/changeset/base/231869 Log: Document dl_iterate_phdr(3). Man page is based on the OpenBSD version, extended and corrected for the FreeBSD implementation. MFC after: 2 weeks Added: head/lib/libc/gen/dl_iterate_phdr.3 (contents, props changed) Added: head/lib/libc/gen/dl_iterate_phdr.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/dl_iterate_phdr.3 Fri Feb 17 10:51:40 2012 (r231869) @@ -0,0 +1,115 @@ +.\" Copyright (c) 2005 Mark Kettenis +.\" Copyright (c) 2012 Konstantin Belousov +.\" +.\" 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 THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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. +.\" +.\" $OpenBSD: dl_iterate_phdr.3,v 1.3 2007/05/31 19:19:48 jmc Exp $ +.\" $FreeBSD$ +.Dd February 15, 2012 +.Dt DL_ITERATE_PHDR 3 +.Os +.Sh NAME +.Nm dl_iterate_phdr +.Nd iterate over program headers +.Sh LIBRARY +For the dynamically linked binaries, the service is provided by +.Xr ld-elf.so.1 5 +dynamic linker. +Statically linked programs use an implementation of +.Fn dl_iterate_phdr +from libc. +.Sh SYNOPSIS +.Fd #include +.Ft int +.Fn dl_iterate_phdr "int (*callback)(struct dl_phdr_info *, size_t, void *)" "void *data" +.Sh DESCRIPTION +The +.Fn dl_iterate_phdr +function iterates over all ELF objects loaded into a process's +address space, calling +.Fa callback +for each object, passing it information about the object's +program headers and the +.Fa data +argument. +The iteration is aborted when all objects are passed, or when the next +.Fa callback +call returns non-zero value. +The information about the program headers is passed in a structure +that is defined as: +.Bd -literal +struct dl_phdr_info { + Elf_Addr dlpi_addr; + const char *dlpi_name; + const Elf_Phdr *dlpi_phdr; + Elf_Half dlpi_phnum; + unsigned long long int dlpi_adds; + unsigned long long int dlpi_subs; + size_t dlpi_tls_modid; + void *dlpi_tls_data; +}; +.Ed +.Pp +The members of +.Li struct dl_phdr_info +have the following meaning: +.Bl -tag -width dlpi_tls_modid +.It Fa dlpi_addr +The base address at which the object is mapped into the address +space of the calling process. +.It Fa dlpi_name +The name of the ELF object. +.It Fa dlpi_phdr +A pointer to the object's program headers. +.It Fa dlpi_phnum +The number of program headers in the object. +.It Fa dlpi_adds +The counter of the object loads performed by the dynamic linker. +.It Fa dlpi_subs +The counter of the object unloads performed by the dynamic linker. +.It Fa dlpi_tls_modid +The TLS index of the object. +.It Fa dlpi_tls_data +A pointer to the initialization data for the object TLS segment. +.El +.Pp +Future versions of +.Fx +might add more members to this structure. +To make it possible for programs to check whether any new members have +been added, the size of the structure is passed as an second argument to +.Fa callback . +.Pp +The third argument to callback is the +.Fa data +value passed to the call to +.Fn dl_iterate_phdr , +allowing the +.Fa callback +to have a context. +.Sh RETURN VALUES +The +.Fn dl_iterate_phdr +returns the value returned by the last +.Fa callback +call executed. +.Sh SEE ALSO +.Xr ld 1 , +.Xr ld-elf.so 1 , +.Xr dlopen 3 , +.Xr elf 5 +.Sh HISTORY +The +.Nm +function first appeared in +.Fx 7.0 . From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 11:09:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24ADE1065672; Fri, 17 Feb 2012 11:09:52 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B9398FC1A; Fri, 17 Feb 2012 11:09:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1HB9pIG075733; Fri, 17 Feb 2012 11:09:51 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1HB9pLp075700; Fri, 17 Feb 2012 11:09:51 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201202171109.q1HB9pLp075700@svn.freebsd.org> From: Christian Brueffer Date: Fri, 17 Feb 2012 11:09: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: r231871 - head/lib/libpmc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 11:09:52 -0000 Author: brueffer Date: Fri Feb 17 11:09:51 2012 New Revision: 231871 URL: http://svn.freebsd.org/changeset/base/231871 Log: Switch the license boilerplates to our standard one. Advantages: - Reduces the number of different license versions in the tree - Eliminates a typo - Removes some incorrect author attributions due to c/p - Removes c/p error potential for future pmc manpages Approved by: jkoshy, gnn, rpaulo, fabient (copyright holders) MFC after: 1 week Modified: head/lib/libpmc/pmc.3 head/lib/libpmc/pmc.atom.3 head/lib/libpmc/pmc.core.3 head/lib/libpmc/pmc.core2.3 head/lib/libpmc/pmc.corei7.3 head/lib/libpmc/pmc.corei7uc.3 head/lib/libpmc/pmc.iaf.3 head/lib/libpmc/pmc.k7.3 head/lib/libpmc/pmc.k8.3 head/lib/libpmc/pmc.mips.3 head/lib/libpmc/pmc.p4.3 head/lib/libpmc/pmc.p5.3 head/lib/libpmc/pmc.p6.3 head/lib/libpmc/pmc.tsc.3 head/lib/libpmc/pmc.ucf.3 head/lib/libpmc/pmc.westmere.3 head/lib/libpmc/pmc.westmereuc.3 head/lib/libpmc/pmc.xscale.3 head/lib/libpmc/pmc_allocate.3 head/lib/libpmc/pmc_attach.3 head/lib/libpmc/pmc_capabilities.3 head/lib/libpmc/pmc_configure_logfile.3 head/lib/libpmc/pmc_disable.3 head/lib/libpmc/pmc_event_names_of_class.3 head/lib/libpmc/pmc_get_driver_stats.3 head/lib/libpmc/pmc_get_msr.3 head/lib/libpmc/pmc_init.3 head/lib/libpmc/pmc_name_of_capability.3 head/lib/libpmc/pmc_read.3 head/lib/libpmc/pmc_set.3 head/lib/libpmc/pmc_start.3 head/lib/libpmc/pmclog.3 Modified: head/lib/libpmc/pmc.3 ============================================================================== --- head/lib/libpmc/pmc.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.atom.3 ============================================================================== --- head/lib/libpmc/pmc.atom.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.atom.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.core.3 ============================================================================== --- head/lib/libpmc/pmc.core.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.core.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.core2.3 ============================================================================== --- head/lib/libpmc/pmc.core2.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.core2.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.corei7.3 ============================================================================== --- head/lib/libpmc/pmc.corei7.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.corei7.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.corei7uc.3 ============================================================================== --- head/lib/libpmc/pmc.corei7uc.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.corei7uc.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.iaf.3 ============================================================================== --- head/lib/libpmc/pmc.iaf.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.iaf.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.k7.3 ============================================================================== --- head/lib/libpmc/pmc.k7.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.k7.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.k8.3 ============================================================================== --- head/lib/libpmc/pmc.k8.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.k8.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.mips.3 ============================================================================== --- head/lib/libpmc/pmc.mips.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.mips.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 ``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 George Neville-Neil be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.p4.3 ============================================================================== --- head/lib/libpmc/pmc.p4.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.p4.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.p5.3 ============================================================================== --- head/lib/libpmc/pmc.p5.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.p5.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.p6.3 ============================================================================== --- head/lib/libpmc/pmc.p6.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.p6.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.tsc.3 ============================================================================== --- head/lib/libpmc/pmc.tsc.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.tsc.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.ucf.3 ============================================================================== --- head/lib/libpmc/pmc.ucf.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.ucf.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.westmere.3 ============================================================================== --- head/lib/libpmc/pmc.westmere.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.westmere.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.westmereuc.3 ============================================================================== --- head/lib/libpmc/pmc.westmereuc.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.westmereuc.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc.xscale.3 ============================================================================== --- head/lib/libpmc/pmc.xscale.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc.xscale.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Rui Paulo ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc_allocate.3 ============================================================================== --- head/lib/libpmc/pmc_allocate.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc_allocate.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc_attach.3 ============================================================================== --- head/lib/libpmc/pmc_attach.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc_attach.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc_capabilities.3 ============================================================================== --- head/lib/libpmc/pmc_capabilities.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc_capabilities.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc_configure_logfile.3 ============================================================================== --- head/lib/libpmc/pmc_configure_logfile.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc_configure_logfile.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc_disable.3 ============================================================================== --- head/lib/libpmc/pmc_disable.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc_disable.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc_event_names_of_class.3 ============================================================================== --- head/lib/libpmc/pmc_event_names_of_class.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc_event_names_of_class.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc_get_driver_stats.3 ============================================================================== --- head/lib/libpmc/pmc_get_driver_stats.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc_get_driver_stats.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc_get_msr.3 ============================================================================== --- head/lib/libpmc/pmc_get_msr.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc_get_msr.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc_init.3 ============================================================================== --- head/lib/libpmc/pmc_init.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc_init.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc_name_of_capability.3 ============================================================================== --- head/lib/libpmc/pmc_name_of_capability.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc_name_of_capability.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc_read.3 ============================================================================== --- head/lib/libpmc/pmc_read.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc_read.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc_set.3 ============================================================================== --- head/lib/libpmc/pmc_set.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc_set.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmc_start.3 ============================================================================== --- head/lib/libpmc/pmc_start.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmc_start.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" Modified: head/lib/libpmc/pmclog.3 ============================================================================== --- head/lib/libpmc/pmclog.3 Fri Feb 17 10:54:09 2012 (r231870) +++ head/lib/libpmc/pmclog.3 Fri Feb 17 11:09:51 2012 (r231871) @@ -9,17 +9,17 @@ .\" 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 Joseph Koshy ``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 Joseph Koshy be liable -.\" for any direct, indirect, incidental, special, exemplary, or consequential -.\" damages (including, but not limited to, procurement of substitute goods -.\" or services; loss of use, data, or profits; or business interruption) -.\" however caused and on any theory of liability, whether in contract, strict -.\" liability, or tort (including negligence or otherwise) arising in any way -.\" out of the use of this software, even if advised of the possibility of -.\" such damage. +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 09:00:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DD841065670; Fri, 17 Feb 2012 09:00:02 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 86D7C8FC13; Fri, 17 Feb 2012 09:00:01 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 40BEC987; Fri, 17 Feb 2012 09:59:59 +0100 (CET) Date: Fri, 17 Feb 2012 09:58:41 +0100 From: Pawel Jakub Dawidek To: Marcel Moolenaar Message-ID: <20120217085840.GC1358@garage.freebsd.pl> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4ZLFUWh1odzi/v6L" Content-Disposition: inline In-Reply-To: <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Fri, 17 Feb 2012 12:25:38 +0000 Cc: marcel@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, "Kenneth D. Merry" , Andriy Gapon , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 09:00:02 -0000 --4ZLFUWh1odzi/v6L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 16, 2012 at 08:49:05PM -0800, Marcel Moolenaar wrote: >=20 > On Feb 16, 2012, at 4:19 PM, Andriy Gapon wrote: >=20 > > on 17/02/2012 02:08 Kenneth D. Merry said the following: > > [snip] > >>>> On Thu, Feb 16, 2012 at 11:13:09 +0200, Andriy Gapon wrote: > > [snip] > >>>>> For me personally the immediate benefits in the common situations= =20 > >>>>> outweighed the > >>>>> problems in the edge cases, although I still believe that we can ge= t the=20 > >>>>> former > >>>>> without sacrifices in the latter. > > [snip] > >> It sounds fine, but I don't have sufficient time to spend on this right > >> now. So I can either back out the changes I mentioned above (assuming= we > >> get agreement from avg), or leave things as is. > >=20 > > I stick to what I wrote above and so chose the status quo. > > The backout would make sense if it is immediately followed by commit of= a better > > solution. Unfortunately, a lack of time here too. >=20 > I think we should lift above the immediate problem and allow for > single- and multi-line messages that are atomically appended to > the message buffer. Console output and propagation of messages > outside of the kernel should all come out of the message buffer > and preserving the atomicity of the messages. >=20 > The message buffer does not have to be a chunk of memory that > we circularly scribble to. It can be a per-cpu linked list of > messages even. >=20 > The advantage of thinking along these lines is that: > 1. Console output can be made optional very easily, allowing > us to implement quiet boots without loosing the ability > to look at messages collected during boot. > 2. Atomicity allows us to parse the messages reliably, which > works very well in the embedded space where monitoring of > kernel messages is common. > 3. You can decouple writing into the message buffer from > extracting messages out of the message buffer, allowing > the low-level console to become just another channel to > send messages to, rather than be fundamental for printf. > 4. A linked list (for example) eliminates the problem of > scribbling over old messages and possibly leaving partial > output that gets misinterpreted. > 5. A per-cpu message buffer eliminates serialization to > guarantee atomcity and with timestamping can very easily > be turned into a sequential log. > 6. We haven't introduced complications (e.g. locking) to > solve these problems and that make using printf in low- > level code impossible. Thank trap handlers or interrupt > handlers. I agree with everything except for per-CPU buffers. I understand the need for using printf in low-level code and it indeed complicates things. The reason I don't like the idea of per-CPU buffers is that locking would allow me to implement atomicity across multiple printfs. For example I often use macros like this: #define G_MIRROR_DEBUG(lvl, ...) do { \ if (g_mirror_debug >=3D (lvl)) { \ printf("GEOM_MIRROR"); \ if (g_mirror_debug > 0) \ printf("[%u]", lvl); \ printf(": "); \ printf(__VA_ARGS__); \ printf("\n"); \ } \ } while (0) And I'd like all the printfs to be committed as one message without using some additional buffer first and then single printf. With some kind of printf-lock we could use recursive locking to achieve this. In your proposal I may run each printf on different CPU. I could eventually use sched_pin() around all printfs, I guess. This still doesn't cover the case when I'm preempted between my printfs, so maybe I need critical section there? I don't expect printf should be fast, so it might be ok. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --4ZLFUWh1odzi/v6L Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8+FsAACgkQForvXbEpPzQcJACgiaK7w82zbqkIwkPBI7ON3H0U jFcAoO0InQnDuQVaZLSGvqrX6jE28OLo =NhlN -----END PGP SIGNATURE----- --4ZLFUWh1odzi/v6L-- From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 09:06:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12B10106566B; Fri, 17 Feb 2012 09:06:10 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id CE34F8FC21; Fri, 17 Feb 2012 09:06:09 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id q1H95tuV017826 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 17 Feb 2012 01:05:56 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4F3E18CE.1010700@freebsd.org> Date: Fri, 17 Feb 2012 01:07:26 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.26) Gecko/20120129 Thunderbird/3.1.18 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> <20120217085840.GC1358@garage.freebsd.pl> In-Reply-To: <20120217085840.GC1358@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Fri, 17 Feb 2012 12:25:39 +0000 Cc: marcel@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, "Kenneth D. Merry" , Andriy Gapon , Marcel Moolenaar , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 09:06:10 -0000 On 2/17/12 12:58 AM, Pawel Jakub Dawidek wrote: > On Thu, Feb 16, 2012 at 08:49:05PM -0800, Marcel Moolenaar wrote: >> On Feb 16, 2012, at 4:19 PM, Andriy Gapon wrote: >> >>> on 17/02/2012 02:08 Kenneth D. Merry said the following: >>> [snip] >>>>>> On Thu, Feb 16, 2012 at 11:13:09 +0200, Andriy Gapon wrote: >>> [snip] >>>>>>> For me personally the immediate benefits in the common situations >>>>>>> outweighed the >>>>>>> problems in the edge cases, although I still believe that we can get the >>>>>>> former >>>>>>> without sacrifices in the latter. >>> [snip] >>>> It sounds fine, but I don't have sufficient time to spend on this right >>>> now. So I can either back out the changes I mentioned above (assuming we >>>> get agreement from avg), or leave things as is. >>> I stick to what I wrote above and so chose the status quo. >>> The backout would make sense if it is immediately followed by commit of a better >>> solution. Unfortunately, a lack of time here too. >> I think we should lift above the immediate problem and allow for >> single- and multi-line messages that are atomically appended to >> the message buffer. Console output and propagation of messages >> outside of the kernel should all come out of the message buffer >> and preserving the atomicity of the messages. >> >> The message buffer does not have to be a chunk of memory that >> we circularly scribble to. It can be a per-cpu linked list of >> messages even. >> >> The advantage of thinking along these lines is that: >> 1. Console output can be made optional very easily, allowing >> us to implement quiet boots without loosing the ability >> to look at messages collected during boot. >> 2. Atomicity allows us to parse the messages reliably, which >> works very well in the embedded space where monitoring of >> kernel messages is common. >> 3. You can decouple writing into the message buffer from >> extracting messages out of the message buffer, allowing >> the low-level console to become just another channel to >> send messages to, rather than be fundamental for printf. >> 4. A linked list (for example) eliminates the problem of >> scribbling over old messages and possibly leaving partial >> output that gets misinterpreted. >> 5. A per-cpu message buffer eliminates serialization to >> guarantee atomcity and with timestamping can very easily >> be turned into a sequential log. >> 6. We haven't introduced complications (e.g. locking) to >> solve these problems and that make using printf in low- >> level code impossible. Thank trap handlers or interrupt >> handlers. > I agree with everything except for per-CPU buffers. I understand the > need for using printf in low-level code and it indeed complicates things. > The reason I don't like the idea of per-CPU buffers is that locking > would allow me to implement atomicity across multiple printfs. > For example I often use macros like this: > > #define G_MIRROR_DEBUG(lvl, ...) do { \ > if (g_mirror_debug>= (lvl)) { \ > printf("GEOM_MIRROR"); \ > if (g_mirror_debug> 0) \ > printf("[%u]", lvl); \ > printf(": "); \ > printf(__VA_ARGS__); \ > printf("\n"); \ > } \ > } while (0) > > And I'd like all the printfs to be committed as one message without > using some additional buffer first and then single printf. > With some kind of printf-lock we could use recursive locking to achieve > this. In your proposal I may run each printf on different CPU. > I could eventually use sched_pin() around all printfs, I guess. > This still doesn't cover the case when I'm preempted between my printfs, > so maybe I need critical section there? I don't expect printf should be > fast, so it might be ok. with locking your example could still be broken up because there is a lock per printf.. if you want them done together you really should print parts to a separate assembly buffer and then put it all out at once. I actually like the idea of pcpu buffers. witha single atomic sequence number being the only sychroniaation needed. From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 09:22:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 723B3106564A; Fri, 17 Feb 2012 09:22:05 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 9BCBA8FC0A; Fri, 17 Feb 2012 09:22:03 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 04FFC9A6; Fri, 17 Feb 2012 10:22:00 +0100 (CET) Date: Fri, 17 Feb 2012 10:20:42 +0100 From: Pawel Jakub Dawidek To: Julian Elischer Message-ID: <20120217092038.GD1358@garage.freebsd.pl> References: <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> <20120217085840.GC1358@garage.freebsd.pl> <4F3E18CE.1010700@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ycz6tD7Th1CMF4v7" Content-Disposition: inline In-Reply-To: <4F3E18CE.1010700@freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Fri, 17 Feb 2012 12:25:40 +0000 Cc: marcel@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, "Kenneth D. Merry" , Andriy Gapon , Marcel Moolenaar , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 09:22:05 -0000 --Ycz6tD7Th1CMF4v7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 17, 2012 at 01:07:26AM -0800, Julian Elischer wrote: > On 2/17/12 12:58 AM, Pawel Jakub Dawidek wrote: > > I agree with everything except for per-CPU buffers. I understand the > > need for using printf in low-level code and it indeed complicates thing= s. > > The reason I don't like the idea of per-CPU buffers is that locking > > would allow me to implement atomicity across multiple printfs. > > For example I often use macros like this: > > > > #define G_MIRROR_DEBUG(lvl, ...) do { \ > > if (g_mirror_debug>=3D (lvl)) { \ > > printf("GEOM_MIRROR"); \ > > if (g_mirror_debug> 0) \ > > printf("[%u]", lvl); \ > > printf(": "); \ > > printf(__VA_ARGS__); \ > > printf("\n"); \ > > } \ > > } while (0) > > > > And I'd like all the printfs to be committed as one message without > > using some additional buffer first and then single printf. > > With some kind of printf-lock we could use recursive locking to achieve > > this. In your proposal I may run each printf on different CPU. > > I could eventually use sched_pin() around all printfs, I guess. > > This still doesn't cover the case when I'm preempted between my printfs, > > so maybe I need critical section there? I don't expect printf should be > > fast, so it might be ok. >=20 > with locking your example could still be broken up because there is a > lock per printf.. >=20 > if you want them done together you really should print parts to a > separate assembly buffer and then put it all out at once. Not really. I was thinking about recursive printf-lock that is used internally by printf, but can also be used by printfs consumers, eg. mtx_lock(&printf_lock); printf("first thing "); printf("second thing"); mtx_unlock(&printf_lock); Again, printf internally is using printf_lock too. > I actually like the idea of pcpu buffers. witha single atomic sequence=20 > number being the only > sychroniaation needed. Maybe I'm over engineering here, but... If we store in the thread structure two things: your counter and information if the last message stored by this thread had \n at the end or not, we could reuse the same counter for the next message by this thread if the previous message had no \n. This way my macro will work with per-CPU lists and preemption. I'd still need sched_pin() though. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --Ycz6tD7Th1CMF4v7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8+G+YACgkQForvXbEpPzRu0QCfccoGdkD7ugHjp2Qfy6Cyv7jZ JS0An0qm+acifBdtyLSQBrYlP+mTNtps =u2sa -----END PGP SIGNATURE----- --Ycz6tD7Th1CMF4v7-- From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 09:40:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 187DE1065673; Fri, 17 Feb 2012 09:40:15 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9A7768FC19; Fri, 17 Feb 2012 09:40:13 +0000 (UTC) Received: by wibhn14 with SMTP id hn14so2202162wib.13 for ; Fri, 17 Feb 2012 01:40:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=WOEoGap14tjuvxbS8t6/UPzZmNOdHe7Febyay2Vn3OU=; b=ogt4uCd97hL8TUGlQe9dYI3FrGEsmRIphlcDaiZ/NvtPqwL+rntnK0njT0q70rUpS+ 9O4srL7oUw0vTqWHQAtcu8sV/XX+0h5ppAqhoP2Btd5+RIBvR6URDpzAbR/isTv+IfZb tdDUGVnxKBPOIcCx9MFFZLTq5wJg5Iz4yu0mo= MIME-Version: 1.0 Received: by 10.180.101.165 with SMTP id fh5mr2149723wib.10.1329469747292; Fri, 17 Feb 2012 01:09:07 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.216.177.73 with HTTP; Fri, 17 Feb 2012 01:09:07 -0800 (PST) In-Reply-To: <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> Date: Fri, 17 Feb 2012 09:09:07 +0000 X-Google-Sender-Auth: SXq6uizTOat_CDC1S3540308DD0 Message-ID: From: Attilio Rao To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 X-Mailman-Approved-At: Fri, 17 Feb 2012 12:25:40 +0000 Cc: marcel@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, "Kenneth D. Merry" , Andriy Gapon , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 09:40:15 -0000 2012/2/17, Marcel Moolenaar : > > On Feb 16, 2012, at 4:19 PM, Andriy Gapon wrote: > >> on 17/02/2012 02:08 Kenneth D. Merry said the following: >> [snip] >>>>> On Thu, Feb 16, 2012 at 11:13:09 +0200, Andriy Gapon wrote: >> [snip] >>>>>> For me personally the immediate benefits in the common situations >>>>>> outweighed the >>>>>> problems in the edge cases, although I still believe that we can get >>>>>> the >>>>>> former >>>>>> without sacrifices in the latter. >> [snip] >>> It sounds fine, but I don't have sufficient time to spend on this right >>> now. So I can either back out the changes I mentioned above (assuming we >>> get agreement from avg), or leave things as is. >> >> I stick to what I wrote above and so chose the status quo. >> The backout would make sense if it is immediately followed by commit of a >> better >> solution. Unfortunately, a lack of time here too. > > I think we should lift above the immediate problem and allow for > single- and multi-line messages that are atomically appended to > the message buffer. Console output and propagation of messages > outside of the kernel should all come out of the message buffer > and preserving the atomicity of the messages. > > The message buffer does not have to be a chunk of memory that > we circularly scribble to. It can be a per-cpu linked list of > messages even. Do you think we could inherit much of the code from KTR subsystem? We could use KTR as a scheleton (and possibly improving it) for making a general circular-buffer and then create a new KPI, thus add implementations for KTR, msgbuf, etc. My 2 cents, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 12:13:23 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FD25106566B; Fri, 17 Feb 2012 12:13:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id D9AF18FC13; Fri, 17 Feb 2012 12:13:22 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1HCDHSV020485 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Feb 2012 23:13:19 +1100 Date: Fri, 17 Feb 2012 23:13:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcel Moolenaar In-Reply-To: <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> Message-ID: <20120217191017.U1871@besplex.bde.org> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Mailman-Approved-At: Fri, 17 Feb 2012 12:25:40 +0000 Cc: marcel@FreeBSD.org, Eitan Adler , svn-src-all@FreeBSD.org, "Kenneth D. Merry" , Andriy Gapon , src-committers@FreeBSD.org, Bruce Evans , svn-src-head@FreeBSD.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 12:13:23 -0000 On Thu, 16 Feb 2012, Marcel Moolenaar wrote: > I think we should lift above the immediate problem and allow for > single- and multi-line messages that are atomically appended to > the message buffer. Console output and propagation of messages > outside of the kernel should all come out of the message buffer > and preserving the atomicity of the messages. This is just wrong for (low-level) console messages. Console messages are for emergencies. They must not be buffered or otherwise delayed, and should be rare, like the default for stderr in userland but much more so. In userland, it is sometimes but not always possible to keep messages on stdout ordered and atomic relative to other messages, by being very careful about fflush'ing stdout, as most applications aren't. There is an analogy between stdio and write(2) in userland and log(9) and printf(9) in the kernel. The application might be using stdio normally but want to use write() for emergency messages in signal handlers. It is unreasonable for it to add mounds of locking around stdio (or ask the implementation to add locking) to allow these emergency writes to be correctly interleaved with stdio ones. Applications that care about atomicity should build up buffers using interfaces like snprintf() and write the buffers using write(), since printf() provides no guarantees of atomicity (and in practice provides none unless you are careful with block sizes). Similarly in the kernel, except it is easy to make individual printf()s usually atomic. printf() in the kernel corresponds to unbuffered printf() to stderr in userland. Even the latter is not guaranteed to be atomic, and is practice is not unless you are careful to write only small amounts, since its implementation is to use a buffer with the bogus size BUFSIZ and write that out up to BUFSIZ bytes at a time; this gives non-atomicity at every write boundary. > The message buffer does not have to be a chunk of memory that > we circularly scribble to. It can be a per-cpu linked list of > messages even. Now it cannot really be used for emergency writes. Well, it can be used for the non-physical part. You can write to your per-cpu memory either before or after doing the physical write (better before), with no contention provided you disable interrupts on your CPU (which is bad for interrupt latency, and must be done separately from the slow physical i/o part, especially with only 1 CPU), and then combine the buffers at leisure, but with complications at that point. All messages would probably need fine-grained timestamps coherent across CPUs, or ids coherent across CPUs. The linked list to scattered memory would also give nice complications and fragility across reboots. > The advantage of thinking along these lines is that: > 1. Console output can be made optional very easily, allowing > us to implement quiet boots without loosing the ability > to look at messages collected during boot. This is already optional very easily in 3 ways: - RB_MUTE boot flag - sysctl kern.consmute to mute or to undo RB_MUTE - sysctl kern.console to give a null list of consoles. The older muting method is not really needed with this. I forget if muting kills input like this does. In better implementations of multiple consoles, the input and output devices can be attached and detached independently. > 2. Atomicity allows us to parse the messages reliably, which > works very well in the embedded space where monitoring of > kernel messages is common. My old, simple changes gave atomicity and serialization for tprintf(), log(), printf() and vprintf() whenever possible (not in emergencies that would deadlock, and not in contention with ddb) by locking everything with a common nonstandard lock. ddb output doesn't go into the message buffer (except for bugs, and maybe the option to use printf() for ddb output). Serialization of as much as possible is useful too. > 3. You can decouple writing into the message buffer from > extracting messages out of the message buffer, allowing > the low-level console to become just another channel to > send messages to, rather than be fundamental for printf. The low level console is fundamental for ddb and emergency messages. The console parts of these are much lower level and harder to get right than the msgbuf parts, since they touch much more state than can be accessed by a single atomic op, so they need locks, but deadlock is close. printf() output is also recorded in the message buffer so you can read it later. This should not be allowed to complicate or break the lower level. But it is relatively easy once the lower level works. You just make the console i/o as serialized and atomic as possible, and copy it to the message buffer in the same order, but you have to copy to the message buffer carefully using atomic ops, since in the rare cases where the console i/o is not serialized/atomic due to deadlock avoidance etc., copying to the message buffer is not automatically atomic. I used the same lock for log() as for *printf() even when log() doesn't go to the console. This case has not been tested under load, but it's hard for log() alone to generate much contention since it doesn't have to wait for slow low-level (serial) console hardware like printf() does. log() just has to wait for printf() (or log() to the console), but printf() should only be used for emergencies and thus rare. log() vs [tu]printf() is more interesting. Perhaps users can generate too many [tu]printf()s, but in practice these are rarer than printf(). > 4. A linked list (for example) eliminates the problem of > scribbling over old messages and possibly leaving partial > output that gets misinterpreted. Until memory runs out. realloc()ing the message buffer has the same problem but is less fragile. > 5. A per-cpu message buffer eliminates serialization to > guarantee atomcity and with timestamping can very easily > be turned into a sequential log. Now it needs to disable interrupts to give exclusive access. Expanding on the above, disabling interrupts is especially bad for single CPUs where the message buffer grew up, which partly explains why it is not done. At 300 bps, an 80-character message takes 2.7 seconds to print. Consoles slower than that can easily be arranged. Or use multiple consoles with 100's of them to take 270 seconds (due to lack of parallism for console output). Disabling interrupts for that long would be nasty. So the message would have to be converted to a string and buffered somewhere while holding interrupts disabled, before printing it with interrupts reenabled. The message buffer almost works here. There are still complications for emergency messages (e.g., from the interrupt handlers that we have carefully allowed): - the natural handling is to append the messages to the message buffer as they come in), but the emergency output must be in the middle of old messages. Then if we can see the message buffer later, its order won't be the same as the console output. The console order seems better. It could be recorded, so that the logging code can see both orders, as markup in the emergency messages. - nesting of emergency messages may be large, so we need to at least consider the complications for when it causes the message buffer to wrap. Of course, at emergency time we can't expand the message buffer to prevent it wrapping. > 6. We haven't introduced complications (e.g. locking) to > solve these problems and that make using printf in low- > level code impossible. Thank trap handlers or interrupt > handlers. I think you have just moved them slightly. A per-cpu msgbuf doesn't completely reduce to the !SMP case, because output from multiple CPUs still has to go through shared i/o hardware. My idea is that after doing the necessary serialization for the hardware, nothing more is needed for msgbuf. How did you intend to do the serialization for the hardware anyway? With multiple CPUs, there must be a lock to limit contention, and it should be at least per-printf, not per-char. Pre-formatting the message to a buffer before calling the console driver does nothing for the hardware part. The locking for the hardware part is currently mainly in cnputs(), where I don't like it at all. Apart from giving deadlock in various ddb and emergency cases, it fails to protect upper levels, so you need locks to give atomicity for them too, starting with msgbuf. But the slow part is the i/o. So with concurrent printf()s, everything blocks for about the same time as it would if the locks were at the top level, for only negative benefits like the complexity and bugs, and having the msgbuf order possibly different from the i/o order. The separate locks provide some benefits for concurrent log()s and printfs() when log() is not to the console. Now log() doesn't have to wait for console i/o. I think these benefits are insignficant since the cases in which log() has to wait for printf() should be rare. This wait can probably be handled with an advisory lock too, not very differently than how it is done now in msgbuf code, but I don't want the complexity unless there is an actual problem (in a reasonable configuration, not including 100 300 bps consoles :-). The msgbuf problems fixed by ken's change seem to be mainly scrambled markup. Is there anything else important? My advisory locking handles this by giving atomicity unless the system seems to have been in a deadlock state for about 1 second. Scrambling may occur after this 1 second. Even emergency messages have to wait for up to 1 second in this state, or for the few microseconds or milliseconds that it takes for a few other printf()s to complete (the timeout is too short to give atomicity for even 1 300 bps console), or for the few nanoseconds or microseconds for a few log()s to the msgbuf. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 12:40:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F7A2106566C; Fri, 17 Feb 2012 12:40:28 +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 6AD248FC12; Fri, 17 Feb 2012 12:40:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1HCeSGj078592; Fri, 17 Feb 2012 12:40:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1HCeSZ9078590; Fri, 17 Feb 2012 12:40:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202171240.q1HCeSZ9078590@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 17 Feb 2012 12:40: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: r231873 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 12:40:28 -0000 Author: kib Date: Fri Feb 17 12:40:27 2012 New Revision: 231873 URL: http://svn.freebsd.org/changeset/base/231873 Log: Fix cross-references. Submitted by: pluknet MFC after: 2 weeks Modified: head/lib/libc/gen/dl_iterate_phdr.3 Modified: head/lib/libc/gen/dl_iterate_phdr.3 ============================================================================== --- head/lib/libc/gen/dl_iterate_phdr.3 Fri Feb 17 11:47:18 2012 (r231872) +++ head/lib/libc/gen/dl_iterate_phdr.3 Fri Feb 17 12:40:27 2012 (r231873) @@ -23,7 +23,7 @@ .Nd iterate over program headers .Sh LIBRARY For the dynamically linked binaries, the service is provided by -.Xr ld-elf.so.1 5 +.Xr ld-elf.so.1 1 dynamic linker. Statically linked programs use an implementation of .Fn dl_iterate_phdr @@ -105,7 +105,7 @@ returns the value returned by the last call executed. .Sh SEE ALSO .Xr ld 1 , -.Xr ld-elf.so 1 , +.Xr ld-elf.so.1 1 , .Xr dlopen 3 , .Xr elf 5 .Sh HISTORY From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 13:55:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEC881065673; Fri, 17 Feb 2012 13:55:17 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D91108FC14; Fri, 17 Feb 2012 13:55:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1HDtHdw081160; Fri, 17 Feb 2012 13:55:17 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1HDtHfP081151; Fri, 17 Feb 2012 13:55:17 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201202171355.q1HDtHfP081151@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 17 Feb 2012 13: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: r231879 - head/sys/dev/oce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 13:55:18 -0000 Author: luigi Date: Fri Feb 17 13:55:17 2012 New Revision: 231879 URL: http://svn.freebsd.org/changeset/base/231879 Log: Patches from Naresh Raju Gottumukkala - Feature: UMC - Universal Multi Channel support - Bugfix: BE3 Firmware Flashing bug. - Code improvements: - Removed duplicate switch cases in the oce_ioctl routine. - Made changes to mcc_async notifications routine(oce_mq_handler) MFC after: 1 week Modified: head/sys/dev/oce/oce_hw.c head/sys/dev/oce/oce_hw.h head/sys/dev/oce/oce_if.c head/sys/dev/oce/oce_if.h head/sys/dev/oce/oce_mbox.c head/sys/dev/oce/oce_queue.c head/sys/dev/oce/oce_sysctl.c head/sys/dev/oce/oce_util.c Modified: head/sys/dev/oce/oce_hw.c ============================================================================== --- head/sys/dev/oce/oce_hw.c Fri Feb 17 13:45:34 2012 (r231878) +++ head/sys/dev/oce/oce_hw.c Fri Feb 17 13:55:17 2012 (r231879) @@ -340,8 +340,10 @@ oce_hw_shutdown(POCE_SOFTC sc) oce_stats_free(sc); /* disable hardware interrupts */ oce_hw_intr_disable(sc); +#if defined(INET6) || defined(INET) /* Free LRO resources */ oce_free_lro(sc); +#endif /* Release queue*/ oce_queue_release_all(sc); /*Delete Network Interface*/ @@ -494,12 +496,17 @@ oce_hw_start(POCE_SOFTC sc) rc = oce_start_mq(sc->mq); - /* we need to get MCC aync events. - So enable intrs and also arm first EQ + /* we need to get MCC aync events. So enable intrs and arm + first EQ, Other EQs will be armed after interface is UP */ oce_hw_intr_enable(sc); oce_arm_eq(sc, sc->eq[0]->eq_id, 0, TRUE, FALSE); + /* Send first mcc cmd and after that we get gracious + MCC notifications from FW + */ + oce_first_mcc_cmd(sc); + return rc; } @@ -537,8 +544,8 @@ oce_hw_intr_disable(POCE_SOFTC sc) /** - * @brief Function for hardware update multicast filter - * @param sc software handle to the device + * @brief Function for hardware update multicast filter + * @param sc software handle to the device */ int oce_hw_update_multicast(POCE_SOFTC sc) Modified: head/sys/dev/oce/oce_hw.h ============================================================================== --- head/sys/dev/oce/oce_hw.h Fri Feb 17 13:45:34 2012 (r231878) +++ head/sys/dev/oce/oce_hw.h Fri Feb 17 13:55:17 2012 (r231879) @@ -154,6 +154,9 @@ #define ASYNC_EVENT_CODE_LINK_STATE 0x1 #define ASYNC_EVENT_LINK_UP 0x1 #define ASYNC_EVENT_LINK_DOWN 0x0 +#define ASYNC_EVENT_GRP5 0x5 +#define ASYNC_EVENT_PVID_STATE 0x3 +#define VLAN_VID_MASK 0x0FFF /* port link_status */ #define ASYNC_EVENT_LOGICAL 0x02 @@ -610,7 +613,10 @@ struct oce_mq_cqe { uint32_t hpi_buffer_cmpl:1; uint32_t completed:1; uint32_t consumed:1; - uint32_t rsvd0:27; + uint32_t rsvd0:3; + uint32_t async_type:8; + uint32_t event_type:8; + uint32_t rsvd1:8; #else /* dw0 */ uint32_t completion_status:16; @@ -618,7 +624,10 @@ struct oce_mq_cqe { /* dw1 dw2 */ uint32_t mq_tag[2]; /* dw3 */ - uint32_t rsvd0:27; + uint32_t rsvd1:8; + uint32_t event_type:8; + uint32_t async_type:8; + uint32_t rsvd0:3; uint32_t consumed:1; uint32_t completed:1; uint32_t hpi_buffer_cmpl:1; @@ -687,6 +696,63 @@ struct oce_async_cqe_link_state { } u0; }; + +/* PVID aync event */ +struct oce_async_event_grp5_pvid_state { + uint8_t enabled; + uint8_t rsvd0; + uint16_t tag; + uint32_t event_tag; + uint32_t rsvd1; + uint32_t code; +}; + +typedef union oce_mq_ext_ctx_u { + uint32_t dw[6]; + struct { + #ifdef _BIG_ENDIAN + /* dw0 */ + uint32_t dw4rsvd1:16; + uint32_t num_pages:16; + /* dw1 */ + uint32_t async_evt_bitmap; + /* dw2 */ + uint32_t cq_id:10; + uint32_t dw5rsvd2:2; + uint32_t ring_size:4; + uint32_t dw5rsvd1:16; + /* dw3 */ + uint32_t valid:1; + uint32_t dw6rsvd1:31; + /* dw4 */ + uint32_t dw7rsvd1:21; + uint32_t async_cq_id:10; + uint32_t async_cq_valid:1; + #else + /* dw0 */ + uint32_t num_pages:16; + uint32_t dw4rsvd1:16; + /* dw1 */ + uint32_t async_evt_bitmap; + /* dw2 */ + uint32_t dw5rsvd1:16; + uint32_t ring_size:4; + uint32_t dw5rsvd2:2; + uint32_t cq_id:10; + /* dw3 */ + uint32_t dw6rsvd1:31; + uint32_t valid:1; + /* dw4 */ + uint32_t async_cq_valid:1; + uint32_t async_cq_id:10; + uint32_t dw7rsvd1:21; + #endif + /* dw5 */ + uint32_t dw8rsvd1; + } v0; +} oce_mq_ext_ctx_t; + + /* MQ mailbox structure */ struct oce_bmbx { struct oce_mbx mbx; @@ -1342,6 +1408,23 @@ struct mbx_create_common_mq { } params; }; +struct mbx_create_common_mq_ex { + struct mbx_hdr hdr; + union { + struct { + oce_mq_ext_ctx_t context; + struct phys_addr pages[8]; + } req; + + struct { + uint32_t mq_id:16; + uint32_t rsvd0:16; + } rsp; + } params; +}; + + + /* [53] OPCODE_COMMON_DESTROY_MQ */ struct mbx_destroy_common_mq { struct mbx_hdr hdr; @@ -1584,7 +1667,7 @@ enum CQFW_FUNCTION_MODES_SUPPORTED { FNM_BE3_COMPAT_MODE = 0x10000, /* BE3 features */ FNM_VNIC_MODE = 0x20000, /* Set when IBM vNIC mode is set */ FNM_VNTAG_MODE = 0x40000, /* Set when VNTAG mode is set */ - FNM_UMC_MODE = 0x80000, /* Set when UMC mode is set */ + FNM_UMC_MODE = 0x1000000, /* Set when UMC mode is set */ FNM_UMC_DEF_EN = 0x100000, /* Set when UMC Default is set */ FNM_ONE_GB_EN = 0x200000, /* Set when 1GB Default is set */ FNM_VNIC_DEF_VALID = 0x400000, /* Set when VNIC_DEF_EN is valid */ Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Fri Feb 17 13:45:34 2012 (r231878) +++ head/sys/dev/oce/oce_if.c Fri Feb 17 13:55:17 2012 (r231879) @@ -36,7 +36,6 @@ * Costa Mesa, CA 92626 */ - /* $FreeBSD$ */ #include "opt_inet6.h" @@ -71,10 +70,6 @@ static int oce_tx(POCE_SOFTC sc, struct static void oce_tx_restart(POCE_SOFTC sc, struct oce_wq *wq); static void oce_tx_complete(struct oce_wq *wq, uint32_t wqe_idx, uint32_t status); -#if defined(INET6) || defined(INET) -static struct mbuf * oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp, - uint16_t *mss); -#endif static int oce_multiq_transmit(struct ifnet *ifp, struct mbuf *m, struct oce_wq *wq); @@ -82,9 +77,6 @@ static int oce_multiq_transmit(struct i static void oce_discard_rx_comp(struct oce_rq *rq, struct oce_nic_rx_cqe *cqe); static int oce_cqe_vtp_valid(POCE_SOFTC sc, struct oce_nic_rx_cqe *cqe); static int oce_cqe_portid_valid(POCE_SOFTC sc, struct oce_nic_rx_cqe *cqe); -#if defined(INET6) || defined(INET) -static void oce_rx_flush_lro(struct oce_rq *rq); -#endif static void oce_rx(struct oce_rq *rq, uint32_t rqe_idx, struct oce_nic_rx_cqe *cqe); @@ -96,13 +88,20 @@ static int oce_vid_config(POCE_SOFTC sc static void oce_mac_addr_set(POCE_SOFTC sc); static int oce_handle_passthrough(struct ifnet *ifp, caddr_t data); static void oce_local_timer(void *arg); -#if defined(INET6) || defined(INET) -static int oce_init_lro(POCE_SOFTC sc); -#endif static void oce_if_deactivate(POCE_SOFTC sc); static void oce_if_activate(POCE_SOFTC sc); static void setup_max_queues_want(POCE_SOFTC sc); static void update_queues_got(POCE_SOFTC sc); +static void process_link_state(POCE_SOFTC sc, + struct oce_async_cqe_link_state *acqe); + + +/* IP specific */ +#if defined(INET6) || defined(INET) +static int oce_init_lro(POCE_SOFTC sc); +static void oce_rx_flush_lro(struct oce_rq *rq); +static struct mbuf * oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp); +#endif static device_method_t oce_dispatch[] = { DEVMETHOD(device_probe, oce_probe), @@ -157,10 +156,10 @@ static uint32_t supportedDevices[] = { static int oce_probe(device_t dev) { - uint16_t vendor; - uint16_t device; - int i; - char str[80]; + uint16_t vendor = 0; + uint16_t device = 0; + int i = 0; + char str[256] = {0}; POCE_SOFTC sc; sc = device_get_softc(dev); @@ -170,11 +169,10 @@ oce_probe(device_t dev) vendor = pci_get_vendor(dev); device = pci_get_device(dev); - for (i = 0; i < (sizeof(supportedDevices) / sizeof(uint16_t)); i++) { + for (i = 0; i < (sizeof(supportedDevices) / sizeof(uint32_t)); i++) { if (vendor == ((supportedDevices[i] >> 16) & 0xffff)) { if (device == (supportedDevices[i] & 0xffff)) { - sprintf(str, "%s:%s", - "Emulex CNA NIC function", + sprintf(str, "%s:%s", "Emulex CNA NIC function", component_revision); device_set_desc_copy(dev, str); @@ -228,37 +226,30 @@ oce_attach(device_t dev) if (rc) goto pci_res_free; - setup_max_queues_want(sc); - rc = oce_setup_intr(sc); if (rc) goto mbox_free; - rc = oce_queue_init_all(sc); if (rc) goto intr_free; - rc = oce_attach_ifp(sc); if (rc) goto queues_free; - #if defined(INET6) || defined(INET) rc = oce_init_lro(sc); if (rc) - goto ifp_free; + goto ifp_free; #endif - rc = oce_hw_start(sc); if (rc) goto lro_free;; - sc->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, oce_add_vlan, sc, EVENTHANDLER_PRI_FIRST); sc->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, @@ -270,11 +261,12 @@ oce_attach(device_t dev) oce_add_sysctls(sc); - callout_init(&sc->timer, CALLOUT_MPSAFE); rc = callout_reset(&sc->timer, 2 * hz, oce_local_timer, sc); if (rc) goto stats_free; +#ifdef DEV_NETMAP +#endif /* DEV_NETMAP */ return 0; @@ -315,9 +307,7 @@ oce_detach(device_t dev) POCE_SOFTC sc = device_get_softc(dev); LOCK(&sc->dev_lock); - oce_if_deactivate(sc); - UNLOCK(&sc->dev_lock); callout_drain(&sc->timer); @@ -359,34 +349,11 @@ oce_ioctl(struct ifnet *ifp, u_long comm uint32_t u; switch (command) { - case SIOCGIFPSRCADDR_IN6: - rc = ether_ioctl(ifp, command, data); - break; - - case SIOCGIFPSRCADDR: - rc = ether_ioctl(ifp, command, data); - break; - - case SIOCGIFSTATUS: - rc = ether_ioctl(ifp, command, data); - break; case SIOCGIFMEDIA: rc = ifmedia_ioctl(ifp, ifr, &sc->media, command); break; - case SIOCSIFMEDIA: - rc = ether_ioctl(ifp, command, data); - break; - - case SIOCGIFGENERIC: - rc = ether_ioctl(ifp, command, data); - break; - - case SIOCGETMIFCNT_IN6: - rc = ether_ioctl(ifp, command, data); - break; - case SIOCSIFMTU: if (ifr->ifr_mtu > OCE_MAX_MTU) rc = EINVAL; @@ -474,7 +441,6 @@ oce_ioctl(struct ifnet *ifp, u_long comm ifp->if_capenable ^= IFCAP_VLAN_HWFILTER; oce_vid_config(sc); } - #if defined(INET6) || defined(INET) if (u & IFCAP_LRO) ifp->if_capenable ^= IFCAP_LRO; @@ -813,9 +779,6 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, struct oce_nic_frag_wqe *nicfrag; int num_wqes; uint32_t reg_value; -#if defined(INET6) || defined(INET) - uint16_t mss = 0; -#endif m = *mpp; if (!m) @@ -827,9 +790,9 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, } if (m->m_pkthdr.csum_flags & CSUM_TSO) { -#if defined(INET6) || defined(INET) /* consolidate packet buffers for TSO/LSO segment offload */ - m = oce_tso_setup(sc, mpp, &mss); +#if defined(INET6) || defined(INET) + m = oce_tso_setup(sc, mpp); #else m = NULL; #endif @@ -1012,9 +975,10 @@ oce_tx_restart(POCE_SOFTC sc, struct oce } + #if defined(INET6) || defined(INET) static struct mbuf * -oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp, uint16_t *mss) +oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp) { struct mbuf *m; #ifdef INET @@ -1025,12 +989,10 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf #endif struct ether_vlan_header *eh; struct tcphdr *th; - int total_len = 0; uint16_t etype; - int ehdrlen = 0; + int total_len = 0, ehdrlen = 0; m = *mpp; - *mss = m->m_pkthdr.tso_segsz; if (M_WRITABLE(m) == 0) { m = m_dup(*mpp, M_DONTWAIT); @@ -1049,7 +1011,6 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf ehdrlen = ETHER_HDR_LEN; } - switch (etype) { #ifdef INET case ETHERTYPE_IP: @@ -1084,7 +1045,6 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf } #endif /* INET6 || INET */ - void oce_tx_task(void *arg, int npending) { @@ -1115,6 +1075,7 @@ oce_start(struct ifnet *ifp) POCE_SOFTC sc = ifp->if_softc; struct mbuf *m; int rc = 0; + int def_q = 0; /* Defualt tx queue is 0*/ if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) @@ -1124,13 +1085,13 @@ oce_start(struct ifnet *ifp) IF_DEQUEUE(&sc->ifp->if_snd, m); if (m == NULL) break; - /* oce_start always uses default TX queue 0 */ - LOCK(&sc->wq[0]->tx_lock); - rc = oce_tx(sc, &m, 0); - UNLOCK(&sc->wq[0]->tx_lock); + + LOCK(&sc->wq[def_q]->tx_lock); + rc = oce_tx(sc, &m, def_q); + UNLOCK(&sc->wq[def_q]->tx_lock); if (rc) { if (m != NULL) { - sc->wq[0]->tx_stats.tx_stops ++; + sc->wq[def_q]->tx_stats.tx_stops ++; ifp->if_drv_flags |= IFF_DRV_OACTIVE; IFQ_DRV_PREPEND(&ifp->if_snd, m); m = NULL; @@ -1140,7 +1101,7 @@ oce_start(struct ifnet *ifp) if (m != NULL) ETHER_BPF_MTAP(ifp, m); - } while (1); + } while (TRUE); return; } @@ -1248,13 +1209,19 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i uint16_t vtag; len = cqe->u0.s.pkt_size; - vtag = cqe->u0.s.vlan_tag; if (!len) { /*partial DMA workaround for Lancer*/ oce_discard_rx_comp(rq, cqe); goto exit; } + /* Get vlan_tag value */ + if(IS_BE(sc)) + vtag = BSWAP_16(cqe->u0.s.vlan_tag); + else + vtag = cqe->u0.s.vlan_tag; + + for (i = 0; i < cqe->u0.s.num_fragments; i++) { if (rq->packets_out == rq->packets_in) { @@ -1290,7 +1257,7 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i pd->mbuf->m_pkthdr.csum_data = 0xffff; } if (cqe->u0.s.ip_cksum_pass) { - if (!cqe->u0.s.ip_ver) { //IPV4 + if (!cqe->u0.s.ip_ver) { /* IPV4 */ pd->mbuf->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED|CSUM_IP_VALID); } @@ -1313,24 +1280,20 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i m->m_pkthdr.flowid = rq->queue_index; m->m_flags |= M_FLOWID; #endif - //This deternies if vlan tag is present + /* This deternies if vlan tag is Valid */ if (oce_cqe_vtp_valid(sc, cqe)) { if (sc->function_mode & FNM_FLEX10_MODE) { - /* FLEX10 */ + /* FLEX10. If QnQ is not set, neglect VLAN */ if (cqe->u0.s.qnq) { - /* If QnQ is not set, neglect VLAN */ - if (IS_BE(sc)) - m->m_pkthdr.ether_vtag = - BSWAP_16(vtag); - else - m->m_pkthdr.ether_vtag = vtag; + m->m_pkthdr.ether_vtag = vtag; m->m_flags |= M_VLANTAG; } - } else { - if (IS_BE(sc)) - m->m_pkthdr.ether_vtag = BSWAP_16(vtag); - else - m->m_pkthdr.ether_vtag = vtag; + } else if (sc->pvid != (vtag & VLAN_VID_MASK)) { + /* In UMC mode generally pvid will be striped by + hw. But in some cases we have seen it comes + with pvid. So if pvid == vlan, neglect vlan. + */ + m->m_pkthdr.ether_vtag = vtag; m->m_flags |= M_VLANTAG; } } @@ -1415,9 +1378,8 @@ oce_cqe_vtp_valid(POCE_SOFTC sc, struct if (sc->be3_native) { cqe_v1 = (struct oce_nic_rx_cqe_v1 *)cqe; vtp = cqe_v1->u0.s.vlan_tag_present; - } else { + } else vtp = cqe->u0.s.vlan_tag_present; - } return vtp; @@ -1442,7 +1404,6 @@ oce_cqe_portid_valid(POCE_SOFTC sc, stru } - #if defined(INET6) || defined(INET) static void oce_rx_flush_lro(struct oce_rq *rq) @@ -1482,12 +1443,11 @@ oce_init_lro(POCE_SOFTC sc) return rc; } -#endif /* INET6 || INET */ + void oce_free_lro(POCE_SOFTC sc) { -#if defined(INET6) || defined(INET) struct lro_ctrl *lro = NULL; int i = 0; @@ -1496,9 +1456,8 @@ oce_free_lro(POCE_SOFTC sc) if (lro) tcp_lro_free(lro); } -#endif } - +#endif /* INET6 || INET */ int oce_alloc_rx_bufs(struct oce_rq *rq, int count) @@ -1620,6 +1579,7 @@ oce_rq_handler(void *arg) if (num_cqes >= (IS_XE201(sc) ? 8 : oce_max_rsp_handled)) break; } + #if defined(INET6) || defined(INET) if (IF_LRO_ENABLED(sc)) oce_rx_flush_lro(rq); @@ -1682,9 +1642,11 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_capabilities = OCE_IF_CAPABILITIES; sc->ifp->if_capabilities |= IFCAP_HWCSUM; sc->ifp->if_capabilities |= IFCAP_VLAN_HWFILTER; + #if defined(INET6) || defined(INET) sc->ifp->if_capabilities |= IFCAP_TSO; sc->ifp->if_capabilities |= IFCAP_LRO; + sc->ifp->if_capabilities |= IFCAP_VLAN_HWTSO; #endif sc->ifp->if_capenable = sc->ifp->if_capabilities; @@ -1944,6 +1906,26 @@ oce_if_activate(POCE_SOFTC sc) } +static void +process_link_state(POCE_SOFTC sc, struct oce_async_cqe_link_state *acqe) +{ + /* Update Link status */ + if ((acqe->u0.s.link_status & ~ASYNC_EVENT_LOGICAL) == + ASYNC_EVENT_LINK_UP) { + sc->link_status = ASYNC_EVENT_LINK_UP; + if_link_state_change(sc->ifp, LINK_STATE_UP); + } else { + sc->link_status = ASYNC_EVENT_LINK_DOWN; + if_link_state_change(sc->ifp, LINK_STATE_DOWN); + } + + /* Update speed */ + sc->link_speed = acqe->u0.s.speed; + sc->qos_link_speed = (uint32_t) acqe->u0.s.qos_link_speed * 10; + +} + + /* Handle the Completion Queue for the Mailbox/Async notifications */ uint16_t oce_mq_handler(void *arg) @@ -1951,36 +1933,39 @@ oce_mq_handler(void *arg) struct oce_mq *mq = (struct oce_mq *)arg; POCE_SOFTC sc = mq->parent; struct oce_cq *cq = mq->cq; - int num_cqes = 0; + int num_cqes = 0, evt_type = 0, optype = 0; struct oce_mq_cqe *cqe; struct oce_async_cqe_link_state *acqe; + struct oce_async_event_grp5_pvid_state *gcqe; + bus_dmamap_sync(cq->ring->dma.tag, cq->ring->dma.map, BUS_DMASYNC_POSTWRITE); cqe = RING_GET_CONSUMER_ITEM_VA(cq->ring, struct oce_mq_cqe); + while (cqe->u0.dw[3]) { DW_SWAP((uint32_t *) cqe, sizeof(oce_mq_cqe)); if (cqe->u0.s.async_event) { - acqe = (struct oce_async_cqe_link_state *)cqe; - if ((acqe->u0.s.link_status & ~ASYNC_EVENT_LOGICAL) == - ASYNC_EVENT_LINK_UP) { - sc->link_status = ASYNC_EVENT_LINK_UP; - if_link_state_change(sc->ifp, LINK_STATE_UP); - } else { - sc->link_status = ASYNC_EVENT_LINK_DOWN; - if_link_state_change(sc->ifp, LINK_STATE_DOWN); - } - - if (acqe->u0.s.event_code == - ASYNC_EVENT_CODE_LINK_STATE) { - sc->link_speed = acqe->u0.s.speed; - sc->qos_link_speed = - (uint32_t )acqe->u0.s.qos_link_speed * 10; + evt_type = cqe->u0.s.event_type; + optype = cqe->u0.s.async_type; + if (evt_type == ASYNC_EVENT_CODE_LINK_STATE) { + /* Link status evt */ + acqe = (struct oce_async_cqe_link_state *)cqe; + process_link_state(sc, acqe); + } else if ((evt_type == ASYNC_EVENT_GRP5) && + (optype == ASYNC_EVENT_PVID_STATE)) { + /* GRP5 PVID */ + gcqe = + (struct oce_async_event_grp5_pvid_state *)cqe; + if (gcqe->enabled) + sc->pvid = gcqe->tag & VLAN_VID_MASK; + else + sc->pvid = 0; + } } cqe->u0.dw[3] = 0; RING_GET(cq->ring, 1); - RING_GET(mq->ring, 1); bus_dmamap_sync(cq->ring->dma.tag, cq->ring->dma.map, BUS_DMASYNC_POSTWRITE); cqe = RING_GET_CONSUMER_ITEM_VA(cq->ring, struct oce_mq_cqe); @@ -2001,8 +1986,10 @@ setup_max_queues_want(POCE_SOFTC sc) /* Check if it is FLEX machine. Is so dont use RSS */ if ((sc->function_mode & FNM_FLEX10_MODE) || - (!sc->rss_enable) || - (sc->flags & OCE_FLAGS_BE2)) { + (sc->function_mode & FNM_UMC_MODE) || + (sc->function_mode & FNM_VNIC_MODE) || + (!sc->rss_enable) || + (sc->flags & OCE_FLAGS_BE2)) { sc->nrqs = 1; sc->nwqs = 1; sc->rss_enable = 0; @@ -2018,11 +2005,6 @@ setup_max_queues_want(POCE_SOFTC sc) sc->nrqs = MIN(OCE_NCPUS, max_rss) + 1; /* 1 for def RX */ sc->nwqs = MIN(OCE_NCPUS, max_rss); - - /*Hardware issue. Turn off multi TX for be2 */ - if (IS_BE(sc) && (sc->flags & OCE_FLAGS_BE2)) - sc->nwqs = 1; - } } @@ -2034,8 +2016,6 @@ update_queues_got(POCE_SOFTC sc) if (sc->rss_enable) { sc->nrqs = sc->intr_count + 1; sc->nwqs = sc->intr_count; - if (IS_BE(sc) && (sc->flags & OCE_FLAGS_BE2)) - sc->nwqs = 1; } else { sc->nrqs = 1; sc->nwqs = 1; Modified: head/sys/dev/oce/oce_if.h ============================================================================== --- head/sys/dev/oce/oce_if.h Fri Feb 17 13:45:34 2012 (r231878) +++ head/sys/dev/oce/oce_if.h Fri Feb 17 13:55:17 2012 (r231879) @@ -36,7 +36,6 @@ * Costa Mesa, CA 92626 */ - /* $FreeBSD$ */ #include @@ -88,7 +87,9 @@ #include "oce_hw.h" -#define COMPONENT_REVISION "4.2.116.0" +/* OCE device driver module component revision informaiton */ +#define COMPONENT_REVISION "4.2.127.0" + /* OCE devices supported by this driver */ #define PCI_VENDOR_EMULEX 0x10df /* Emulex */ @@ -111,7 +112,9 @@ extern int mp_ncpus; /* system's total active cpu cores */ #define OCE_NCPUS mp_ncpus -#define OCE_MAX_RSS 8 /* This should be powers of 2. Like 2,4,8 & 16 */ + +/* This should be powers of 2. Like 2,4,8 & 16 */ +#define OCE_MAX_RSS 4 /* TODO: 8*/ #define OCE_LEGACY_MODE_RSS 4 /* For BE3 Legacy mode*/ #define OCE_MIN_RQ 1 @@ -171,8 +174,7 @@ extern int mp_ncpus; /* system's total #define OCE_IF_HWASSIST (CSUM_IP | CSUM_TCP | CSUM_UDP) #define OCE_IF_CAPABILITIES (IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | \ - IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | \ - IFCAP_VLAN_MTU) + IFCAP_JUMBO_MTU | IFCAP_VLAN_MTU) #define OCE_IF_HWASSIST_NONE 0 #define OCE_IF_CAPABILITIES_NONE 0 @@ -835,6 +837,7 @@ typedef struct oce_softc { struct oce_drv_stats oce_stats_info; struct callout timer; int8_t be3_native; + uint32_t pvid; } OCE_SOFTC, *POCE_SOFTC; @@ -926,10 +929,12 @@ uint32_t oce_page_list(oce_ring_buffer_t /*********************************************************** * cleanup functions ***********************************************************/ -void oce_free_lro(POCE_SOFTC sc); void oce_stop_rx(POCE_SOFTC sc); void oce_intr_free(POCE_SOFTC sc); void oce_free_posted_rxbuf(struct oce_rq *rq); +#if defined(INET6) || defined(INET) +void oce_free_lro(POCE_SOFTC sc); +#endif /************************************************************ @@ -940,6 +945,8 @@ int oce_reset_fun(POCE_SOFTC sc); int oce_mbox_init(POCE_SOFTC sc); int oce_mbox_dispatch(POCE_SOFTC sc, uint32_t tmo_sec); int oce_get_fw_version(POCE_SOFTC sc); +int oce_first_mcc_cmd(POCE_SOFTC sc); + int oce_read_mac_addr(POCE_SOFTC sc, uint32_t if_id, uint8_t perm, uint8_t type, struct mac_address_format *mac); int oce_get_fw_config(POCE_SOFTC sc); Modified: head/sys/dev/oce/oce_mbox.c ============================================================================== --- head/sys/dev/oce/oce_mbox.c Fri Feb 17 13:45:34 2012 (r231878) +++ head/sys/dev/oce/oce_mbox.c Fri Feb 17 13:55:17 2012 (r231879) @@ -37,10 +37,8 @@ */ - /* $FreeBSD$ */ - #include "oce_if.h" @@ -145,7 +143,6 @@ oce_mbox_wait(POCE_SOFTC sc, uint32_t tm } - /** * @brief Mailbox dispatch * @param sc software handle to the device @@ -289,6 +286,42 @@ oce_get_fw_version(POCE_SOFTC sc) /** + * @brief Firmware will send gracious notifications during + * attach only after sending first mcc commnad. We + * use MCC queue only for getting async and mailbox + * for sending cmds. So to get gracious notifications + * atleast send one dummy command on mcc. + */ +int +oce_first_mcc_cmd(POCE_SOFTC sc) +{ + struct oce_mbx *mbx; + struct oce_mq *mq = sc->mq; + struct mbx_get_common_fw_version *fwcmd; + uint32_t reg_value; + + mbx = RING_GET_PRODUCER_ITEM_VA(mq->ring, struct oce_mbx); + bzero(mbx, sizeof(struct oce_mbx)); + + fwcmd = (struct mbx_get_common_fw_version *)&mbx->payload; + mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0, + MBX_SUBSYSTEM_COMMON, + OPCODE_COMMON_GET_FW_VERSION, + MBX_TIMEOUT_SEC, + sizeof(struct mbx_get_common_fw_version), + OCE_MBX_VER_V0); + mbx->u0.s.embedded = 1; + mbx->payload_length = sizeof(struct mbx_get_common_fw_version); + bus_dmamap_sync(mq->ring->dma.tag, mq->ring->dma.map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + RING_PUT(mq->ring, 1); + reg_value = (1 << 16) | mq->mq_id; + OCE_WRITE_REG32(sc, db, PD_MQ_DB, reg_value); + + return 0; +} + +/** * @brief Function to post a MBX to the mbox * @param sc software handle to the device * @param mbx pointer to the MBX to send @@ -1328,6 +1361,7 @@ oce_mbox_write_flashrom(POCE_SOFTC sc, u sgl->length = payload_len; /* post the command */ + rc = oce_mbox_post(sc, &mbx, NULL); if (rc) { device_printf(sc->dev, "Write FlashROM mbox post failed\n"); } else { Modified: head/sys/dev/oce/oce_queue.c ============================================================================== --- head/sys/dev/oce/oce_queue.c Fri Feb 17 13:45:34 2012 (r231878) +++ head/sys/dev/oce/oce_queue.c Fri Feb 17 13:55:17 2012 (r231879) @@ -36,11 +36,8 @@ * Costa Mesa, CA 92626 */ - - /* $FreeBSD$ */ - #include "oce_if.h" /***************************************************** @@ -653,11 +650,11 @@ static struct oce_mq * oce_mq_create(POCE_SOFTC sc, struct oce_eq *eq, uint32_t q_len) { struct oce_mbx mbx; - struct mbx_create_common_mq *fwcmd = NULL; + struct mbx_create_common_mq_ex *fwcmd = NULL; struct oce_mq *mq = NULL; int rc = 0; struct oce_cq *cq; - oce_mq_ctx_t *ctx; + oce_mq_ext_ctx_t *ctx; uint32_t num_pages; uint32_t page_size; uint32_t version; @@ -683,13 +680,13 @@ oce_mq_create(POCE_SOFTC sc, struct oce_ bzero(&mbx, sizeof(struct oce_mbx)); - fwcmd = (struct mbx_create_common_mq *)&mbx.payload; + fwcmd = (struct mbx_create_common_mq_ex *)&mbx.payload; version = OCE_MBX_VER_V0; mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0, MBX_SUBSYSTEM_COMMON, - OPCODE_COMMON_CREATE_MQ, + OPCODE_COMMON_CREATE_MQ_EXT, MBX_TIMEOUT_SEC, - sizeof(struct mbx_create_common_mq), + sizeof(struct mbx_create_common_mq_ex), version); num_pages = oce_page_list(mq->ring, &fwcmd->params.req.pages[0]); @@ -700,9 +697,11 @@ oce_mq_create(POCE_SOFTC sc, struct oce_ ctx->v0.cq_id = cq->cq_id; ctx->v0.ring_size = OCE_LOG2(q_len) + 1; ctx->v0.valid = 1; + /* Subscribe to Link State and Group 5 Events(bits 1 and 5 set) */ + ctx->v0.async_evt_bitmap = 0xffffffff; mbx.u0.s.embedded = 1; - mbx.payload_length = sizeof(struct mbx_create_common_mq); + mbx.payload_length = sizeof(struct mbx_create_common_mq_ex); DW_SWAP(u32ptr(&mbx), mbx.payload_length + OCE_BMBX_RHDR_SZ); rc = oce_mbox_post(sc, &mbx, NULL); Modified: head/sys/dev/oce/oce_sysctl.c ============================================================================== --- head/sys/dev/oce/oce_sysctl.c Fri Feb 17 13:45:34 2012 (r231878) +++ head/sys/dev/oce/oce_sysctl.c Fri Feb 17 13:55:17 2012 (r231879) @@ -36,10 +36,8 @@ * Costa Mesa, CA 92626 */ - /* $FreeBSD$ */ - #include "oce_if.h" static void copy_stats_to_sc_xe201(POCE_SOFTC sc); @@ -108,6 +106,13 @@ oce_add_sysctls(POCE_SOFTC sc) &sc->speed, 0,"Link Speed"); + if (sc->function_mode & FNM_UMC_MODE) + SYSCTL_ADD_UINT(ctx, child, + OID_AUTO, "pvid", + CTLFLAG_RD, + &sc->pvid, + 0,"PVID"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "loop_back", CTLTYPE_INT | CTLFLAG_RW, (void *)sc, 0, oce_sysctl_loopback, "I", "Loop Back Tests"); Modified: head/sys/dev/oce/oce_util.c ============================================================================== --- head/sys/dev/oce/oce_util.c Fri Feb 17 13:45:34 2012 (r231878) +++ head/sys/dev/oce/oce_util.c Fri Feb 17 13:55:17 2012 (r231879) @@ -36,10 +36,8 @@ * Costa Mesa, CA 92626 */ - /* $FreeBSD$ */ - #include "oce_if.h" static void oce_dma_map_ring(void *arg, From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 14:02:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41F6D106564A; Fri, 17 Feb 2012 14:02:45 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CD488FC18; Fri, 17 Feb 2012 14:02:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1HE2jB6081451; Fri, 17 Feb 2012 14:02:45 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1HE2iEu081448; Fri, 17 Feb 2012 14:02:44 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201202171402.q1HE2iEu081448@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 17 Feb 2012 14:02: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: r231880 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 14:02:45 -0000 Author: luigi Date: Fri Feb 17 14:02:44 2012 New Revision: 231880 URL: http://svn.freebsd.org/changeset/base/231880 Log: add manpage for the "oce" driver Submitted by: Naresh Raju Gottumukkala (Emulex) MFC after: 3 days Added: head/share/man/man4/oce.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Feb 17 13:55:17 2012 (r231879) +++ head/share/man/man4/Makefile Fri Feb 17 14:02:44 2012 (r231880) @@ -328,6 +328,7 @@ MAN= aac.4 \ ${_nvram.4} \ ${_nvram2env.4} \ ${_nxge.4} \ + oce.4 \ ohci.4 \ orm.4 \ ${_padlock.4} \ Added: head/share/man/man4/oce.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/oce.4 Fri Feb 17 14:02:44 2012 (r231880) @@ -0,0 +1,117 @@ +.\" Copyright (C) 2012 Emulex +.\" 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 Emulex Corporation 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 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. +.\" +.\" Contact Information: +.\" freebsd-drivers@emulex.com +.\" +.\" Emulex +.\" 3333 Susan Street +.\" Costa Mesa, CA 92626 +.\" +.\" $FreeBSD$ +.\" + + +.Dd February 14, 2012 +.Dt OCE 4 +.Os +.Sh NAME +.Nm oce +.Nd "Device driver for Emulex OneConnect 10Gb network adapters" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device oce" +.Ed +.Pp +To load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_oce_load="YES" +.Ed +.Sh DESCRIPTION +Emulex one connect adapters come in various skews and with +different combinations of NIC, FCoE and iSCSI functions. +oce claims the NIC functions in all these adapters. +.Pp +The +.Nm +driver supports VLAN Hardware offload, TCP checksum offload, +TCP segmentation offload (TSO), Large receive offload (LRO), +Bonding, Jumbo frames (from 1500 - 9000), Multiple TX queues, +Receive-Side Scaling(RSS) and MSI-X interrupts. +.Sh HARDWARE +.Nm +driver supports the following Emulex network adapters: +.Bl -bullet -compact +.It +BladeEngine 2 +.It +BladeEngine 3 +.It +Lancer +.El +.Sh UPDATING FIRMWARE +Adapter firmware updates are persistent. + +Firmware can be updated by following the steps below: +.nf + 1) Copy the below code to a Makefile + ".KMOD=elxflash + FIRMWS=imagename.ufi:elxflash + .include " + 2) Replace imagename in above with UFI file name. + 3) Copy Makefile and UFI to a directory + 4) Execute make & copy generated elxflash.ko to /lib/modules + 5) sysctl dev.oce..fw_upgrade=elxflash + 6) Reboot the machine. + +In case of issues with supplied UFI, flashing fails with one +of the below errors. + 1) "Invalid BE3 firmware image" + 2) "Invalid Cookie. Firmware image corrupted ?" + 3) "cmd to write to flash rom failed." +.fi +.Sh SUPPORT +For general information and support, +go to the Emulex website at: +.Fa http://www.Emulex.com/ +or E-Mail at +.Fa freebsd-drivers@emulex.com. +.Sh SEE ALSO +.Xr ifconfig 8 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An freebsd-drivers@emulex.com. From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 14:09:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38C5F1065670; Fri, 17 Feb 2012 14:09:05 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21C8F8FC16; Fri, 17 Feb 2012 14:09:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1HE95cY081685; Fri, 17 Feb 2012 14:09:05 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1HE94sg081678; Fri, 17 Feb 2012 14:09:04 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201202171409.q1HE94sg081678@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 17 Feb 2012 14:09: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: r231881 - head/sys/dev/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 14:09:05 -0000 Author: luigi Date: Fri Feb 17 14:09:04 2012 New Revision: 231881 URL: http://svn.freebsd.org/changeset/base/231881 Log: Various cleanups for readability (no functional changes) - remove the KEVENT code, which was incomplete and not compiled anyways; - change some while() loops into for() - adjust indentation - remove extra whitespace MFC after: 1 week Modified: head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Fri Feb 17 14:02:44 2012 (r231880) +++ head/sys/dev/netmap/if_em_netmap.h Fri Feb 17 14:09:04 2012 (r231881) @@ -212,7 +212,7 @@ em_netmap_txsync(struct ifnet *ifp, u_in j = kring->nr_hwcur; if (j != k) { /* we have packets to send */ l = netmap_tidx_k2n(na, ring_nr, j); - while (j != k) { + for (n = 0; j != k; n++) { struct netmap_slot *slot = &ring->slot[j]; struct e1000_tx_desc *curr = &txr->tx_base[l]; struct em_buffer *txbuf = &txr->tx_buffers[l]; @@ -245,7 +245,6 @@ em_netmap_txsync(struct ifnet *ifp, u_in BUS_DMASYNC_PREWRITE); j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; - n++; } kring->nr_hwcur = k; @@ -339,9 +338,8 @@ em_netmap_rxsync(struct ifnet *ifp, u_in /* skip past packets that userspace has already processed */ j = kring->nr_hwcur; /* netmap ring index */ if (j != k) { /* userspace has read some packets. */ - n = 0; l = netmap_ridx_k2n(na, ring_nr, j); /* NIC ring index */ - while (j != k) { + for (n = 0; j != k; n++) { struct netmap_slot *slot = &ring->slot[j]; struct e1000_rx_desc *curr = &rxr->rx_base[l]; struct em_buffer *rxbuf = &rxr->rx_buffers[l]; @@ -367,7 +365,6 @@ em_netmap_rxsync(struct ifnet *ifp, u_in j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; - n++; } kring->nr_hwavail -= n; kring->nr_hwcur = k; Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Fri Feb 17 14:02:44 2012 (r231880) +++ head/sys/dev/netmap/if_igb_netmap.h Fri Feb 17 14:09:04 2012 (r231881) @@ -170,7 +170,7 @@ igb_netmap_txsync(struct ifnet *ifp, u_i (adapter->hw.mac.type == e1000_82575) ? (txr->me << 4) : 0; l = netmap_tidx_k2n(na, ring_nr, j); - while (j != k) { + for (n = 0; j != k; n++) { struct netmap_slot *slot = &ring->slot[j]; union e1000_adv_tx_desc *curr = (union e1000_adv_tx_desc *)&txr->tx_base[l]; @@ -209,7 +209,6 @@ igb_netmap_txsync(struct ifnet *ifp, u_i BUS_DMASYNC_PREWRITE); j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; - n++; } kring->nr_hwcur = k; @@ -306,9 +305,8 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i /* skip past packets that userspace has already processed */ j = kring->nr_hwcur; if (j != k) { /* userspace has read some packets. */ - n = 0; l = netmap_ridx_k2n(na, ring_nr, j); - while (j != k) { + for (n = 0; j != k; n++) { struct netmap_slot *slot = ring->slot + j; union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; struct igb_rx_buf *rxbuf = rxr->rx_buffers + l; @@ -333,7 +331,6 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; - n++; } kring->nr_hwavail -= n; kring->nr_hwcur = k; Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Fri Feb 17 14:02:44 2012 (r231880) +++ head/sys/dev/netmap/if_lem_netmap.h Fri Feb 17 14:09:04 2012 (r231881) @@ -175,7 +175,7 @@ lem_netmap_txsync(struct ifnet *ifp, u_i j = kring->nr_hwcur; if (j != k) { /* we have packets to send */ l = netmap_tidx_k2n(na, ring_nr, j); - while (j != k) { + for (n = 0; j != k; n++) { struct netmap_slot *slot = &ring->slot[j]; struct e1000_tx_desc *curr = &adapter->tx_desc_base[l]; struct em_buffer *txbuf = &adapter->tx_buffer_area[l]; @@ -208,7 +208,6 @@ lem_netmap_txsync(struct ifnet *ifp, u_i BUS_DMASYNC_PREWRITE); j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; - n++; } kring->nr_hwcur = k; @@ -306,9 +305,8 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i /* skip past packets that userspace has already processed */ j = kring->nr_hwcur; /* netmap ring index */ if (j != k) { /* userspace has read some packets. */ - n = 0; l = netmap_ridx_k2n(na, ring_nr, j); /* NIC ring index */ - while (j != k) { + for (n = 0; j != k; n++) { struct netmap_slot *slot = &ring->slot[j]; struct e1000_rx_desc *curr = &adapter->rx_desc_base[l]; struct em_buffer *rxbuf = &adapter->rx_buffer_area[l]; @@ -334,7 +332,6 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; - n++; } kring->nr_hwavail -= n; kring->nr_hwcur = k; Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Fri Feb 17 14:02:44 2012 (r231880) +++ head/sys/dev/netmap/if_re_netmap.h Fri Feb 17 14:09:04 2012 (r231881) @@ -175,9 +175,8 @@ re_netmap_txsync(struct ifnet *ifp, u_in j = kring->nr_hwcur; if (j != k) { /* we have new packets to send */ - n = 0; l = sc->rl_ldata.rl_tx_prodidx; - while (j != k) { + for (n = 0; j != k; n++) { struct netmap_slot *slot = &ring->slot[j]; struct rl_desc *desc = &sc->rl_ldata.rl_tx_list[l]; int cmd = slot->len | RL_TDESC_CMD_EOF | @@ -210,7 +209,6 @@ re_netmap_txsync(struct ifnet *ifp, u_in txd[l].tx_dmamap, BUS_DMASYNC_PREWRITE); j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; - n++; } sc->rl_ldata.rl_tx_prodidx = l; kring->nr_hwcur = k; @@ -295,9 +293,8 @@ re_netmap_rxsync(struct ifnet *ifp, u_in */ j = kring->nr_hwcur; if (j != k) { /* userspace has read some packets. */ - n = 0; l = netmap_ridx_k2n(na, ring_nr, j); /* the NIC index */ - while (j != k) { + for (n = 0; j != k; n++) { struct netmap_slot *slot = ring->slot + j; struct rl_desc *desc = &sc->rl_ldata.rl_rx_list[l]; int cmd = na->buff_size | RL_RDESC_CMD_OWN; @@ -326,7 +323,6 @@ re_netmap_rxsync(struct ifnet *ifp, u_in rxd[l].rx_dmamap, BUS_DMASYNC_PREREAD); j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; - n++; } kring->nr_hwavail -= n; kring->nr_hwcur = k; @@ -366,11 +362,10 @@ re_netmap_tx_init(struct rl_softc *sc) /* l points in the netmap ring, i points in the NIC ring */ for (i = 0; i < n; i++) { - void *addr; uint64_t paddr; int l = netmap_tidx_n2k(na, 0, i); + void *addr = PNMB(slot + l, &paddr); - addr = PNMB(slot + l, &paddr); desc[i].rl_bufaddr_lo = htole32(RL_ADDR_LO(paddr)); desc[i].rl_bufaddr_hi = htole32(RL_ADDR_HI(paddr)); netmap_load_map(sc->rl_ldata.rl_tx_mtag, Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Fri Feb 17 14:02:44 2012 (r231880) +++ head/sys/dev/netmap/ixgbe_netmap.h Fri Feb 17 14:09:04 2012 (r231881) @@ -242,8 +242,7 @@ ixgbe_netmap_txsync(struct ifnet *ifp, u j = kring->nr_hwcur; if (j != k) { /* we have new packets to send */ l = netmap_tidx_k2n(na, ring_nr, j); /* NIC index */ - - while (j != k) { + for (n = 0; j != k; n++) { /* * Collect per-slot info. * Note that txbuf and curr are indexed by l. @@ -281,6 +280,11 @@ ring_reset: } slot->flags &= ~NS_REPORT; + if (slot->flags & NS_BUF_CHANGED) { + /* buffer has changed, unload and reload map */ + netmap_reload_map(txr->txtag, txbuf->map, addr); + slot->flags &= ~NS_BUF_CHANGED; + } /* * Fill the slot in the NIC ring. * In this driver we need to rewrite the buffer @@ -295,25 +299,14 @@ ring_reset: IXGBE_ADVTXD_DCMD_DEXT | IXGBE_ADVTXD_DCMD_IFCS | IXGBE_TXD_CMD_EOP | flags) ); - /* If the buffer has changed, unload and reload map - * (and possibly the physical address in the NIC - * slot, but we did it already). - */ - if (slot->flags & NS_BUF_CHANGED) { - /* buffer has changed, unload and reload map */ - netmap_reload_map(txr->txtag, txbuf->map, addr); - slot->flags &= ~NS_BUF_CHANGED; - } /* make sure changes to the buffer are synced */ bus_dmamap_sync(txr->txtag, txbuf->map, BUS_DMASYNC_PREWRITE); j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; - n++; } kring->nr_hwcur = k; /* the saved ring->cur */ - /* decrease avail by number of sent packets */ kring->nr_hwavail -= n; @@ -356,7 +349,7 @@ ring_reset: j= (j < kring->nkr_num_slots / 4 || j >= kring->nkr_num_slots*3/4) ? 0 : report_frequency; kring->nr_kflags = j; /* the slot to check */ - j = txd[j].upper.fields.status & IXGBE_TXD_STAT_DD; + j = txd[j].upper.fields.status & IXGBE_TXD_STAT_DD; // XXX cpu_to_le32 ? } if (j) { int delta; @@ -396,7 +389,6 @@ ring_reset: if (do_lock) IXGBE_TX_UNLOCK(txr); return 0; - } @@ -460,25 +452,25 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u l = rxr->next_to_check; j = netmap_ridx_n2k(na, ring_nr, l); - if (netmap_no_pendintr || force_update) { - for (n = 0; ; n++) { - union ixgbe_adv_rx_desc *curr = &rxr->rx_base[l]; - uint32_t staterr = le32toh(curr->wb.upper.status_error); - - if ((staterr & IXGBE_RXD_STAT_DD) == 0) - break; - ring->slot[j].len = le16toh(curr->wb.upper.length); - bus_dmamap_sync(rxr->ptag, - rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); - j = (j == lim) ? 0 : j + 1; - l = (l == lim) ? 0 : l + 1; - } - if (n) { /* update the state variables */ - rxr->next_to_check = l; - kring->nr_hwavail += n; + if (netmap_no_pendintr || force_update) { + for (n = 0; ; n++) { + union ixgbe_adv_rx_desc *curr = &rxr->rx_base[l]; + uint32_t staterr = le32toh(curr->wb.upper.status_error); + + if ((staterr & IXGBE_RXD_STAT_DD) == 0) + break; + ring->slot[j].len = le16toh(curr->wb.upper.length); + bus_dmamap_sync(rxr->ptag, + rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); + j = (j == lim) ? 0 : j + 1; + l = (l == lim) ? 0 : l + 1; + } + if (n) { /* update the state variables */ + rxr->next_to_check = l; + kring->nr_hwavail += n; + } + kring->nr_kflags &= ~NKR_PENDINTR; } - kring->nr_kflags &= ~NKR_PENDINTR; - } /* * Skip past packets that userspace has already processed @@ -489,9 +481,8 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u */ j = kring->nr_hwcur; if (j != k) { /* userspace has read some packets. */ - n = 0; l = netmap_ridx_k2n(na, ring_nr, j); - while (j != k) { + for (n = 0; j != k; n++) { /* collect per-slot info, with similar validations * and flag handling as in the txsync code. * @@ -509,19 +500,16 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u if (addr == netmap_buffer_base) /* bad buf */ goto ring_reset; - curr->wb.upper.status_error = 0; - curr->read.pkt_addr = htole64(paddr); if (slot->flags & NS_BUF_CHANGED) { netmap_reload_map(rxr->ptag, rxbuf->pmap, addr); slot->flags &= ~NS_BUF_CHANGED; } - + curr->wb.upper.status_error = 0; + curr->read.pkt_addr = htole64(paddr); bus_dmamap_sync(rxr->ptag, rxbuf->pmap, BUS_DMASYNC_PREREAD); - j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; - n++; } kring->nr_hwavail -= n; kring->nr_hwcur = k; Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri Feb 17 14:02:44 2012 (r231880) +++ head/sys/dev/netmap/netmap.c Fri Feb 17 14:09:04 2012 (r231881) @@ -24,9 +24,6 @@ */ /* - * $FreeBSD$ - * $Id: netmap.c 9795 2011-12-02 11:39:08Z luigi $ - * * This module supports memory mapped access to network devices, * see netmap(4). * @@ -634,100 +631,6 @@ struct netmap_priv_d { }; -static struct cdev *netmap_dev; /* /dev/netmap character device. */ - - -static d_mmap_t netmap_mmap; -static d_ioctl_t netmap_ioctl; -static d_poll_t netmap_poll; - -#ifdef NETMAP_KEVENT -static d_kqfilter_t netmap_kqfilter; -#endif - -static struct cdevsw netmap_cdevsw = { - .d_version = D_VERSION, - .d_name = "netmap", - .d_mmap = netmap_mmap, - .d_ioctl = netmap_ioctl, - .d_poll = netmap_poll, -#ifdef NETMAP_KEVENT - .d_kqfilter = netmap_kqfilter, -#endif -}; - -#ifdef NETMAP_KEVENT -static int netmap_kqread(struct knote *, long); -static int netmap_kqwrite(struct knote *, long); -static void netmap_kqdetach(struct knote *); - -static struct filterops netmap_read_filterops = { - .f_isfd = 1, - .f_attach = NULL, - .f_detach = netmap_kqdetach, - .f_event = netmap_kqread, -}; - -static struct filterops netmap_write_filterops = { - .f_isfd = 1, - .f_attach = NULL, - .f_detach = netmap_kqdetach, - .f_event = netmap_kqwrite, -}; - -/* - * support for the kevent() system call. - * - * This is the kevent filter, and is executed each time a new event - * is triggered on the device. This function execute some operation - * depending on the received filter. - * - * The implementation should test the filters and should implement - * filter operations we are interested on (a full list in /sys/event.h). - * - * On a match we should: - * - set kn->kn_fop - * - set kn->kn_hook - * - call knlist_add() to deliver the event to the application. - * - * Return 0 if the event should be delivered to the application. - */ -static int -netmap_kqfilter(struct cdev *dev, struct knote *kn) -{ - /* declare variables needed to read/write */ - - switch(kn->kn_filter) { - case EVFILT_READ: - if (netmap_verbose) - D("%s kqfilter: EVFILT_READ" ifp->if_xname); - - /* read operations */ - kn->kn_fop = &netmap_read_filterops; - break; - - case EVFILT_WRITE: - if (netmap_verbose) - D("%s kqfilter: EVFILT_WRITE" ifp->if_xname); - - /* write operations */ - kn->kn_fop = &netmap_write_filterops; - break; - - default: - if (netmap_verbose) - D("%s kqfilter: invalid filter" ifp->if_xname); - return(EINVAL); - } - - kn->kn_hook = 0;// - knlist_add(&netmap_sc->tun_rsel.si_note, kn, 0); - - return (0); -} -#endif /* NETMAP_KEVENT */ - - /* * File descriptor's private data destructor. * @@ -822,14 +725,16 @@ netmap_dtor(void *data) * * Return 0 on success, -1 otherwise. */ + static int +netmap_mmap(__unused struct cdev *dev, #if __FreeBSD_version < 900000 -netmap_mmap(__unused struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, - int nprot) + vm_offset_t offset, vm_paddr_t *paddr, int nprot #else -netmap_mmap(__unused struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, - int nprot, __unused vm_memattr_t *memattr) + vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, + __unused vm_memattr_t *memattr #endif + ) { if (nprot & PROT_EXEC) return (-1); // XXX -1 or EINVAL ? @@ -1252,11 +1157,8 @@ error: D("ignore BIOCIMMEDIATE/BIOCSHDRCMPLT/BIOCSHDRCMPLT/BIOCSSEESENT"); break; - default: + default: /* allow device-specific ioctls */ { - /* - * allow device calls - */ struct socket so; bzero(&so, sizeof(so)); error = get_ifp(nmr->nr_name, &ifp); /* keep reference */ @@ -1266,6 +1168,7 @@ error: // so->so_proto not null. error = ifioctl(&so, cmd, data, td); if_rele(ifp); + break; } } @@ -1477,19 +1380,19 @@ netmap_poll(__unused struct cdev *dev, i /*------- driver support routines ------*/ /* - * default lock wrapper. On linux we use mostly netmap-specific locks. + * default lock wrapper. */ static void -netmap_lock_wrapper(struct ifnet *_a, int what, u_int queueid) +netmap_lock_wrapper(struct ifnet *dev, int what, u_int queueid) { - struct netmap_adapter *na = NA(_a); + struct netmap_adapter *na = NA(dev); switch (what) { -#ifndef __FreeBSD__ /* some system do not need lock on register */ +#ifdef linux /* some system do not need lock on register */ case NETMAP_REG_LOCK: case NETMAP_REG_UNLOCK: break; -#endif +#endif /* linux */ case NETMAP_CORE_LOCK: mtx_lock(&na->core_lock); @@ -1701,7 +1604,8 @@ netmap_reset(struct netmap_adapter *na, * N rings, separate locks: * lock(i); wake(i); unlock(i); lock(core) wake(N+1) unlock(core) */ -int netmap_rx_irq(struct ifnet *ifp, int q, int *work_done) +int +netmap_rx_irq(struct ifnet *ifp, int q, int *work_done) { struct netmap_adapter *na; struct netmap_kring *r; @@ -1731,6 +1635,18 @@ int netmap_rx_irq(struct ifnet *ifp, int return 1; } +static struct cdevsw netmap_cdevsw = { + .d_version = D_VERSION, + .d_name = "netmap", + .d_mmap = netmap_mmap, + .d_ioctl = netmap_ioctl, + .d_poll = netmap_poll, +}; + + +static struct cdev *netmap_dev; /* /dev/netmap character device. */ + + /* * Module loader. * @@ -1744,7 +1660,6 @@ netmap_init(void) { int error; - error = netmap_memory_init(); if (error != 0) { printf("netmap: unable to initialize the memory allocator."); @@ -1752,11 +1667,9 @@ netmap_init(void) } printf("netmap: loaded module with %d Mbytes\n", (int)(netmap_mem_d->nm_totalsize >> 20)); - netmap_dev = make_dev(&netmap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0660, "netmap"); - - return (0); + return (error); } @@ -1769,9 +1682,7 @@ static void netmap_fini(void) { destroy_dev(netmap_dev); - netmap_memory_fini(); - printf("netmap: unloaded module.\n"); } From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 14:10:49 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB57C106566C; Fri, 17 Feb 2012 14:10:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail12.syd.optusnet.com.au (mail12.syd.optusnet.com.au [211.29.132.193]) by mx1.freebsd.org (Postfix) with ESMTP id 4A4B28FC1B; Fri, 17 Feb 2012 14:10:48 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail12.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1HEAj1b009626 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 18 Feb 2012 01:10:46 +1100 Date: Sat, 18 Feb 2012 01:10:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon In-Reply-To: <4F3E2150.8030504@FreeBSD.org> Message-ID: <20120218004042.L2893@besplex.bde.org> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> <4F3E2150.8030504@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Mailman-Approved-At: Fri, 17 Feb 2012 14:35:09 +0000 Cc: marcel@FreeBSD.org, Eitan Adler , svn-src-all@FreeBSD.org, "Kenneth D. Merry" , Marcel Moolenaar , src-committers@FreeBSD.org, Bruce Evans , svn-src-head@FreeBSD.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 14:10:49 -0000 On Fri, 17 Feb 2012, Andriy Gapon wrote: > Since this issue has generated a sudden interest, I would like to use this > opportunity to point my older proposal as well: > http://lists.freebsd.org/pipermail/freebsd-arch/2011-August/011405.html Sorry I didn't check this now, and I don't remember it from last year :-). > Essentially the algorithm is: > 1. atomically (CAS) reserve a space in the message data buffer > 2. output full message to the reserved space (no contention here) This was essentially what it did in 2003, but with a reservation of only 1 byte since that seemed to be enough at the time. There is still non-atomicity for outputting to the reserved space, and contention in the unlikely event that there are enough callers to wrap the message buffer (the old code mentions a problem if there are the number of concurrent callers is >= the size of the message buffer, but I think the problem is a bit larger than that -- it only takes 2 concurrent callers, with one going very slowly while the other repeats calls that fills the message buffer. One going slowly can probably be easily arranged by single stepping it in a debugger). But these problems are rare. BTW, -current seems to have broken the checksum update for negative characters by removing one of the u_char casts. The char from the msgbuf is still cast to u_char, but the char in the int arg is now cast directly to u_int. All versions cast both terms u_int, but these casts are unimportant since the checksum is a u_int so the casts have no effect on systems with 32-bit 2's complement ints. > 3. atomically (CAS) append a pointer to the message in the message pointers buffer I wouldn't like this :-). Hmm, you could have a secondary buffer with hints to detect and recover from reordering in the main buffer. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 17:03:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B1F5106564A; Fri, 17 Feb 2012 17:03:15 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id E26038FC22; Fri, 17 Feb 2012 17:03:14 +0000 (UTC) Received: from [172.23.7.53] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q1HH32vJ004385 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 17 Feb 2012 09:03:08 -0800 (PST) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=iso-8859-1 From: Marcel Moolenaar In-Reply-To: <4F3E0596.6040808@freebsd.org> Date: Fri, 17 Feb 2012 09:03:02 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> <4F3E0596.6040808@freebsd.org> To: Julian Elischer X-Mailer: Apple Mail (2.1257) Cc: marcel@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, "Kenneth D. Merry" , Andriy Gapon , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 17:03:15 -0000 On Feb 16, 2012, at 11:45 PM, Julian Elischer wrote: *snip* >> The message buffer does not have to be a chunk of memory that >> we circularly scribble to. It can be a per-cpu linked list of >> messages even. *snip* > that is an intersting thought.. though.. how would you sort them into = order for > printing? >=20 > maybe a single atomic 64 bit int that is incremented per message. Yes. Though, a timestamp should do the trick as well. In a multi-core system, you won't have pure or absolute sequentially anymore. For messages that are "printed" at the proverbial "same time" on different cores, ordering is very hard, if not impossible, to determine. A single atomic counter would force sequentially, but would effectively introduce serialization, just like locking, and would make a per-cpu message buffer/list/whatever less useful. The theory: the closer in time independent messages are printed (on different cores), the least important their ordering becomes. --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 15:08:49 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB6EA106564A; Fri, 17 Feb 2012 15:08:49 +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 479178FC16; Fri, 17 Feb 2012 15:08:49 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1HF8jeO027927 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 18 Feb 2012 02:08:46 +1100 Date: Sat, 18 Feb 2012 02:08:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pawel Jakub Dawidek In-Reply-To: <20120217092038.GD1358@garage.freebsd.pl> Message-ID: <20120218013015.L3043@besplex.bde.org> References: <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> <20120217085840.GC1358@garage.freebsd.pl> <4F3E18CE.1010700@freebsd.org> <20120217092038.GD1358@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Mailman-Approved-At: Fri, 17 Feb 2012 17:06:26 +0000 Cc: marcel@FreeBSD.org, Eitan Adler , svn-src-all@FreeBSD.org, "Kenneth D. Merry" , Andriy Gapon , Marcel Moolenaar , src-committers@FreeBSD.org, Bruce Evans , svn-src-head@FreeBSD.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 15:08:49 -0000 On Fri, 17 Feb 2012, Pawel Jakub Dawidek wrote: > On Fri, Feb 17, 2012 at 01:07:26AM -0800, Julian Elischer wrote: >> On 2/17/12 12:58 AM, Pawel Jakub Dawidek wrote: >>> I agree with everything except for per-CPU buffers. I understand the >>> need for using printf in low-level code and it indeed complicates things. >>> The reason I don't like the idea of per-CPU buffers is that locking >>> would allow me to implement atomicity across multiple printfs. >>> For example I often use macros like this: >>> >>> #define G_MIRROR_DEBUG(lvl, ...) do { \ >>> if (g_mirror_debug>= (lvl)) { \ >>> printf("GEOM_MIRROR"); \ >>> if (g_mirror_debug> 0) \ >>> printf("[%u]", lvl); \ >>> printf(": "); \ >>> printf(__VA_ARGS__); \ >>> printf("\n"); \ >>> } \ >>> } while (0) >>> And I'd like all the printfs to be committed as one message without >>> using some additional buffer first and then single printf. >>> With some kind of printf-lock we could use recursive locking to achieve >>> this. In your proposal I may run each printf on different CPU. >>> I could eventually use sched_pin() around all printfs, I guess. >>> This still doesn't cover the case when I'm preempted between my printfs, >>> so maybe I need critical section there? I don't expect printf should be >>> fast, so it might be ok. I think that if you want such complications, you get to code them yourself, as in userland. >> with locking your example could still be broken up because there is a >> lock per printf.. >> >> if you want them done together you really should print parts to a >> separate assembly buffer and then put it all out at once. This seems to be necessary. > Not really. I was thinking about recursive printf-lock that is used > internally by printf, but can also be used by printfs consumers, eg. > > mtx_lock(&printf_lock); > printf("first thing "); > printf("second thing"); > mtx_unlock(&printf_lock); > > Again, printf internally is using printf_lock too. See my old patches. They use the printf_lock() function. Normal mutexes cannot be used, due to deadlock. printf_lock() is intentionally not recursive, and anything that recurses into it is rewarded with its 1 second timeout. It is private to subr_prf.c, and called from printf(). Apart from that, it would work OK if you called it as above :-). There would normally be a 1 second delay when each of the printf()s recursed. I vaguely remember having recursion in the original version of it, and then left it out because it caused fragility and minor complications. Recursion shouldn't happen, and when it does the timeout works well. >> I actually like the idea of pcpu buffers. witha single atomic sequence >> number being the only >> sychroniaation needed. If you are going to have separate buffers, then you can have one for each class of log() and printf(): - ddb: normally no buffering; sometimes a special ddb buffer (I think there already is one) - emergency messages: these are exepected to usurp each other if they happen - next level of critical messages ... - informational messages that go to the console - highest priority log messages that don't go to the console ... - see syslog.h for various priorities. You can have a buffer for each priority and not need to put thr priority markup in-band. But then you have the problem of reassembling everything, and atomic updates and accesses for this..., and minimizing the resource wastage (the default MSGBUF size is now 96K. This size, or complications, would be needed for each message class on each CPU to ensure not losing messages that are not lost now, in case all the messages are in one class on one CPU). > Maybe I'm over engineering here, but... The above is over-the-top engineered :-). > If we store in the thread structure two things: your counter and > information if the last message stored by this thread had \n at the end > or not, we could reuse the same counter for the next message by this > thread if the previous message had no \n. This way my macro will work > with per-CPU lists and preemption. I'd still need sched_pin() though. Would that help much? I think kernel hackers don't look at the msgbuf much. They printf() to the console and look at the output there. If yu don't want it there, use log() and not printf(). log()s that only use the msgbuf can be made atomic more simply than printf()s, since they don't have to wait for the console, and shouldn't be used for emergency messages. Just excuting them faster gives a better chance that they wonn't be contended with on other CPUs. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 17:54:53 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7641106566C; Fri, 17 Feb 2012 17:54:53 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 66EAD8FC18; Fri, 17 Feb 2012 17:54:52 +0000 (UTC) Received: from [172.23.7.53] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q1HHsa8I004569 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 17 Feb 2012 09:54:46 -0800 (PST) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <20120217191017.U1871@besplex.bde.org> Date: Fri, 17 Feb 2012 09:54:37 -0800 Content-Transfer-Encoding: 7bit Message-Id: <2CDFAEC9-D57A-4513-96D1-8A78D27E8696@xcllnt.net> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> <20120217191017.U1871@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1257) Cc: marcel@FreeBSD.org, Eitan Adler , svn-src-all@FreeBSD.org, "Kenneth D. Merry" , Andriy Gapon , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 17:54:53 -0000 On Feb 17, 2012, at 4:13 AM, Bruce Evans wrote: > On Thu, 16 Feb 2012, Marcel Moolenaar wrote: > >> I think we should lift above the immediate problem and allow for >> single- and multi-line messages that are atomically appended to >> the message buffer. Console output and propagation of messages >> outside of the kernel should all come out of the message buffer >> and preserving the atomicity of the messages. > > This is just wrong for (low-level) console messages. I think it actually is the right approach in that the low-level console stops being this pivotal component that introduces limitations for no good reason. We need "quiet" boots, but we also want to have boot messages available somewhere for post mortems. Decoupling the generation and holding/storage of messages from what you can subsequently do with them, like displaying them, is a good thing. The decoupling allows us to generate and store messages in the most stringent cases, and it allows us to filter based on preference or condition. It's not that hard to print messages that relates to errors only when you have priorities or facilities or other kinds of augmentation that help us raise awareness of the things FreeBSD users/operators need to be aware of. I belief the notion of a low-level console is arcane and antiquated. Every "output" channel that can be monitored by humans should have the possibility of being human friendly, where human friendly is defined, for the most part, by the the human monitoring the channel and not by us. For example: I dislike our boot messages, because it's noise to me 99.99% of the time. If I'm waiting for FreeBSD to boot and monitor the console, I'd rather stare at the logo and a twiddle. If I see a lot of messages scrolling by fast, I look away (preferably at a photo of a white tropical beach, the sea and a few palm trees). -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 17:25:09 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44AA31065675; Fri, 17 Feb 2012 17:25:09 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id DFE408FC14; Fri, 17 Feb 2012 17:25:08 +0000 (UTC) Received: from [172.23.7.53] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q1HHOrqQ004456 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 17 Feb 2012 09:25:01 -0800 (PST) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <20120217085840.GC1358@garage.freebsd.pl> Date: Fri, 17 Feb 2012 09:24:54 -0800 Content-Transfer-Encoding: 7bit Message-Id: <1AC67C3A-F6D5-419F-BD15-26AACF6BA567@xcllnt.net> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> <20120217085840.GC1358@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1257) X-Mailman-Approved-At: Fri, 17 Feb 2012 17:56:12 +0000 Cc: marcel@FreeBSD.org, Eitan Adler , svn-src-all@FreeBSD.org, "Kenneth D. Merry" , Andriy Gapon , src-committers@FreeBSD.org, Bruce Evans , svn-src-head@FreeBSD.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 17:25:09 -0000 On Feb 17, 2012, at 12:58 AM, Pawel Jakub Dawidek wrote: *snip* >> I think we should lift above the immediate problem and allow for >> single- and multi-line messages that are atomically appended to >> the message buffer. Console output and propagation of messages >> outside of the kernel should all come out of the message buffer >> and preserving the atomicity of the messages. >> >> The message buffer does not have to be a chunk of memory that >> we circularly scribble to. It can be a per-cpu linked list of >> messages even. *snip* > > I agree with everything except for per-CPU buffers. I understand the > need for using printf in low-level code and it indeed complicates things. > The reason I don't like the idea of per-CPU buffers is that locking > would allow me to implement atomicity across multiple printfs. > For example I often use macros like this: > > #define G_MIRROR_DEBUG(lvl, ...) do { \ > if (g_mirror_debug >= (lvl)) { \ > printf("GEOM_MIRROR"); \ > if (g_mirror_debug > 0) \ > printf("[%u]", lvl); \ > printf(": "); \ > printf(__VA_ARGS__); \ > printf("\n"); \ > } \ > } while (0) > > And I'd like all the printfs to be committed as one message without > using some additional buffer first and then single printf. > With some kind of printf-lock we could use recursive locking to achieve > this. In your proposal I may run each printf on different CPU. > I could eventually use sched_pin() around all printfs, I guess. > This still doesn't cover the case when I'm preempted between my printfs, > so maybe I need critical section there? I don't expect printf should be > fast, so it might be ok. I'm sure there's an elegant solution somewhere to be found. In fact, I'm actually thinking broader still: to fundamentally replace printf with logging, similar to syslog and define printf as a macro or wrapper for logging (with some fixed priority and/or facility). The most important aspect of this is that we can better control the verbosity of the boot. The least verbose boot would only print the absolutely required messages (read: legaleze). At the most verbose boot you get whatever log or print exists in the kernel in the code that gets executed. There's many levels in between. The facility allows us to crank up verbosity for components or drivers only and helps us to focus on the area of interest. I.e. if there's a driver that won't attach, it's really nice to have that driver as verbose as it gets without also having to sift through megabytes of unrelated noise. Debug output is no different from "very verbose" output and biggest problem we have is to define a good set of standard priorities that people can use. With the above, I see no problem cuddling up to sbuf(9) and use sbuf to collect fragments and or multiple lines and use it to atomically "print" the message. A simple transactional model should suffice, as in: lt = log_begin(sbuf, priority, facility); log(lt, "foo"); log(lt, "\nbar\n"); : log(lt, "baz"); log_end(lt); This eliminates any need for one-off macros to do this stuff, like the one you typically use. Oh, and it would be nice to have a kernel configuration that controls which priority levels get compiled in, so that you can easily construct a kernel without tons of high verbosity log messages when you don't want them. -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 17:31:31 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A485D1065670; Fri, 17 Feb 2012 17:31:31 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 585998FC14; Fri, 17 Feb 2012 17:31:31 +0000 (UTC) Received: from [172.23.7.53] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q1HHVJgZ004481 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 17 Feb 2012 09:31:25 -0800 (PST) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: Date: Fri, 17 Feb 2012 09:31:19 -0800 Content-Transfer-Encoding: 7bit Message-Id: <8926DEE3-9779-464D-A7CA-B67F544763D4@xcllnt.net> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> To: Attilio Rao X-Mailer: Apple Mail (2.1257) X-Mailman-Approved-At: Fri, 17 Feb 2012 18:06:33 +0000 Cc: marcel@FreeBSD.org, Eitan Adler , svn-src-all@FreeBSD.org, "Kenneth D. Merry" , Andriy Gapon , src-committers@FreeBSD.org, Bruce Evans , svn-src-head@FreeBSD.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 17:31:31 -0000 On Feb 17, 2012, at 1:09 AM, Attilio Rao wrote: >> >> The message buffer does not have to be a chunk of memory that >> we circularly scribble to. It can be a per-cpu linked list of >> messages even. > > Do you think we could inherit much of the code from KTR subsystem? > We could use KTR as a scheleton (and possibly improving it) for making > a general circular-buffer and then create a new KPI, thus add > implementations for KTR, msgbuf, etc. Aaah... I like your thinking. See also my response to pjd@. If printf becomes a wrapper around a log infrastructure, then ktr could potentially be a log of some "high" verbosity or even some specific facility (or however we can augment messages to make filtering and distribution easy and flexible). I like that. Fewer ways to do fundamentally the same thing is good. Not to mention that if our printf/log function has the strength to handle KTR functionality, we also open the door for getting those KTR messages pushed out of the kernel and into some analysis or monitoring tool... Watch the events as they happen... -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 19:20:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FDCF106566B; Fri, 17 Feb 2012 19:20:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id AD9D88FC0C; Fri, 17 Feb 2012 19:20:38 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1HJKYun011011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 18 Feb 2012 06:20:36 +1100 Date: Sat, 18 Feb 2012 06:20:34 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcel Moolenaar In-Reply-To: <2CDFAEC9-D57A-4513-96D1-8A78D27E8696@xcllnt.net> Message-ID: <20120218050858.Q4138@besplex.bde.org> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> <20120217191017.U1871@besplex.bde.org> <2CDFAEC9-D57A-4513-96D1-8A78D27E8696@xcllnt.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Mailman-Approved-At: Fri, 17 Feb 2012 19:25:50 +0000 Cc: marcel@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, "Kenneth D. Merry" , Andriy Gapon , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 19:20:39 -0000 On Fri, 17 Feb 2012, Marcel Moolenaar wrote: > On Feb 17, 2012, at 4:13 AM, Bruce Evans wrote: > >> On Thu, 16 Feb 2012, Marcel Moolenaar wrote: >> >>> I think we should lift above the immediate problem and allow for >>> single- and multi-line messages that are atomically appended to >>> the message buffer. Console output and propagation of messages >>> outside of the kernel should all come out of the message buffer >>> and preserving the atomicity of the messages. >> >> This is just wrong for (low-level) console messages. > > I think it actually is the right approach in that the low-level > console stops being this pivotal component that introduces > limitations for no good reason. I like it limiting bloat. But if you really want, you can have no limit on messages that don't go to the console imposed by messages that do go to the console. > We need "quiet" boots, but we > also want to have boot messages available somewhere for post > mortems. Decoupling the generation and holding/storage of Well, I want noisy boots. > messages from what you can subsequently do with them, like > displaying them, is a good thing. The decoupling allows us > to generate and store messages in the most stringent cases, > and it allows us to filter based on preference or condition. If many cared about this, then they would have used log(9) and perhaps added more priorities to it instead of almost always using printf(). In the $(find /sys -name *.c) now, there are about 29457 lines matching 'printf(' (this will find slightly different functions line sprintf() and device_printf()) and 1686 matching 'log('. printf() is just too convenient, although the only inconvenience for using arg of log() is its extra priority arg which helps filtering. I thought that log had a LOG_PRINTF psuedo-prioriy to make it go to the console, but I can never remember what its priorities are, and looking them up shows that LOG_PRINTF is only used in removed disk code, and looking at the source code shows that log() only goes to the console when klog is not open. The latter is as it should be -- don't spam the console with kernel printfs (which also go to klog, but with an uncontrollable priority), but let syslog filter them. > It's not that hard to print messages that relates to errors > only when you have priorities or facilities or other kinds > of augmentation that help us raise awareness of the things > FreeBSD users/operators need to be aware of. > > I belief the notion of a low-level console is arcane and > antiquated. Every "output" channel that can be monitored by > humans should have the possibility of being human friendly, > where human friendly is defined, for the most part, by the > the human monitoring the channel and not by us. Console printfs is mainly for people debugging kernels. One per day is acceptable for other purposes. > For example: I dislike our boot messages, because it's noise > to me 99.99% of the time. If I'm waiting for FreeBSD to boot > and monitor the console, I'd rather stare at the logo and a > twiddle. If I see a lot of messages scrolling by fast, I look > away (preferably at a photo of a white tropical beach, the > sea and a few palm trees). I really like them. The scroll fast by fast enough that they are easy to ignore. If I want to see them later, then scroll-lock mode is usable despite its bugs. If you don't like them, then turn them off by booting with RB_MUTE. I've never tried this of course. As a kernel hacker, you can see the message buffer using ddb or maybe gdb even if the boot fails. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 22:33:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD0221065674; Fri, 17 Feb 2012 22:33:46 +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 B79F48FC15; Fri, 17 Feb 2012 22:33:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1HMXkvU098660; Fri, 17 Feb 2012 22:33:46 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1HMXkR6098658; Fri, 17 Feb 2012 22:33:46 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201202172233.q1HMXkR6098658@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 17 Feb 2012 22:33: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: r231883 - head/sys/dev/xen/blkback X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 22:33:46 -0000 Author: gibbs Date: Fri Feb 17 22:33:46 2012 New Revision: 231883 URL: http://svn.freebsd.org/changeset/base/231883 Log: Fix regression in the handling of blkback close events for devices that are unplugged via QEMU. sys/dev/xen/blkback/blkback.c: Toolstack initiated closures change the frontend's state to Closing. The backend must change to Closing as well, even if we can't actually close yet, in order for the frontend to notice and start the closing process. MFC after: 3 days Modified: head/sys/dev/xen/blkback/blkback.c Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Fri Feb 17 15:31:06 2012 (r231882) +++ head/sys/dev/xen/blkback/blkback.c Fri Feb 17 22:33:46 2012 (r231883) @@ -3955,16 +3955,12 @@ xbb_frontend_changed(device_t dev, Xenbu xbb_connect(xbb); break; case XenbusStateClosing: - /* - * Frontend has acknowledged Closing request. - * Wait for Closed state. - */ - break; case XenbusStateClosed: mtx_lock(&xbb->lock); xbb_shutdown(xbb); mtx_unlock(&xbb->lock); - xenbus_set_state(xbb->dev, XenbusStateClosed); + if (frontend_state == XenbusStateClosed) + xenbus_set_state(xbb->dev, XenbusStateClosed); break; default: xenbus_dev_fatal(xbb->dev, EINVAL, "saw state %d at frontend", From owner-svn-src-head@FreeBSD.ORG Fri Feb 17 23:47:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74A59106564A; Fri, 17 Feb 2012 23:47:16 +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 623968FC0A; Fri, 17 Feb 2012 23:47:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1HNlGFE001385; Fri, 17 Feb 2012 23:47:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1HNlGFv001379; Fri, 17 Feb 2012 23:47:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202172347.q1HNlGFv001379@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 17 Feb 2012 23:47: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: r231885 - in head/sys: compat/linux compat/svr4 i386/ibcs2 i386/linux kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 23:47:16 -0000 Author: kib Date: Fri Feb 17 23:47:16 2012 New Revision: 231885 URL: http://svn.freebsd.org/changeset/base/231885 Log: Fix misuse of the kernel map in miscellaneous image activators. Vnode-backed mappings cannot be put into the kernel map, since it is a system map. Use exec_map for transient mappings, and remove the mappings with kmem_free_wakeup() to notify the waiters on available map space. Do not map the whole executable into KVA at all to copy it out into usermode. Directly use vn_rdwr() for the case of not page aligned binary. There is one place left where the potentially unbounded amount of data is mapped into exec_map, namely, in the COFF image activator enumeration of the needed shared libraries. Reviewed by: alc MFC after: 2 weeks Modified: head/sys/compat/linux/linux_misc.c head/sys/compat/svr4/imgact_svr4.c head/sys/i386/ibcs2/imgact_coff.c head/sys/i386/linux/imgact_linux.c head/sys/kern/imgact_gzip.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Fri Feb 17 22:40:52 2012 (r231884) +++ head/sys/compat/linux/linux_misc.c Fri Feb 17 23:47:16 2012 (r231885) @@ -229,9 +229,9 @@ linux_uselib(struct thread *td, struct l struct vattr attr; vm_offset_t vmaddr; unsigned long file_offset; - vm_offset_t buffer; unsigned long bss_size; char *library; + ssize_t aresid; int error; int locked, vfslocked; @@ -308,8 +308,8 @@ linux_uselib(struct thread *td, struct l if (error) goto cleanup; - /* Pull in executable header into kernel_map */ - error = vm_mmap(kernel_map, (vm_offset_t *)&a_out, PAGE_SIZE, + /* Pull in executable header into exec_map */ + error = vm_mmap(exec_map, (vm_offset_t *)&a_out, PAGE_SIZE, VM_PROT_READ, VM_PROT_READ, 0, OBJT_VNODE, vp, 0); if (error) goto cleanup; @@ -402,24 +402,15 @@ linux_uselib(struct thread *td, struct l if (error) goto cleanup; - /* map file into kernel_map */ - error = vm_mmap(kernel_map, &buffer, - round_page(a_out->a_text + a_out->a_data + file_offset), - VM_PROT_READ, VM_PROT_READ, 0, OBJT_VNODE, vp, - trunc_page(file_offset)); - if (error) + error = vn_rdwr(UIO_READ, vp, (void *)vmaddr, file_offset, + a_out->a_text + a_out->a_data, UIO_USERSPACE, 0, + td->td_ucred, NOCRED, &aresid, td); + if (error != 0) goto cleanup; - - /* copy from kernel VM space to user space */ - error = copyout(PTRIN(buffer + file_offset), - (void *)vmaddr, a_out->a_text + a_out->a_data); - - /* release temporary kernel space */ - vm_map_remove(kernel_map, buffer, buffer + - round_page(a_out->a_text + a_out->a_data + file_offset)); - - if (error) + if (aresid != 0) { + error = ENOEXEC; goto cleanup; + } } else { #ifdef DEBUG printf("uselib: Page aligned binary %lu\n", file_offset); @@ -463,10 +454,9 @@ cleanup: VFS_UNLOCK_GIANT(vfslocked); } - /* Release the kernel mapping. */ + /* Release the temporary mapping. */ if (a_out) - vm_map_remove(kernel_map, (vm_offset_t)a_out, - (vm_offset_t)a_out + PAGE_SIZE); + kmem_free_wakeup(exec_map, (vm_offset_t)a_out, PAGE_SIZE); return (error); } Modified: head/sys/compat/svr4/imgact_svr4.c ============================================================================== --- head/sys/compat/svr4/imgact_svr4.c Fri Feb 17 22:40:52 2012 (r231884) +++ head/sys/compat/svr4/imgact_svr4.c Fri Feb 17 23:47:16 2012 (r231885) @@ -66,8 +66,8 @@ exec_svr4_imgact(imgp) struct vmspace *vmspace; vm_offset_t vmaddr; unsigned long virtual_offset, file_offset; - vm_offset_t buffer; unsigned long bss_size; + ssize_t aresid; int error; if (((a_out->a_magic >> 16) & 0xff) != 0x64) @@ -145,21 +145,15 @@ exec_svr4_imgact(imgp) if (error) goto fail; - error = vm_mmap(kernel_map, &buffer, - round_page(a_out->a_text + a_out->a_data + file_offset), - VM_PROT_READ, VM_PROT_READ, 0, - OBJT_VNODE, imgp->vp, trunc_page(file_offset)); - if (error) - goto fail; - - error = copyout((caddr_t)(buffer + file_offset), (caddr_t)vmaddr, - a_out->a_text + a_out->a_data); - - vm_map_remove(kernel_map, buffer, - buffer + round_page(a_out->a_text + a_out->a_data + file_offset)); - - if (error) - goto fail; + error = vn_rdwr(UIO_READ, imgp->vp, (void *)vmaddr, file_offset, + a_out->a_text + a_out->a_data, UIO_USERSPACE, 0, + curthread->td_ucred, NOCRED, &aresid, curthread); + if (error != 0) + goto fail; + if (aresid != 0) { + error = ENOEXEC; + goto fail; + } /* * remove write enable on the 'text' part Modified: head/sys/i386/ibcs2/imgact_coff.c ============================================================================== --- head/sys/i386/ibcs2/imgact_coff.c Fri Feb 17 22:40:52 2012 (r231884) +++ head/sys/i386/ibcs2/imgact_coff.c Fri Feb 17 23:47:16 2012 (r231885) @@ -146,10 +146,7 @@ load_coff_section(struct vmspace *vmspac error = copyout(data_buf, (caddr_t) map_addr, copy_len); - if (vm_map_remove(exec_map, - (vm_offset_t) data_buf, - (vm_offset_t) data_buf + PAGE_SIZE)) - panic("load_coff_section vm_map_remove failed"); + kmem_free_wakeup(exec_map, (vm_offset_t)data_buf, PAGE_SIZE); return error; } @@ -280,11 +277,7 @@ coff_load_file(struct thread *td, char * error = 0; dealloc_and_fail: - if (vm_map_remove(exec_map, - (vm_offset_t) ptr, - (vm_offset_t) ptr + PAGE_SIZE)) - panic("%s vm_map_remove failed", __func__); - + kmem_free_wakeup(exec_map, (vm_offset_t)ptr, PAGE_SIZE); fail: VOP_UNLOCK(vp, 0); unlocked_fail: @@ -421,10 +414,7 @@ exec_coff_imgact(imgp) } free(libbuf, M_TEMP); } - if (vm_map_remove(exec_map, - (vm_offset_t) buf, - (vm_offset_t) buf + len)) - panic("exec_coff_imgact vm_map_remove failed"); + kmem_free_wakeup(exec_map, (vm_offset_t)buf, len); if (error) goto fail; } Modified: head/sys/i386/linux/imgact_linux.c ============================================================================== --- head/sys/i386/linux/imgact_linux.c Fri Feb 17 22:40:52 2012 (r231884) +++ head/sys/i386/linux/imgact_linux.c Fri Feb 17 23:47:16 2012 (r231885) @@ -64,8 +64,8 @@ exec_linux_imgact(struct image_params *i struct vmspace *vmspace; vm_offset_t vmaddr; unsigned long virtual_offset, file_offset; - vm_offset_t buffer; unsigned long bss_size; + ssize_t aresid; int error; if (((a_out->a_magic >> 16) & 0xff) != 0x64) @@ -144,21 +144,15 @@ exec_linux_imgact(struct image_params *i if (error) goto fail; - error = vm_mmap(kernel_map, &buffer, - round_page(a_out->a_text + a_out->a_data + file_offset), - VM_PROT_READ, VM_PROT_READ, 0, OBJT_VNODE, - imgp->vp, trunc_page(file_offset)); - if (error) - goto fail; - - error = copyout((void *)(uintptr_t)(buffer + file_offset), - (void *)vmaddr, a_out->a_text + a_out->a_data); - - vm_map_remove(kernel_map, buffer, - buffer + round_page(a_out->a_text + a_out->a_data + file_offset)); - - if (error) - goto fail; + error = vn_rdwr(UIO_READ, imgp->vp, (void *)vmaddr, file_offset, + a_out->a_text + a_out->a_data, UIO_USERSPACE, 0, + curthread->td_ucred, NOCRED, &aresid, curthread); + if (error != 0) + goto fail; + if (aresid != 0) { + error = ENOEXEC; + goto fail; + } /* * remove write enable on the 'text' part Modified: head/sys/kern/imgact_gzip.c ============================================================================== --- head/sys/kern/imgact_gzip.c Fri Feb 17 22:40:52 2012 (r231884) +++ head/sys/kern/imgact_gzip.c Fri Feb 17 23:47:16 2012 (r231885) @@ -70,7 +70,7 @@ static int exec_gzip_imgact(imgp) struct image_params *imgp; { - int error, error2 = 0; + int error; const u_char *p = (const u_char *) imgp->image_header; struct imgact_gzip igz; struct inflate infl; @@ -136,22 +136,17 @@ exec_gzip_imgact(imgp) VM_PROT_READ|VM_PROT_EXECUTE,0); } - if (igz.inbuf) { - error2 = - vm_map_remove(kernel_map, (vm_offset_t) igz.inbuf, - (vm_offset_t) igz.inbuf + PAGE_SIZE); - } - if (igz.error || error || error2) { + if (igz.inbuf) + kmem_free_wakeup(exec_map, (vm_offset_t)igz.inbuf, PAGE_SIZE); + if (igz.error || error) { printf("Output=%lu ", igz.output); - printf("Inflate_error=%d igz.error=%d error2=%d where=%d\n", - error, igz.error, error2, igz.where); + printf("Inflate_error=%d igz.error=%d where=%d\n", + error, igz.error, igz.where); } if (igz.error) return igz.error; if (error) return ENOEXEC; - if (error2) - return error2; return 0; } @@ -314,18 +309,11 @@ NextByte(void *vp) if (igz->inbuf && igz->idx < (igz->offset + PAGE_SIZE)) { return igz->inbuf[(igz->idx++) - igz->offset]; } - if (igz->inbuf) { - error = vm_map_remove(kernel_map, (vm_offset_t) igz->inbuf, - (vm_offset_t) igz->inbuf + PAGE_SIZE); - if (error) { - igz->where = __LINE__; - igz->error = error; - return GZ_EOF; - } - } + if (igz->inbuf) + kmem_free_wakeup(exec_map, (vm_offset_t)igz->inbuf, PAGE_SIZE); igz->offset = igz->idx & ~PAGE_MASK; - error = vm_mmap(kernel_map, /* map */ + error = vm_mmap(exec_map, /* map */ (vm_offset_t *) & igz->inbuf, /* address */ PAGE_SIZE, /* size */ VM_PROT_READ, /* protection */ From owner-svn-src-head@FreeBSD.ORG Sat Feb 18 00:35:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C88C0106564A; Sat, 18 Feb 2012 00:35:12 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 8F33F8FC0A; Sat, 18 Feb 2012 00:35:12 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id q1I0YwuV028572 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 17 Feb 2012 16:34:59 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4F3EF28E.5030004@freebsd.org> Date: Fri, 17 Feb 2012 16:36:30 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.26) Gecko/20120129 Thunderbird/3.1.18 MIME-Version: 1.0 To: Marcel Moolenaar References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> <4F3D9D03.6020507@FreeBSD.org> <9CB7ECE8-FF10-43BE-9EBD-16953BE3B193@xcllnt.net> <4F3E0596.6040808@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: marcel@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, "Kenneth D. Merry" , Andriy Gapon , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2012 00:35:12 -0000 > On Feb 16, 2012, at 11:45 PM, Julian Elischer wrote: > *snip* >>> The message buffer does not have to be a chunk of memory that >>> we circularly scribble to. It can be a per-cpu linked list of >>> messages even. > *snip* > >> that is an intersting thought.. though.. how would you sort them into order for >> printing? >> >> maybe a single atomic 64 bit int that is incremented per message. > Yes. Though, a timestamp should do the trick as well. In a multi-core > system, you won't have pure or absolute sequentially anymore. For > messages that are "printed" at the proverbial "same time" on different > cores, ordering is very hard, if not impossible, to determine. A single > atomic counter would force sequentially, but would effectively introduce > serialization, just like locking, and would make a per-cpu message > buffer/list/whatever less useful. bit a single atomic op, while expensive would be within the cost I could live with. > The theory: the closer in time independent messages are printed (on > different cores), the least important their ordering becomes. not necessarily. sometimes teh order is important to find the problem.. ("look, it read it before the other one wrote it"). From owner-svn-src-head@FreeBSD.ORG Sat Feb 18 00:46:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8809A1065670; Sat, 18 Feb 2012 00:46:18 +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 77B198FC0C; Sat, 18 Feb 2012 00:46:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1I0kI5e003625; Sat, 18 Feb 2012 00:46:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1I0kIaF003623; Sat, 18 Feb 2012 00:46:18 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202180046.q1I0kIaF003623@svn.freebsd.org> From: Xin LI Date: Sat, 18 Feb 2012 00:46: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: r231888 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2012 00:46:18 -0000 Author: delphij Date: Sat Feb 18 00:46:18 2012 New Revision: 231888 URL: http://svn.freebsd.org/changeset/base/231888 Log: Put the signal trap output to standard error instead of standard output. Without this change, pressing ^T could result in rc.d script putting junk strings like: Script running in configuration files when redirecting standard output to these files. MFC after: 2 weeks Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sat Feb 18 00:45:59 2012 (r231887) +++ head/etc/rc.subr Sat Feb 18 00:46:18 2012 (r231888) @@ -985,9 +985,9 @@ run_rc_script() if [ -n "$rc_fast_and_loose" ]; then set $_arg; . $_file else - ( trap "echo Script $_file interrupted; kill -QUIT $$" 3 - trap "echo Script $_file interrupted; exit 1" 2 - trap "echo Script $_file running" 29 + ( trap "echo Script $_file interrupted >&2 ; kill -QUIT $$" 3 + trap "echo Script $_file interrupted >&2 ; exit 1" 2 + trap "echo Script $_file running >&2" 29 set $_arg; . $_file ) fi fi From owner-svn-src-head@FreeBSD.ORG Sat Feb 18 00:55:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5219B106566B; Sat, 18 Feb 2012 00:55:55 +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 379A38FC1C; Sat, 18 Feb 2012 00:55:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1I0ttSW004068; Sat, 18 Feb 2012 00:55:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1I0ttD2004066; Sat, 18 Feb 2012 00:55:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202180055.q1I0ttD2004066@svn.freebsd.org> From: Xin LI Date: Sat, 18 Feb 2012 00:55: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: r231891 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2012 00:55:55 -0000 Author: delphij Date: Sat Feb 18 00:55:54 2012 New Revision: 231891 URL: http://svn.freebsd.org/changeset/base/231891 Log: Use ANSI prototypes. Modified: head/lib/libc/gen/fts.c Modified: head/lib/libc/gen/fts.c ============================================================================== --- head/lib/libc/gen/fts.c Sat Feb 18 00:54:30 2012 (r231890) +++ head/lib/libc/gen/fts.c Sat Feb 18 00:55:54 2012 (r231891) @@ -226,9 +226,7 @@ mem1: free(sp); } static void -fts_load(sp, p) - FTS *sp; - FTSENT *p; +fts_load(FTS *sp, FTSENT *p) { size_t len; char *cp; @@ -252,8 +250,7 @@ fts_load(sp, p) } int -fts_close(sp) - FTS *sp; +fts_close(FTS *sp) { FTSENT *freep, *p; int saved_errno; @@ -307,8 +304,7 @@ fts_close(sp) ? p->fts_pathlen - 1 : p->fts_pathlen) FTSENT * -fts_read(sp) - FTS *sp; +fts_read(FTS *sp) { FTSENT *p, *tmp; int instr; @@ -501,10 +497,7 @@ name: t = sp->fts_path + NAPPEND(p->fts */ /* ARGSUSED */ int -fts_set(sp, p, instr) - FTS *sp; - FTSENT *p; - int instr; +fts_set(FTS *sp, FTSENT *p, int instr) { if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW && instr != FTS_NOINSTR && instr != FTS_SKIP) { @@ -516,9 +509,7 @@ fts_set(sp, p, instr) } FTSENT * -fts_children(sp, instr) - FTS *sp; - int instr; +fts_children(FTS *sp, int instr) { FTSENT *p; int fd; @@ -628,9 +619,7 @@ fts_set_clientptr(FTS *sp, void *clientp * been found, cutting the stat calls by about 2/3. */ static FTSENT * -fts_build(sp, type) - FTS *sp; - int type; +fts_build(FTS *sp, int type) { struct dirent *dp; FTSENT *p, *head; @@ -876,10 +865,7 @@ mem1: saved_errno = errno; } static int -fts_stat(sp, p, follow) - FTS *sp; - FTSENT *p; - int follow; +fts_stat(FTS *sp, FTSENT *p, int follow) { FTSENT *t; dev_t dev; @@ -974,10 +960,7 @@ fts_compar(const void *a, const void *b) } static FTSENT * -fts_sort(sp, head, nitems) - FTS *sp; - FTSENT *head; - size_t nitems; +fts_sort(FTS *sp, FTSENT *head, size_t nitems) { FTSENT **ap, *p; @@ -1006,10 +989,7 @@ fts_sort(sp, head, nitems) } static FTSENT * -fts_alloc(sp, name, namelen) - FTS *sp; - char *name; - size_t namelen; +fts_alloc(FTS *sp, char *name, size_t namelen) { FTSENT *p; size_t len; @@ -1056,8 +1036,7 @@ fts_alloc(sp, name, namelen) } static void -fts_lfree(head) - FTSENT *head; +fts_lfree(FTSENT *head) { FTSENT *p; @@ -1075,9 +1054,7 @@ fts_lfree(head) * plus 256 bytes so don't realloc the path 2 bytes at a time. */ static int -fts_palloc(sp, more) - FTS *sp; - size_t more; +fts_palloc(FTS *sp, size_t more) { sp->fts_pathlen += more + 256; @@ -1090,9 +1067,7 @@ fts_palloc(sp, more) * already returned. */ static void -fts_padjust(sp, head) - FTS *sp; - FTSENT *head; +fts_padjust(FTS *sp, FTSENT *head) { FTSENT *p; char *addr = sp->fts_path; @@ -1133,11 +1108,7 @@ fts_maxarglen(argv) * Assumes p->fts_dev and p->fts_ino are filled in. */ static int -fts_safe_changedir(sp, p, fd, path) - FTS *sp; - FTSENT *p; - int fd; - char *path; +fts_safe_changedir(FTS *sp, FTSENT *p, int fd, char *path) { int ret, oerrno, newfd; struct stat sb; From owner-svn-src-head@FreeBSD.ORG Sat Feb 18 02:25:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C6FF1065677 for ; Sat, 18 Feb 2012 02:25:29 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 233DD8FC18 for ; Sat, 18 Feb 2012 02:25:28 +0000 (UTC) Received: by wibhn14 with SMTP id hn14so2936546wib.13 for ; Fri, 17 Feb 2012 18:25:27 -0800 (PST) Received-SPF: pass (google.com: domain of lists@eitanadler.com designates 10.180.90.225 as permitted sender) client-ip=10.180.90.225; Authentication-Results: mr.google.com; spf=pass (google.com: domain of lists@eitanadler.com designates 10.180.90.225 as permitted sender) smtp.mail=lists@eitanadler.com; dkim=pass header.i=lists@eitanadler.com Received: from mr.google.com ([10.180.90.225]) by 10.180.90.225 with SMTP id bz1mr2074644wib.5.1329531927630 (num_hops = 1); Fri, 17 Feb 2012 18:25:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=3zNOrAwdRxZaDKeozpv14u1yTogOpNrerHdvWXI/7Fo=; b=k0CMdEHZk8Q1w4ejMpQaV9VUS8JR7hxBiiAsWK5VONVYUfxOF6p1xqGE+/rliRPlPL NiR6zE6FH8AAdLUjgBsVlgZtFRDENF3NunHm0A3lxjKz3Lop/bMGygldglY9+4+ivMMV cCV203qqN2SLgnXyHt91b3CdyNftjCIuaFcdE= Received: by 10.180.90.225 with SMTP id bz1mr1799666wib.5.1329531927536; Fri, 17 Feb 2012 18:25:27 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.15.90 with HTTP; Fri, 17 Feb 2012 18:24:57 -0800 (PST) In-Reply-To: <20120217000846.GA7641@nargothrond.kdm.org> References: <201202160511.q1G5BZNk099785@svn.freebsd.org> <20120216181210.K1423@besplex.bde.org> <4F3CC40D.4000307@freebsd.org> <4F3CC5C4.7020501@FreeBSD.org> <4F3CC8A5.3030107@FreeBSD.org> <20120216174758.GA64180@nargothrond.kdm.org> <20120217053341.R1256@besplex.bde.org> <20120217000846.GA7641@nargothrond.kdm.org> From: Eitan Adler Date: Fri, 17 Feb 2012 21:24:57 -0500 X-Google-Sender-Auth: d4cWfGlO9vA5EnD25CsLZ3JZ2wE Message-ID: To: "Kenneth D. Merry" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlJuPYdFnBp4wJWWsEP3FidN16ObIquHXQmHDQtx0fAGa8yAXpuDEduhCCJGRd3aK6Uzlux Cc: marcel@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , src-committers@freebsd.org, Bruce Evans , svn-src-head@freebsd.org, Julian Elischer Subject: Re: svn commit: r231814 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2012 02:25:29 -0000 On Thu, Feb 16, 2012 at 7:08 PM, Kenneth D. Merry wrote: > So I think we need some comment from Eitan on r231814, since that would > probably need to come out as well. =C2=A0If he is okay with backing out r= 231814, > and avg agrees as well, then I will back out all four changes. If other commits have to be backed out such that my change no longer applies I don't oppose doing so. If however it does not have to be backed out in order to revert the other changes I'd prefer to fix my commit (not using getnanotime, etc) instead. --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Sat Feb 18 09:18:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90BF4106566C; Sat, 18 Feb 2012 09:18:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 806368FC15; Sat, 18 Feb 2012 09:18:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1I9I7HZ021004; Sat, 18 Feb 2012 09:18:07 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1I9I7eZ021002; Sat, 18 Feb 2012 09:18:07 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202180918.q1I9I7eZ021002@svn.freebsd.org> From: Adrian Chadd Date: Sat, 18 Feb 2012 09:18: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: r231893 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2012 09:18:07 -0000 Author: adrian Date: Sat Feb 18 09:18:06 2012 New Revision: 231893 URL: http://svn.freebsd.org/changeset/base/231893 Log: Try to ensure that ieee80211_newstate() and the vap_newstate methods hold the lock. This is part of my series of work to try and capture when net80211 locking isn't. ObNote: it'd be nice to be able to mark a lock as "assert if the lock is dropped", so I could capture functions which decide that dropping and reacquiring the lock is a good idea (without re-checking the sanity of the state protected by the lock.) Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Feb 18 00:57:11 2012 (r231892) +++ head/sys/dev/ath/if_ath.c Sat Feb 18 09:18:06 2012 (r231893) @@ -5711,6 +5711,15 @@ ath_newstate(struct ieee80211vap *vap, e ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate]); + /* + * net80211 _should_ have the comlock asserted at this point. + * There are some comments around the calls to vap->iv_newstate + * which indicate that it (newstate) may end up dropping the + * lock. This and the subsequent lock assert check after newstate + * are an attempt to catch these and figure out how/why. + */ + IEEE80211_LOCK_ASSERT(ic); + if (vap->iv_state == IEEE80211_S_CSA && nstate == IEEE80211_S_RUN) csa_run_transition = 1; @@ -5760,6 +5769,12 @@ ath_newstate(struct ieee80211vap *vap, e if (error != 0) goto bad; + /* + * See above: ensure av_newstate() doesn't drop the lock + * on us. + */ + IEEE80211_LOCK_ASSERT(ic); + if (nstate == IEEE80211_S_RUN) { /* NB: collect bss node again, it may have changed */ ieee80211_free_node(ni); From owner-svn-src-head@FreeBSD.ORG Sat Feb 18 16:06:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57D091065734; Sat, 18 Feb 2012 16:06:16 +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 4264E8FC17; Sat, 18 Feb 2012 16:06:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1IG6GMg037860; Sat, 18 Feb 2012 16:06:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1IG6G4k037857; Sat, 18 Feb 2012 16:06:16 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202181606.q1IG6G4k037857@svn.freebsd.org> From: Michael Tuexen Date: Sat, 18 Feb 2012 16:06: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: r231895 - in head/sys: netinet netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2012 16:06:16 -0000 Author: tuexen Date: Sat Feb 18 16:06:15 2012 New Revision: 231895 URL: http://svn.freebsd.org/changeset/base/231895 Log: Remove two clang warnings. MFC after: 1 month. Modified: head/sys/netinet/sctp_usrreq.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Feb 18 12:19:15 2012 (r231894) +++ head/sys/netinet/sctp_usrreq.c Sat Feb 18 16:06:15 2012 (r231895) @@ -6357,7 +6357,7 @@ sctp_ingetaddr(struct socket *so, struct int sctp_peeraddr(struct socket *so, struct sockaddr **addr) { - struct sockaddr_in *sin = (struct sockaddr_in *)*addr; + struct sockaddr_in *sin; int fnd; struct sockaddr_in *sin_a; struct sctp_inpcb *inp; Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sat Feb 18 12:19:15 2012 (r231894) +++ head/sys/netinet6/sctp6_usrreq.c Sat Feb 18 16:06:15 2012 (r231895) @@ -1199,7 +1199,7 @@ sctp6_getaddr(struct socket *so, struct static int sctp6_peeraddr(struct socket *so, struct sockaddr **addr) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)*addr; + struct sockaddr_in6 *sin6; int fnd; struct sockaddr_in6 *sin_a6; struct sctp_inpcb *inp; From owner-svn-src-head@FreeBSD.ORG Sat Feb 18 22:26:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15422106564A; Sat, 18 Feb 2012 22:26:33 +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 00BFF8FC12; Sat, 18 Feb 2012 22:26:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1IMQW47050916; Sat, 18 Feb 2012 22:26:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1IMQWvM050914; Sat, 18 Feb 2012 22:26:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202182226.q1IMQWvM050914@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 18 Feb 2012 22:26: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: r231902 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2012 22:26:33 -0000 Author: kib Date: Sat Feb 18 22:26:32 2012 New Revision: 231902 URL: http://svn.freebsd.org/changeset/base/231902 Log: Document PL_FLAG_CHILD. MFC after: 3 days Modified: head/lib/libc/sys/ptrace.2 Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Sat Feb 18 20:27:01 2012 (r231901) +++ head/lib/libc/sys/ptrace.2 Sat Feb 18 22:26:32 2012 (r231902) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd October 5, 2011 +.Dd February 19, 2012 .Dt PTRACE 2 .Os .Sh NAME @@ -355,6 +355,11 @@ The process identifier of the new proces .Va pl_child_pid member of .Vt "struct ptrace_lwpinfo" . +.It PL_FLAG_CHILD +The flag is set for first event reported from a new child, which is +automatically attached due to +.Dv PT_FOLLOW_FORK +enabled. .El .It pl_sigmask The current signal mask of the LWP