From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 01:12:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3D4457AD; Sun, 7 Jul 2013 01:12:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE641BC4; Sun, 7 Jul 2013 01:12:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r671CTGX081792; Sun, 7 Jul 2013 01:12:29 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r671CTJ2081791; Sun, 7 Jul 2013 01:12:29 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307070112.r671CTJ2081791@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 7 Jul 2013 01:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252906 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 01:12:30 -0000 Author: pfg Date: Sun Jul 7 01:12:29 2013 New Revision: 252906 URL: http://svnweb.freebsd.org/changeset/base/252906 Log: Add files related to ext2 HTree implementation These should've been added along with r252890 Reported by: gonzo PointyHat: pfg MFC after: 1 week Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jul 6 23:56:58 2013 (r252905) +++ head/sys/conf/files Sun Jul 7 01:12:29 2013 (r252906) @@ -2666,6 +2666,8 @@ fs/ext2fs/ext2_balloc.c optional ext2fs fs/ext2fs/ext2_bmap.c optional ext2fs fs/ext2fs/ext2_inode.c optional ext2fs fs/ext2fs/ext2_inode_cnv.c optional ext2fs +fs/ext2fs/ext2_hash.c optional ext2fs +fs/ext2fs/ext2_htree.c optional ext2fs fs/ext2fs/ext2_lookup.c optional ext2fs fs/ext2fs/ext2_subr.c optional ext2fs fs/ext2fs/ext2_vfsops.c optional ext2fs From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 01:32:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B875AC33; Sun, 7 Jul 2013 01:32:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AB16B1C23; Sun, 7 Jul 2013 01:32:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r671WqLl087663; Sun, 7 Jul 2013 01:32:52 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r671Wq20087662; Sun, 7 Jul 2013 01:32:52 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307070132.r671Wq20087662@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 7 Jul 2013 01:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252907 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 01:32:52 -0000 Author: pfg Date: Sun Jul 7 01:32:52 2013 New Revision: 252907 URL: http://svnweb.freebsd.org/changeset/base/252907 Log: Fix some typos. MFC after: 1 week Modified: head/sys/fs/ext2fs/ext2_htree.c Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Sun Jul 7 01:12:29 2013 (r252906) +++ head/sys/fs/ext2fs/ext2_htree.c Sun Jul 7 01:32:52 2013 (r252907) @@ -313,7 +313,7 @@ error: } /* - * Try to lookup an directory entry in HTree index + * Try to lookup a directory entry in HTree index */ int ext2_htree_lookup(struct inode *ip, const char *name, int namelen, @@ -458,7 +458,7 @@ ext2_htree_insert_entry(struct ext2fs_ht } /* - * Compare two entry sort descriptiors by name hash value. + * Compare two entry sort descriptors by name hash value. * This is used together with qsort. */ static int @@ -584,7 +584,7 @@ ext2_htree_split_dirblock(char *block1, ep = (struct ext2fs_direct_2 *)(block1 + offset); offset += ep->e2d_reclen; if (last->e2d_ino) { - /* trim the existing slot */ + /* Trim the existing slot */ last->e2d_reclen = entry_len; last = (struct ext2fs_direct_2 *) ((char *)last + entry_len); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 02:59:30 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 055955F6; Sun, 7 Jul 2013 02:59:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 7649F1D74; Sun, 7 Jul 2013 02:59:28 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id B4B88104117D; Sun, 7 Jul 2013 12:26:11 +1000 (EST) Date: Sun, 7 Jul 2013 12:26:11 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker Subject: Re: svn commit: r252672 - head/sbin/nvmecontrol In-Reply-To: <20130706195108.GA34684@stack.nl> Message-ID: <20130707114237.L897@besplex.bde.org> References: <201307040026.r640QOCd079203@svn.freebsd.org> <20130704105843.B982@besplex.bde.org> <20130706184249.GD25842@garage.freebsd.pl> <20130706195108.GA34684@stack.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Q6eKePKa c=1 sm=1 a=RvpeemXtX5oA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=X2rCv88ZkwkA:10 a=juNRyV-Y17vnxQsPYmkA:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: Jim Harris , src-committers@FreeBSD.org, Pawel Jakub Dawidek , svn-src-all@FreeBSD.org, Bruce Evans , svn-src-head@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 02:59:30 -0000 On Sat, 6 Jul 2013, Jilles Tjoelker wrote: > On Sat, Jul 06, 2013 at 08:42:49PM +0200, Pawel Jakub Dawidek wrote: >> On Thu, Jul 04, 2013 at 11:44:28AM +1000, Bruce Evans wrote: >>> Many style bugs are visible in this patch: >> [...] >>> - sysexits.h is used >> [...] > >> Bruce, until sysexits(3) doesn't explicitly say it shouldn't be used, >> please stop calling this a bug, because you are just confusing people. >> At this point sysexits(3) actually even suggests it is blessed by >> style(9). This is how it starts: > >> According to style(9), it is not a good practice to call exit(3) >> with arbitrary values to indicate a failure condition when >> ending a program. Instead, the pre-defined exit codes from >> sysexits should be used, so the caller of the process can get a >> rough estimation about the failure class without looking up the >> source code. This is just another bug in sysexits(3). This is not according to style(9), since style(9) was fixed to not say that after I complained previously :-). It has never been normal practice to use sysexits(3), but someone who likes it added recommendations to use it to style(9) when they added the man pages for sysexits(3). Before that, it was so rarely used that it had no man page. >> In my personal opinion it doesn't hurt to use sysexits(3) - if you don't >> want to interpret exit status then treat every value != 0 as an error. >> In HAST (IIRC) I do interpret exit status - if I get EX_TEMPFAIL, I know >> I can try to restart the process, if I get something else I don't >> restart it, as I risk an infinite loop. That's fine for suites of programs that agree on exit codes. You can't depend on this for anything else. >> Apart from my personal opinion, if you want to call it a bug and not >> confuse people, then start discussion and change the manual page to >> recommend avoiding sysexits(3). As of now we are just sending mixed >> signals and create confusion. > > This is indeed confusing, because style(9) itself does not recommend > sysexits at all. This was changed in 2008 but sysexits(3) was not > adjusted along with that. > > The text in style(9) that only allows 0 or 1 is not universally valid > either. Firstly, in some application areas like mail delivery, it is > conventional and documented to use and interpret sysexits codes. (So if > HAST uses sysexits, it should document that fact.) Secondly, some other > utilities such as test, cmp and diff use 0 for a "true" condition, 1 for > a "false" condition and greater than 1 (usually 2) for failures. 0 and 1 are all that are universally valid. Programs shouldn't generate more than these unless they have special requirements/protocols. But nonzero meaning "failed" should be accepted by all POSIX programs. This is even more implementation-defined than I remembered in plain C programs. In C99, EXIT_SUCCESS (0) is mapped to success in some implementation-defined way; EXIT_FAILURE (1) is mapped to failure in some implementation-defined way; for all other exit() args, the whole mapping is implementation-defined, so 2 and everything in sysexits.h may be mapped to success. Therefore, portable C programs must not use anythying except 0 or 1 (preferably spelled using the C99 macros). Not using sysexits.h also keeps the sources portable. sysexits.h is in neither C99 nor POSIX. style(9) isn't the place to give portability lessons like the above. I think we discussed using EXIT_SUCCESS and EXIT_FAILURE when we changed it to not mention sysexits, but for some reason it hard code 0 and 1. The original style rule against using cryptic error codes hasn't been restored. From the 4.4BSD style guide: % /* % * Exits should be 0 on success, and 1 on failure. Don't denote % * all the possible exit points, using the integers 1 through 300. % */ % exit(0); /* Avoid obvious comments such as "Exit 0 on success." */ (Here 300 is off by 45. Exit statuses less than 0 and greater than 255 give implementation-defined behaviour that is worse than usual.) I think this rule is to limit cryptic undocumented exit codes. I don't like sysexits because it gives cryptic documented exit codes instead. All that can be safeley done (except in prgram suites) is map all nonzero exit codes to "failed" (or killed by a signal). In another thread involving Pawel, phk campaigns against errno and asks for error strings (even if they are only in English). Using perror() did this long ago for program termination, and using the err() family does it better. Except possibly for program suites -- translating a single numeric error is easier for programs than translating an unstructured string. I actually prefer using binary representations for programs. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 04:18:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A3BCBE70; Sun, 7 Jul 2013 04:18:35 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 86425101E; Sun, 7 Jul 2013 04:18:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r674IZC6036439; Sun, 7 Jul 2013 04:18:35 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r674IZZg036437; Sun, 7 Jul 2013 04:18:35 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201307070418.r674IZZg036437@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 7 Jul 2013 04:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252912 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 04:18:35 -0000 Author: gonzo Date: Sun Jul 7 04:18:35 2013 New Revision: 252912 URL: http://svnweb.freebsd.org/changeset/base/252912 Log: - Add initial host mode support for Mentor Graphics USB OTG controller - Sync musb_otg_atmelarm with new core logic API Modified: head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/musb_otg.h head/sys/dev/usb/controller/musb_otg_atmelarm.c Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Sun Jul 7 04:16:31 2013 (r252911) +++ head/sys/dev/usb/controller/musb_otg.c Sun Jul 7 04:18:35 2013 (r252912) @@ -95,6 +95,8 @@ SYSCTL_INT(_hw_usb_musbotg, OID_AUTO, de &musbotgdebug, 0, "Debug level"); #endif +#define MAX_NAK_TO 16 + /* prototypes */ struct usb_bus_methods musbotg_bus_methods; @@ -103,17 +105,35 @@ struct usb_pipe_methods musbotg_device_c struct usb_pipe_methods musbotg_device_intr_methods; struct usb_pipe_methods musbotg_device_isoc_methods; -static musbotg_cmd_t musbotg_setup_rx; -static musbotg_cmd_t musbotg_setup_data_rx; -static musbotg_cmd_t musbotg_setup_data_tx; -static musbotg_cmd_t musbotg_setup_status; -static musbotg_cmd_t musbotg_data_rx; -static musbotg_cmd_t musbotg_data_tx; +/* Control transfers: Device mode */ +static musbotg_cmd_t musbotg_dev_ctrl_setup_rx; +static musbotg_cmd_t musbotg_dev_ctrl_data_rx; +static musbotg_cmd_t musbotg_dev_ctrl_data_tx; +static musbotg_cmd_t musbotg_dev_ctrl_status; + +/* Control transfers: Host mode */ +static musbotg_cmd_t musbotg_host_ctrl_setup_tx; +static musbotg_cmd_t musbotg_host_ctrl_data_rx; +static musbotg_cmd_t musbotg_host_ctrl_data_tx; +static musbotg_cmd_t musbotg_host_ctrl_status_rx; +static musbotg_cmd_t musbotg_host_ctrl_status_tx; + +/* Bulk, Interrupt, Isochronous: Device mode */ +static musbotg_cmd_t musbotg_dev_data_rx; +static musbotg_cmd_t musbotg_dev_data_tx; + +/* Bulk, Interrupt, Isochronous: Host mode */ +static musbotg_cmd_t musbotg_host_data_rx; +static musbotg_cmd_t musbotg_host_data_tx; + static void musbotg_device_done(struct usb_xfer *, usb_error_t); static void musbotg_do_poll(struct usb_bus *); static void musbotg_standard_done(struct usb_xfer *); static void musbotg_interrupt_poll(struct musbotg_softc *); static void musbotg_root_intr(struct musbotg_softc *); +static int musbotg_channel_alloc(struct musbotg_softc *, struct musbotg_td *td); +static void musbotg_channel_free(struct musbotg_softc *, struct musbotg_td *td); +static void musbotg_ep_int_set(struct musbotg_softc *sc, int channel, int on); /* * Here is a configuration that the chip supports. @@ -128,6 +148,64 @@ static const struct usb_hw_ep_profile mu } }; +static int +musbotg_channel_alloc(struct musbotg_softc *sc, struct musbotg_td *td) +{ + int ch; + int ep; + + ep = td->ep_no; + + /* In device mode each EP got its own channel */ + if (sc->sc_mode == MUSB2_DEVICE_MODE) { + musbotg_ep_int_set(sc, ep, 1); + return (ep); + } + + /* + * All control transactions go through EP0 + */ + if (ep == 0) { + if (sc->sc_channel_mask & (1 << 0)) + return (-1); + sc->sc_channel_mask |= (1 << 0); + musbotg_ep_int_set(sc, ep, 1); + return (0); + } + + for (ch = 1; ch < MUSB2_EP_MAX; ch++) { + if (!(sc->sc_channel_mask & (1 << ch))) { + sc->sc_channel_mask |= (1 << ch); + musbotg_ep_int_set(sc, ch, 1); + return (ch); + } + } + + DPRINTFN(-1, "No available channels. Mask: %04x\n", sc->sc_channel_mask); + + return (-1); +} + +static void +musbotg_channel_free(struct musbotg_softc *sc, struct musbotg_td *td) +{ + + DPRINTFN(1, "ep_no=%d\n", td->channel); + + if (sc->sc_mode == MUSB2_DEVICE_MODE) + return; + + if (td == NULL) + return; + if (td->channel == -1) + return; + + musbotg_ep_int_set(sc, td->channel, 0); + sc->sc_channel_mask &= ~(1 << td->channel); + + td->channel = -1; +} + static void musbotg_get_hw_ep_profile(struct usb_device *udev, const struct usb_hw_ep_profile **ppf, uint8_t ep_addr) @@ -218,6 +296,46 @@ musbotg_pull_down(struct musbotg_softc * } static void +musbotg_suspend_host(struct musbotg_softc *sc) +{ + uint8_t temp; + + if (sc->sc_flags.status_suspend) { + return; + } + + temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); + temp |= MUSB2_MASK_SUSPMODE; + MUSB2_WRITE_1(sc, MUSB2_REG_POWER, temp); + sc->sc_flags.status_suspend = 1; +} + +static void +musbotg_wakeup_host(struct musbotg_softc *sc) +{ + uint8_t temp; + + if (!(sc->sc_flags.status_suspend)) { + return; + } + + temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); + temp &= ~MUSB2_MASK_SUSPMODE; + temp |= MUSB2_MASK_RESUME; + MUSB2_WRITE_1(sc, MUSB2_REG_POWER, temp); + + /* wait 20 milliseconds */ + /* Wait for reset to complete. */ + usb_pause_mtx(&sc->sc_bus.bus_mtx, hz / 50); + + temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); + temp &= ~MUSB2_MASK_RESUME; + MUSB2_WRITE_1(sc, MUSB2_REG_POWER, temp); + + sc->sc_flags.status_suspend = 0; +} + +static void musbotg_wakeup_peer(struct musbotg_softc *sc) { uint8_t temp; @@ -248,7 +366,7 @@ musbotg_set_address(struct musbotg_softc } static uint8_t -musbotg_setup_rx(struct musbotg_td *td) +musbotg_dev_ctrl_setup_rx(struct musbotg_td *td) { struct musbotg_softc *sc; struct usb_device_request req; @@ -258,6 +376,15 @@ musbotg_setup_rx(struct musbotg_td *td) /* get pointer to softc */ sc = MUSBOTG_PC2SC(td->pc); + if (td->channel == -1) + td->channel = musbotg_channel_alloc(sc, td); + + /* EP0 is busy, wait */ + if (td->channel == -1) + return (1); + + DPRINTFN(1, "ep_no=%d\n", td->channel); + /* select endpoint 0 */ MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, 0); @@ -274,8 +401,10 @@ musbotg_setup_rx(struct musbotg_td *td) /* do not stall at this point */ td->did_stall = 1; /* wait for interrupt */ + DPRINTFN(0, "CSR0 DATAEND\n"); goto not_complete; } + if (csr & MUSB2_MASK_CSR0L_SENTSTALL) { /* clear SENTSTALL */ MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, 0); @@ -294,6 +423,7 @@ musbotg_setup_rx(struct musbotg_td *td) sc->sc_ep0_busy = 0; } if (sc->sc_ep0_busy) { + DPRINTFN(0, "EP0 BUSY\n"); goto not_complete; } if (!(csr & MUSB2_MASK_CSR0L_RXPKTRDY)) { @@ -342,6 +472,8 @@ musbotg_setup_rx(struct musbotg_td *td) } else { sc->sc_dv_addr = 0xFF; } + + musbotg_channel_free(sc, td); return (0); /* complete */ not_complete: @@ -355,10 +487,117 @@ not_complete: return (1); /* not complete */ } +static uint8_t +musbotg_host_ctrl_setup_tx(struct musbotg_td *td) +{ + struct musbotg_softc *sc; + struct usb_device_request req; + uint8_t csr, csrh; + + /* get pointer to softc */ + sc = MUSBOTG_PC2SC(td->pc); + + if (td->channel == -1) + td->channel = musbotg_channel_alloc(sc, td); + + /* EP0 is busy, wait */ + if (td->channel == -1) + return (1); + + DPRINTFN(1, "ep_no=%d\n", td->channel); + + /* select endpoint 0 */ + MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, 0); + + /* read out FIFO status */ + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + DPRINTFN(4, "csr=0x%02x\n", csr); + + /* Not ready yet yet */ + if (csr & MUSB2_MASK_CSR0L_TXPKTRDY) + return (1); + + /* Failed */ + if (csr & (MUSB2_MASK_CSR0L_RXSTALL | + MUSB2_MASK_CSR0L_ERROR)) + { + /* Clear status bit */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, 0); + DPRINTFN(1, "error bit set, csr=0x%02x\n", csr); + td->error = 1; + } + + if (csr & MUSB2_MASK_CSR0L_NAKTIMO) { + DPRINTFN(1, "NAK timeout\n"); + + if (csr & MUSB2_MASK_CSR0L_TXFIFONEMPTY) { + csrh = MUSB2_READ_1(sc, MUSB2_REG_TXCSRH); + csrh |= MUSB2_MASK_CSR0H_FFLUSH; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRH, csrh); + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + if (csr & MUSB2_MASK_CSR0L_TXFIFONEMPTY) { + csrh = MUSB2_READ_1(sc, MUSB2_REG_TXCSRH); + csrh |= MUSB2_MASK_CSR0H_FFLUSH; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRH, csrh); + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + } + } + + csr &= ~MUSB2_MASK_CSR0L_NAKTIMO; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, csr); + + td->error = 1; + } + + if (td->error) { + musbotg_channel_free(sc, td); + return (0); + } + + /* Fifo is not empty and there is no NAK timeout */ + if (csr & MUSB2_MASK_CSR0L_TXPKTRDY) + return (1); + + /* check if we are complete */ + if (td->remainder == 0) { + /* we are complete */ + musbotg_channel_free(sc, td); + return (0); + } + + /* copy data into real buffer */ + usbd_copy_out(td->pc, 0, &req, sizeof(req)); + + /* send data */ + bus_space_write_multi_1(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), (void *)&req, sizeof(req)); + + /* update offset and remainder */ + td->offset += sizeof(req); + td->remainder -= sizeof(req); + + + MUSB2_WRITE_1(sc, MUSB2_REG_TXNAKLIMIT, MAX_NAK_TO); + MUSB2_WRITE_1(sc, MUSB2_REG_TXFADDR(0), td->dev_addr); + MUSB2_WRITE_1(sc, MUSB2_REG_TXHADDR(0), td->haddr); + MUSB2_WRITE_1(sc, MUSB2_REG_TXHUBPORT(0), td->hport); + MUSB2_WRITE_1(sc, MUSB2_REG_TXTI, td->transfer_type); + + /* write command */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_TXPKTRDY | + MUSB2_MASK_CSR0L_SETUPPKT); + + /* Just to be consistent, not used above */ + td->transaction_started = 1; + + return (1); /* in progress */ +} + /* Control endpoint only data handling functions (RX/TX/SYNC) */ static uint8_t -musbotg_setup_data_rx(struct musbotg_td *td) +musbotg_dev_ctrl_data_rx(struct musbotg_td *td) { struct usb_page_search buf_res; struct musbotg_softc *sc; @@ -501,7 +740,7 @@ musbotg_setup_data_rx(struct musbotg_td } static uint8_t -musbotg_setup_data_tx(struct musbotg_td *td) +musbotg_dev_ctrl_data_tx(struct musbotg_td *td) { struct usb_page_search buf_res; struct musbotg_softc *sc; @@ -606,90 +845,953 @@ musbotg_setup_data_tx(struct musbotg_td /* check remainder */ if (td->remainder == 0) { if (td->short_pkt) { - sc->sc_ep0_cmd = MUSB2_MASK_CSR0L_TXPKTRDY; + sc->sc_ep0_cmd = MUSB2_MASK_CSR0L_TXPKTRDY; + return (0); /* complete */ + } + /* else we need to transmit a short packet */ + } + /* write command */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_TXPKTRDY); + + return (1); /* not complete */ +} + +static uint8_t +musbotg_host_ctrl_data_rx(struct musbotg_td *td) +{ + struct usb_page_search buf_res; + struct musbotg_softc *sc; + uint16_t count; + uint8_t csr; + uint8_t got_short; + + /* get pointer to softc */ + sc = MUSBOTG_PC2SC(td->pc); + + if (td->channel == -1) + td->channel = musbotg_channel_alloc(sc, td); + + /* EP0 is busy, wait */ + if (td->channel == -1) + return (1); + + DPRINTFN(1, "ep_no=%d\n", td->channel); + + /* select endpoint 0 */ + MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, 0); + + /* read out FIFO status */ + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + + DPRINTFN(4, "csr=0x%02x\n", csr); + + got_short = 0; + if (!td->transaction_started) { + td->transaction_started = 1; + + MUSB2_WRITE_1(sc, MUSB2_REG_RXNAKLIMIT, MAX_NAK_TO); + + MUSB2_WRITE_1(sc, MUSB2_REG_RXFADDR(0), + td->dev_addr); + MUSB2_WRITE_1(sc, MUSB2_REG_RXHADDR(0), td->haddr); + MUSB2_WRITE_1(sc, MUSB2_REG_RXHUBPORT(0), td->hport); + MUSB2_WRITE_1(sc, MUSB2_REG_RXTI, td->transfer_type); + + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_REQPKT); + + return (1); + } + + if (csr & MUSB2_MASK_CSR0L_NAKTIMO) { + csr &= ~MUSB2_MASK_CSR0L_REQPKT; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, csr); + + csr &= ~MUSB2_MASK_CSR0L_NAKTIMO; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, csr); + + td->error = 1; + } + + /* Failed */ + if (csr & (MUSB2_MASK_CSR0L_RXSTALL | + MUSB2_MASK_CSR0L_ERROR)) + { + /* Clear status bit */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, 0); + DPRINTFN(1, "error bit set, csr=0x%02x\n", csr); + td->error = 1; + } + + if (td->error) { + musbotg_channel_free(sc, td); + return (0); /* we are complete */ + } + + if (!(csr & MUSB2_MASK_CSR0L_RXPKTRDY)) + return (1); /* not yet */ + + /* get the packet byte count */ + count = MUSB2_READ_2(sc, MUSB2_REG_RXCOUNT); + + /* verify the packet byte count */ + if (count != td->max_frame_size) { + if (count < td->max_frame_size) { + /* we have a short packet */ + td->short_pkt = 1; + got_short = 1; + } else { + /* invalid USB packet */ + td->error = 1; + musbotg_channel_free(sc, td); + return (0); /* we are complete */ + } + } + /* verify the packet byte count */ + if (count > td->remainder) { + /* invalid USB packet */ + td->error = 1; + musbotg_channel_free(sc, td); + return (0); /* we are complete */ + } + while (count > 0) { + uint32_t temp; + + usbd_get_page(td->pc, td->offset, &buf_res); + + /* get correct length */ + if (buf_res.length > count) { + buf_res.length = count; + } + /* check for unaligned memory address */ + if (USB_P2U(buf_res.buffer) & 3) { + + temp = count & ~3; + + if (temp) { + /* receive data 4 bytes at a time */ + bus_space_read_multi_4(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), sc->sc_bounce_buf, + temp / 4); + } + temp = count & 3; + if (temp) { + /* receive data 1 byte at a time */ + bus_space_read_multi_1(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), + (void *)(&sc->sc_bounce_buf[count / 4]), temp); + } + usbd_copy_in(td->pc, td->offset, + sc->sc_bounce_buf, count); + + /* update offset and remainder */ + td->offset += count; + td->remainder -= count; + break; + } + /* check if we can optimise */ + if (buf_res.length >= 4) { + + /* receive data 4 bytes at a time */ + bus_space_read_multi_4(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), buf_res.buffer, + buf_res.length / 4); + + temp = buf_res.length & ~3; + + /* update counters */ + count -= temp; + td->offset += temp; + td->remainder -= temp; + continue; + } + /* receive data */ + bus_space_read_multi_1(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), buf_res.buffer, buf_res.length); + + /* update counters */ + count -= buf_res.length; + td->offset += buf_res.length; + td->remainder -= buf_res.length; + } + + csr &= ~MUSB2_MASK_CSR0L_RXPKTRDY; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, csr); + + /* check if we are complete */ + if ((td->remainder == 0) || got_short) { + if (td->short_pkt) { + /* we are complete */ + + musbotg_channel_free(sc, td); + return (0); + } + /* else need to receive a zero length packet */ + } + + td->transaction_started = 1; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_REQPKT); + + return (1); /* not complete */ +} + +static uint8_t +musbotg_host_ctrl_data_tx(struct musbotg_td *td) +{ + struct usb_page_search buf_res; + struct musbotg_softc *sc; + uint16_t count; + uint8_t csr, csrh; + + /* get pointer to softc */ + sc = MUSBOTG_PC2SC(td->pc); + + if (td->channel == -1) + td->channel = musbotg_channel_alloc(sc, td); + + /* No free EPs */ + if (td->channel == -1) + return (1); + + DPRINTFN(1, "ep_no=%d\n", td->channel); + + /* select endpoint */ + MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, 0); + + /* read out FIFO status */ + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + DPRINTFN(4, "csr=0x%02x\n", csr); + + if (csr & (MUSB2_MASK_CSR0L_RXSTALL | + MUSB2_MASK_CSR0L_ERROR)) { + /* clear status bits */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, 0); + td->error = 1; + } + + if (csr & MUSB2_MASK_CSR0L_NAKTIMO ) { + + if (csr & MUSB2_MASK_CSR0L_TXFIFONEMPTY) { + csrh = MUSB2_READ_1(sc, MUSB2_REG_TXCSRH); + csrh |= MUSB2_MASK_CSR0H_FFLUSH; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRH, csrh); + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + if (csr & MUSB2_MASK_CSR0L_TXFIFONEMPTY) { + csrh = MUSB2_READ_1(sc, MUSB2_REG_TXCSRH); + csrh |= MUSB2_MASK_CSR0H_FFLUSH; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRH, csrh); + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + } + } + + csr &= ~MUSB2_MASK_CSR0L_NAKTIMO; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, csr); + + td->error = 1; + } + + + if (td->error) { + musbotg_channel_free(sc, td); + return (0); /* complete */ + } + + /* + * Wait while FIFO is empty. + * Do not flush it because it will cause transactions + * with size more then packet size. It might upset + * some devices + */ + if (csr & MUSB2_MASK_CSR0L_TXFIFONEMPTY) + return (1); + + /* Packet still being processed */ + if (csr & MUSB2_MASK_CSR0L_TXPKTRDY) + return (1); + + if (td->transaction_started) { + /* check remainder */ + if (td->remainder == 0) { + if (td->short_pkt) { + musbotg_channel_free(sc, td); + return (0); /* complete */ + } + /* else we need to transmit a short packet */ + } + + /* We're not complete - more transactions required */ + td->transaction_started = 0; + } + + /* check for short packet */ + count = td->max_frame_size; + if (td->remainder < count) { + /* we have a short packet */ + td->short_pkt = 1; + count = td->remainder; + } + + while (count > 0) { + uint32_t temp; + + usbd_get_page(td->pc, td->offset, &buf_res); + + /* get correct length */ + if (buf_res.length > count) { + buf_res.length = count; + } + /* check for unaligned memory address */ + if (USB_P2U(buf_res.buffer) & 3) { + + usbd_copy_out(td->pc, td->offset, + sc->sc_bounce_buf, count); + + temp = count & ~3; + + if (temp) { + /* transmit data 4 bytes at a time */ + bus_space_write_multi_4(sc->sc_io_tag, + sc->sc_io_hdl, MUSB2_REG_EPFIFO(0), + sc->sc_bounce_buf, temp / 4); + } + temp = count & 3; + if (temp) { + /* receive data 1 byte at a time */ + bus_space_write_multi_1(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), + ((void *)&sc->sc_bounce_buf[count / 4]), temp); + } + /* update offset and remainder */ + td->offset += count; + td->remainder -= count; + break; + } + /* check if we can optimise */ + if (buf_res.length >= 4) { + + /* transmit data 4 bytes at a time */ + bus_space_write_multi_4(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), buf_res.buffer, + buf_res.length / 4); + + temp = buf_res.length & ~3; + + /* update counters */ + count -= temp; + td->offset += temp; + td->remainder -= temp; + continue; + } + /* transmit data */ + bus_space_write_multi_1(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(0), buf_res.buffer, + buf_res.length); + + /* update counters */ + count -= buf_res.length; + td->offset += buf_res.length; + td->remainder -= buf_res.length; + } + + /* Function address */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXFADDR(0), td->dev_addr); + MUSB2_WRITE_1(sc, MUSB2_REG_TXHADDR(0), td->haddr); + MUSB2_WRITE_1(sc, MUSB2_REG_TXHUBPORT(0), td->hport); + MUSB2_WRITE_1(sc, MUSB2_REG_TXTI, td->transfer_type); + + /* TX NAK timeout */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXNAKLIMIT, MAX_NAK_TO); + + /* write command */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_TXPKTRDY); + + td->transaction_started = 1; + + return (1); /* not complete */ +} + +static uint8_t +musbotg_dev_ctrl_status(struct musbotg_td *td) +{ + struct musbotg_softc *sc; + uint8_t csr; + + /* get pointer to softc */ + sc = MUSBOTG_PC2SC(td->pc); + + /* select endpoint 0 */ + MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, 0); + + if (sc->sc_ep0_busy) { + sc->sc_ep0_busy = 0; + sc->sc_ep0_cmd |= MUSB2_MASK_CSR0L_DATAEND; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, sc->sc_ep0_cmd); + sc->sc_ep0_cmd = 0; + } + /* read out FIFO status */ + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + + DPRINTFN(4, "csr=0x%02x\n", csr); + + if (csr & MUSB2_MASK_CSR0L_DATAEND) { + /* wait for interrupt */ + return (1); /* not complete */ + } + if (sc->sc_dv_addr != 0xFF) { + /* write function address */ + musbotg_set_address(sc, sc->sc_dv_addr); + } + + musbotg_channel_free(sc, td); + return (0); /* complete */ +} + +static uint8_t +musbotg_host_ctrl_status_rx(struct musbotg_td *td) +{ + struct musbotg_softc *sc; + uint8_t csr, csrh; + + /* get pointer to softc */ + sc = MUSBOTG_PC2SC(td->pc); + + if (td->channel == -1) + td->channel = musbotg_channel_alloc(sc, td); + + /* EP0 is busy, wait */ + if (td->channel == -1) + return (1); + + DPRINTFN(1, "ep_no=%d\n", td->channel); + + /* select endpoint 0 */ + MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, 0); + + if (!td->transaction_started) { + MUSB2_WRITE_1(sc, MUSB2_REG_RXFADDR(0), + td->dev_addr); + + MUSB2_WRITE_1(sc, MUSB2_REG_RXHADDR(0), td->haddr); + MUSB2_WRITE_1(sc, MUSB2_REG_RXHUBPORT(0), td->hport); + MUSB2_WRITE_1(sc, MUSB2_REG_RXTI, td->transfer_type); + + /* RX NAK timeout */ + MUSB2_WRITE_1(sc, MUSB2_REG_RXNAKLIMIT, MAX_NAK_TO); + + td->transaction_started = 1; + + /* Disable PING */ + csrh = MUSB2_READ_1(sc, MUSB2_REG_RXCSRH); + csrh |= MUSB2_MASK_CSR0H_PING_DIS; + MUSB2_WRITE_1(sc, MUSB2_REG_RXCSRH, csrh); + + /* write command */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_STATUSPKT | + MUSB2_MASK_CSR0L_REQPKT); + + return (1); /* Just started */ + + } + + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + + DPRINTFN(4, "IN STATUS csr=0x%02x\n", csr); + + if (csr & MUSB2_MASK_CSR0L_RXPKTRDY) { + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_RXPKTRDY_CLR); + musbotg_channel_free(sc, td); + return (0); /* complete */ + } + + if (csr & MUSB2_MASK_CSR0L_NAKTIMO) { + csr &= ~ (MUSB2_MASK_CSR0L_STATUSPKT | + MUSB2_MASK_CSR0L_REQPKT); + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, csr); + + csr &= ~MUSB2_MASK_CSR0L_NAKTIMO; + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, csr); + td->error = 1; + } + + /* Failed */ + if (csr & (MUSB2_MASK_CSR0L_RXSTALL | + MUSB2_MASK_CSR0L_ERROR)) + { + /* Clear status bit */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, 0); + DPRINTFN(1, "error bit set, csr=0x%02x\n", csr); + td->error = 1; + } + + if (td->error) { + musbotg_channel_free(sc, td); + return (0); + } + + return (1); /* Not ready yet */ +} + +static uint8_t +musbotg_host_ctrl_status_tx(struct musbotg_td *td) +{ + struct musbotg_softc *sc; + uint8_t csr; + + /* get pointer to softc */ + sc = MUSBOTG_PC2SC(td->pc); + + if (td->channel == -1) + td->channel = musbotg_channel_alloc(sc, td); + + /* EP0 is busy, wait */ + if (td->channel == -1) + return (1); + + DPRINTFN(1, "ep_no=%d/%d [%d@%d.%d/%02x]\n", td->channel, td->transaction_started, + td->dev_addr,td->haddr,td->hport, td->transfer_type); + + /* select endpoint 0 */ + MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, 0); + + csr = MUSB2_READ_1(sc, MUSB2_REG_TXCSRL); + DPRINTFN(4, "csr=0x%02x\n", csr); + + /* Not yet */ + if (csr & MUSB2_MASK_CSR0L_TXPKTRDY) + return (1); + + /* Failed */ + if (csr & (MUSB2_MASK_CSR0L_RXSTALL | + MUSB2_MASK_CSR0L_ERROR)) + { + /* Clear status bit */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, 0); + DPRINTFN(1, "error bit set, csr=0x%02x\n", csr); + td->error = 1; + musbotg_channel_free(sc, td); + return (0); /* complete */ + } + + if (td->transaction_started) { + musbotg_channel_free(sc, td); + return (0); /* complete */ + } + + MUSB2_WRITE_1(sc, MUSB2_REG_RXCSRH, MUSB2_MASK_CSR0H_PING_DIS); + + MUSB2_WRITE_1(sc, MUSB2_REG_TXFADDR(0), td->dev_addr); + MUSB2_WRITE_1(sc, MUSB2_REG_TXHADDR(0), td->haddr); + MUSB2_WRITE_1(sc, MUSB2_REG_TXHUBPORT(0), td->hport); + MUSB2_WRITE_1(sc, MUSB2_REG_TXTI, td->transfer_type); + + /* TX NAK timeout */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXNAKLIMIT, MAX_NAK_TO); + + td->transaction_started = 1; + + /* write command */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRL, + MUSB2_MASK_CSR0L_STATUSPKT | + MUSB2_MASK_CSR0L_TXPKTRDY); + + return (1); /* wait for interrupt */ +} + +static uint8_t +musbotg_dev_data_rx(struct musbotg_td *td) +{ + struct usb_page_search buf_res; + struct musbotg_softc *sc; + uint16_t count; + uint8_t csr; + uint8_t to; + uint8_t got_short; + + to = 8; /* don't loop forever! */ + got_short = 0; + + /* get pointer to softc */ + sc = MUSBOTG_PC2SC(td->pc); + + if (td->channel == -1) + td->channel = musbotg_channel_alloc(sc, td); + + /* EP0 is busy, wait */ + if (td->channel == -1) + return (1); + + /* select endpoint */ + MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, td->channel); + +repeat: + /* read out FIFO status */ + csr = MUSB2_READ_1(sc, MUSB2_REG_RXCSRL); + + DPRINTFN(4, "csr=0x%02x\n", csr); + + /* clear overrun */ + if (csr & MUSB2_MASK_CSRL_RXOVERRUN) { + /* make sure we don't clear "RXPKTRDY" */ + MUSB2_WRITE_1(sc, MUSB2_REG_RXCSRL, + MUSB2_MASK_CSRL_RXPKTRDY); + } + + /* check status */ + if (!(csr & MUSB2_MASK_CSRL_RXPKTRDY)) + return (1); /* not complete */ + + /* get the packet byte count */ + count = MUSB2_READ_2(sc, MUSB2_REG_RXCOUNT); + + DPRINTFN(4, "count=0x%04x\n", count); + + /* + * Check for short or invalid packet: + */ + if (count != td->max_frame_size) { + if (count < td->max_frame_size) { + /* we have a short packet */ + td->short_pkt = 1; + got_short = 1; + } else { + /* invalid USB packet */ + td->error = 1; + musbotg_channel_free(sc, td); + return (0); /* we are complete */ + } + } + /* verify the packet byte count */ + if (count > td->remainder) { + /* invalid USB packet */ + td->error = 1; + musbotg_channel_free(sc, td); + return (0); /* we are complete */ + } + while (count > 0) { + uint32_t temp; + + usbd_get_page(td->pc, td->offset, &buf_res); + + /* get correct length */ + if (buf_res.length > count) { + buf_res.length = count; + } + /* check for unaligned memory address */ + if (USB_P2U(buf_res.buffer) & 3) { + + temp = count & ~3; + + if (temp) { + /* receive data 4 bytes at a time */ + bus_space_read_multi_4(sc->sc_io_tag, sc->sc_io_hdl, + MUSB2_REG_EPFIFO(td->channel), sc->sc_bounce_buf, + temp / 4); + } + temp = count & 3; + if (temp) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 04:22:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 90D24161; Sun, 7 Jul 2013 04:22:09 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 718DE1046; Sun, 7 Jul 2013 04:22:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r674M9uA038539; Sun, 7 Jul 2013 04:22:09 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r674M9HM038537; Sun, 7 Jul 2013 04:22:09 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201307070422.r674M9HM038537@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 7 Jul 2013 04:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252913 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 04:22:09 -0000 Author: gonzo Date: Sun Jul 7 04:22:08 2013 New Revision: 252913 URL: http://svnweb.freebsd.org/changeset/base/252913 Log: - Add USBSS driver for AM335x SoC. Driver is a wrapper around Mentors Graphic USB OTG core. Added: head/sys/arm/ti/am335x/am335x_usbss.c (contents, props changed) Modified: head/sys/arm/ti/am335x/files.am335x Added: head/sys/arm/ti/am335x/am335x_usbss.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_usbss.c Sun Jul 7 04:22:08 2013 (r252913) @@ -0,0 +1,481 @@ +/*- + * Copyright (c) 2013 Oleksandr Tymoshenko + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#define USB_DEBUG_VAR usbssdebug + +#include +#include +#include +#include + +#include + +#include +#include +#include + +#define AM335X_USB_PORTS 2 + +#define USBSS_REVREG 0x00 +#define USBSS_SYSCONFIG 0x10 +#define USBSS_SYSCONFIG_SRESET 1 + +#define USBCTRL_REV 0x00 +#define USBCTRL_CTRL 0x14 +#define USBCTRL_STAT 0x18 +#define USBCTRL_IRQ_STAT0 0x30 +#define IRQ_STAT0_RXSHIFT 16 +#define IRQ_STAT0_TXSHIFT 0 +#define USBCTRL_IRQ_STAT1 0x34 +#define IRQ_STAT1_DRVVBUS (1 << 8) +#define USBCTRL_INTEN_SET0 0x38 +#define USBCTRL_INTEN_SET1 0x3C +#define USBCTRL_INTEN_USB_ALL 0x1ff +#define USBCTRL_INTEN_USB_SOF (1 << 3) +#define USBCTRL_INTEN_CLR0 0x40 +#define USBCTRL_INTEN_CLR1 0x44 +#define USBCTRL_UTMI 0xE0 +#define USBCTRL_UTMI_FSDATAEXT (1 << 1) +#define USBCTRL_MODE 0xE8 +#define USBCTRL_MODE_IDDIG (1 << 8) +#define USBCTRL_MODE_IDDIGMUX (1 << 7) + +/* USBSS resource + 2 MUSB ports */ + +#define RES_USBSS 0 +#define RES_USBCTRL(i) (3*i+1) +#define RES_USBPHY(i) (3*i+2) +#define RES_USBCORE(i) (3*i+3) + +#define USB_WRITE4(sc, idx, reg, val) do { \ + bus_write_4((sc)->sc_mem_res[idx], (reg), (val)); \ +} while (0) + +#define USB_READ4(sc, idx, reg) bus_read_4((sc)->sc_mem_res[idx], (reg)) + +#define USBSS_WRITE4(sc, reg, val) \ + USB_WRITE4((sc), RES_USBSS, (reg), (val)) +#define USBSS_READ4(sc, reg) \ + USB_READ4((sc), RES_USBSS, (reg)) +#define USBCTRL_WRITE4(sc, unit, reg, val) \ + USB_WRITE4((sc), RES_USBCTRL(unit), (reg), (val)) +#define USBCTRL_READ4(sc, unit, reg) \ + USB_READ4((sc), RES_USBCTRL(unit), (reg)) +#define USBPHY_WRITE4(sc, unit, reg, val) \ + USB_WRITE4((sc), RES_USBPHY(unit), (reg), (val)) +#define USBPHY_READ4(sc, unit, reg) \ + USB_READ4((sc), RES_USBPHY(unit), (reg)) + +static struct resource_spec am335x_musbotg_mem_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 1, RF_ACTIVE }, + { SYS_RES_MEMORY, 2, RF_ACTIVE }, + { SYS_RES_MEMORY, 3, RF_ACTIVE }, + { SYS_RES_MEMORY, 4, RF_ACTIVE }, + { SYS_RES_MEMORY, 5, RF_ACTIVE }, + { SYS_RES_MEMORY, 6, RF_ACTIVE }, + { -1, 0, 0 } +}; + +static struct resource_spec am335x_musbotg_irq_spec[] = { + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { SYS_RES_IRQ, 2, RF_ACTIVE }, + { -1, 0, 0 } +}; + +#ifdef USB_DEBUG +static int usbssdebug = 0; + +static SYSCTL_NODE(_hw_usb, OID_AUTO, am335x_usbss, CTLFLAG_RW, 0, "AM335x USBSS"); +SYSCTL_INT(_hw_usb_am335x_usbss, OID_AUTO, debug, CTLFLAG_RW, + &usbssdebug, 0, "Debug level"); +#endif + +static device_probe_t musbotg_probe; +static device_attach_t musbotg_attach; +static device_detach_t musbotg_detach; + +struct musbotg_super_softc { + struct musbotg_softc sc_otg[AM335X_USB_PORTS]; + struct resource *sc_mem_res[AM335X_USB_PORTS*3+1]; + struct resource *sc_irq_res[AM335X_USB_PORTS+1]; + void *sc_intr_hdl; +}; + +static void +musbotg_vbus_poll(struct musbotg_super_softc *sc, int port) +{ + uint32_t stat; + + if (sc->sc_otg[port].sc_mode == MUSB2_DEVICE_MODE) + musbotg_vbus_interrupt(&sc->sc_otg[port], 1); + else { + stat = USBCTRL_READ4(sc, port, USBCTRL_STAT); + musbotg_vbus_interrupt(&sc->sc_otg[port], stat & 1); + } +} + +/* + * Arg to musbotg_clocks_on and musbot_clocks_off is + * a uint32_t * pointing to the SCM register offset. + */ +static uint32_t USB_CTRL[] = {SCM_USB_CTRL0, SCM_USB_CTRL1}; + +static void +musbotg_clocks_on(void *arg) +{ + uint32_t c, reg = *(uint32_t *)arg; + + ti_scm_reg_read_4(reg, &c); + c &= ~3; /* Enable power */ + c |= 1 << 19; /* VBUS detect enable */ + c |= 1 << 20; /* Session end enable */ + ti_scm_reg_write_4(reg, c); +} + +static void +musbotg_clocks_off(void *arg) +{ + uint32_t c, reg = *(uint32_t *)arg; + + /* Disable power to PHY */ + ti_scm_reg_read_4(reg, &c); + ti_scm_reg_write_4(reg, c | 3); +} + +static void +musbotg_ep_int_set(struct musbotg_softc *sc, int ep, int on) +{ + struct musbotg_super_softc *ssc = sc->sc_platform_data; + uint32_t epmask; + + epmask = ((1 << ep) << IRQ_STAT0_RXSHIFT); + epmask |= ((1 << ep) << IRQ_STAT0_TXSHIFT); + if (on) + USBCTRL_WRITE4(ssc, sc->sc_id, + USBCTRL_INTEN_SET0, epmask); + else + USBCTRL_WRITE4(ssc, sc->sc_id, + USBCTRL_INTEN_CLR0, epmask); +} + +static void +musbotg_usbss_interrupt(void *arg) +{ + panic("USBSS real interrupt"); +} + +static void +musbotg_wrapper_interrupt(void *arg) +{ + struct musbotg_softc *sc = arg; + struct musbotg_super_softc *ssc = sc->sc_platform_data; + uint32_t stat, stat0, stat1; + stat = USBCTRL_READ4(ssc, sc->sc_id, USBCTRL_STAT); + stat0 = USBCTRL_READ4(ssc, sc->sc_id, USBCTRL_IRQ_STAT0); + stat1 = USBCTRL_READ4(ssc, sc->sc_id, USBCTRL_IRQ_STAT1); + if (stat0) + USBCTRL_WRITE4(ssc, sc->sc_id, USBCTRL_IRQ_STAT0, stat0); + if (stat1) + USBCTRL_WRITE4(ssc, sc->sc_id, USBCTRL_IRQ_STAT1, stat1); + + DPRINTFN(4, "port%d: stat0=%08x stat1=%08x, stat=%08x\n", + sc->sc_id, stat0, stat1, stat); + + if (stat1 & IRQ_STAT1_DRVVBUS) + musbotg_vbus_interrupt(sc, stat & 1); + + musbotg_interrupt(arg, ((stat0 >> 16) & 0xffff), + stat0 & 0xffff, stat1 & 0xff); +} + +static int +musbotg_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "ti,musb-am33xx")) + return (ENXIO); + + device_set_desc(dev, "TI AM33xx integrated USB OTG controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +musbotg_attach(device_t dev) +{ + struct musbotg_super_softc *sc = device_get_softc(dev); + int err; + int i; + uint32_t rev, reg; + + /* Request the memory resources */ + err = bus_alloc_resources(dev, am335x_musbotg_mem_spec, + sc->sc_mem_res); + if (err) { + device_printf(dev, + "Error: could not allocate mem resources\n"); + return (ENXIO); + } + + /* Request the IRQ resources */ + err = bus_alloc_resources(dev, am335x_musbotg_irq_spec, + sc->sc_irq_res); + if (err) { + device_printf(dev, + "Error: could not allocate irq resources\n"); + return (ENXIO); + } + + /* + * Reset USBSS, USB0 and USB1 + */ + rev = USBSS_READ4(sc, USBSS_REVREG); + device_printf(dev, "TI AM335X USBSS v%d.%d.%d\n", + (rev >> 8) & 7, (rev >> 6) & 3, rev & 63); + + ti_prcm_clk_enable(MUSB0_CLK); + + USBSS_WRITE4(sc, USBSS_SYSCONFIG, + USBSS_SYSCONFIG_SRESET); + while (USBSS_READ4(sc, USBSS_SYSCONFIG) & + USBSS_SYSCONFIG_SRESET) + ; + + err = bus_setup_intr(dev, sc->sc_irq_res[0], + INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)musbotg_usbss_interrupt, sc, + &sc->sc_intr_hdl); + + if (err) { + sc->sc_intr_hdl = NULL; + device_printf(dev, "Failed to setup USBSS interrupt\n"); + goto error; + } + + for (i = 0; i < AM335X_USB_PORTS; i++) { + /* setup MUSB OTG USB controller interface softc */ + sc->sc_otg[i].sc_clocks_on = &musbotg_clocks_on; + sc->sc_otg[i].sc_clocks_off = &musbotg_clocks_off; + sc->sc_otg[i].sc_clocks_arg = &USB_CTRL[i]; + + sc->sc_otg[i].sc_ep_int_set = musbotg_ep_int_set; + + /* initialise some bus fields */ + sc->sc_otg[i].sc_bus.parent = dev; + sc->sc_otg[i].sc_bus.devices = sc->sc_otg[i].sc_devices; + sc->sc_otg[i].sc_bus.devices_max = MUSB2_MAX_DEVICES; + + /* get all DMA memory */ + if (usb_bus_mem_alloc_all(&sc->sc_otg[i].sc_bus, + USB_GET_DMA_TAG(dev), NULL)) { + device_printf(dev, + "Failed allocate bus mem for musb%d\n", i); + return (ENOMEM); + } + sc->sc_otg[i].sc_io_res = sc->sc_mem_res[RES_USBCORE(i)]; + sc->sc_otg[i].sc_io_tag = + rman_get_bustag(sc->sc_otg[i].sc_io_res); + sc->sc_otg[i].sc_io_hdl = + rman_get_bushandle(sc->sc_otg[i].sc_io_res); + sc->sc_otg[i].sc_io_size = + rman_get_size(sc->sc_otg[i].sc_io_res); + + sc->sc_otg[i].sc_irq_res = sc->sc_irq_res[i+1]; + + sc->sc_otg[i].sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (!(sc->sc_otg[i].sc_bus.bdev)) { + device_printf(dev, "No busdev for musb%d\n", i); + goto error; + } + device_set_ivars(sc->sc_otg[i].sc_bus.bdev, + &sc->sc_otg[i].sc_bus); + + err = bus_setup_intr(dev, sc->sc_otg[i].sc_irq_res, + INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)musbotg_wrapper_interrupt, + &sc->sc_otg[i], &sc->sc_otg[i].sc_intr_hdl); + if (err) { + sc->sc_otg[i].sc_intr_hdl = NULL; + device_printf(dev, + "Failed to setup interrupt for musb%d\n", i); + goto error; + } + + sc->sc_otg[i].sc_id = i; + sc->sc_otg[i].sc_platform_data = sc; + if (i == 0) + sc->sc_otg[i].sc_mode = MUSB2_DEVICE_MODE; + else + sc->sc_otg[i].sc_mode = MUSB2_HOST_MODE; + + /* + * software-controlled function + */ + + if (sc->sc_otg[i].sc_mode == MUSB2_HOST_MODE) { + reg = USBCTRL_READ4(sc, i, USBCTRL_MODE); + reg |= USBCTRL_MODE_IDDIGMUX; + reg &= ~USBCTRL_MODE_IDDIG; + USBCTRL_WRITE4(sc, i, USBCTRL_MODE, reg); + USBCTRL_WRITE4(sc, i, USBCTRL_UTMI, + USBCTRL_UTMI_FSDATAEXT); + } else { + reg = USBCTRL_READ4(sc, i, USBCTRL_MODE); + reg |= USBCTRL_MODE_IDDIGMUX; + reg |= USBCTRL_MODE_IDDIG; + USBCTRL_WRITE4(sc, i, USBCTRL_MODE, reg); + } + + reg = USBCTRL_INTEN_USB_ALL & ~USBCTRL_INTEN_USB_SOF; + USBCTRL_WRITE4(sc, i, USBCTRL_INTEN_SET1, reg); + USBCTRL_WRITE4(sc, i, USBCTRL_INTEN_CLR0, 0xffffffff); + + err = musbotg_init(&sc->sc_otg[i]); + if (!err) + err = device_probe_and_attach(sc->sc_otg[i].sc_bus.bdev); + + if (err) + goto error; + + /* poll VBUS one time */ + musbotg_vbus_poll(sc, i); + } + + return (0); + +error: + musbotg_detach(dev); + return (ENXIO); +} + +static int +musbotg_detach(device_t dev) +{ + struct musbotg_super_softc *sc = device_get_softc(dev); + device_t bdev; + int err; + int i; + + for (i = 0; i < AM335X_USB_PORTS; i++) { + if (sc->sc_otg[i].sc_bus.bdev) { + bdev = sc->sc_otg[i].sc_bus.bdev; + device_detach(bdev); + device_delete_child(dev, bdev); + } + + if (sc->sc_otg[i].sc_irq_res && sc->sc_otg[i].sc_intr_hdl) { + /* + * only call musbotg_uninit() after musbotg_init() + */ + musbotg_uninit(&sc->sc_otg[i]); + + err = bus_teardown_intr(dev, sc->sc_otg[i].sc_irq_res, + sc->sc_otg[i].sc_intr_hdl); + sc->sc_otg[i].sc_intr_hdl = NULL; + } + + usb_bus_mem_free_all(&sc->sc_otg[i].sc_bus, NULL); + } + + if (sc->sc_intr_hdl) { + bus_teardown_intr(dev, sc->sc_irq_res[0], + sc->sc_intr_hdl); + sc->sc_intr_hdl = NULL; + } + + + /* Free resources if any */ + if (sc->sc_mem_res[0]) + bus_release_resources(dev, am335x_musbotg_mem_spec, + sc->sc_mem_res); + + if (sc->sc_irq_res[0]) + bus_release_resources(dev, am335x_musbotg_irq_spec, + sc->sc_irq_res); + + /* during module unload there are lots of children leftover */ + device_delete_children(dev); + + return (0); +} + +static device_method_t musbotg_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, musbotg_probe), + DEVMETHOD(device_attach, musbotg_attach), + DEVMETHOD(device_detach, musbotg_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + DEVMETHOD_END +}; + +static driver_t musbotg_driver = { + .name = "musbotg", + .methods = musbotg_methods, + .size = sizeof(struct musbotg_super_softc), +}; + +static devclass_t musbotg_devclass; + +DRIVER_MODULE(musbotg, simplebus, musbotg_driver, musbotg_devclass, 0, 0); +MODULE_DEPEND(musbotg, usb, 1, 1, 1); Modified: head/sys/arm/ti/am335x/files.am335x ============================================================================== --- head/sys/arm/ti/am335x/files.am335x Sun Jul 7 04:18:35 2013 (r252912) +++ head/sys/arm/ti/am335x/files.am335x Sun Jul 7 04:22:08 2013 (r252913) @@ -7,6 +7,7 @@ arm/ti/am335x/am335x_scm_padconf.c stand arm/ti/am335x/am335x_lcd.c optional sc arm/ti/am335x/am335x_lcd_syscons.c optional sc arm/ti/am335x/am335x_pwm.c standard +arm/ti/am335x/am335x_usbss.c optional musb fdt arm/ti/ti_edma3.c standard arm/ti/ti_mmchs.c optional mmc arm/ti/cpsw/if_cpsw.c optional cpsw From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 04:23:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E1AE32A6; Sun, 7 Jul 2013 04:23:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C2B291056; Sun, 7 Jul 2013 04:23:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r674NUJW038724; Sun, 7 Jul 2013 04:23:30 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r674NUnN038714; Sun, 7 Jul 2013 04:23:30 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201307070423.r674NUnN038714@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 7 Jul 2013 04:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252914 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 04:23:31 -0000 Author: gonzo Date: Sun Jul 7 04:23:29 2013 New Revision: 252914 URL: http://svnweb.freebsd.org/changeset/base/252914 Log: - Add musb node to shared dtsi and proper pin configuratin for every AM553x-based device Modified: head/sys/boot/fdt/dts/am335x-evm.dts head/sys/boot/fdt/dts/am335x.dtsi head/sys/boot/fdt/dts/beaglebone-black.dts head/sys/boot/fdt/dts/beaglebone.dts Modified: head/sys/boot/fdt/dts/am335x-evm.dts ============================================================================== --- head/sys/boot/fdt/dts/am335x-evm.dts Sun Jul 7 04:22:08 2013 (r252913) +++ head/sys/boot/fdt/dts/am335x-evm.dts Sun Jul 7 04:23:29 2013 (r252914) @@ -106,6 +106,9 @@ "GPMC_BEn0_CLE", "timer5", "output", "GPMC_WEn", "timer6", "output", "GPMC_OEn_REn", "timer7", "output", + /* USB0 and USB1 */ + "USB0_DRVVBUS", "USB0_DRVVBUS", "output", + "USB1_DRVVBUS", "USB1_DRVVBUS", "output", /* LCD */ "GPMC_AD8", "lcd_data23", "output", "GPMC_AD9", "lcd_data22", "output", Modified: head/sys/boot/fdt/dts/am335x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/am335x.dtsi Sun Jul 7 04:22:08 2013 (r252913) +++ head/sys/boot/fdt/dts/am335x.dtsi Sun Jul 7 04:23:29 2013 (r252914) @@ -201,5 +201,23 @@ interrupts = <36>; interrupt-parent = <&AINTC>; }; + + usb@47400000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,musb-am33xx"; + reg =< 0x47400000 0x1000 /* USBSS */ + 0x47401000 0x300 /* USB0 */ + 0x47401300 0x100 /* USB0_PHY */ + 0x47401400 0x400 /* USB0_CORE */ + 0x47401800 0x300 /* USB1 */ + 0x47401B00 0x100 /* USB1_PHY */ + 0x47401C00 0x400 /* USB1_CORE */ + >; + interrupts = <17 18 19>; + interrupt-parent = <&AINTC>; + /* 1 - Host Mode, 0 - Device Mode */ + modemask = <2>; + }; }; }; Modified: head/sys/boot/fdt/dts/beaglebone-black.dts ============================================================================== --- head/sys/boot/fdt/dts/beaglebone-black.dts Sun Jul 7 04:22:08 2013 (r252913) +++ head/sys/boot/fdt/dts/beaglebone-black.dts Sun Jul 7 04:23:29 2013 (r252914) @@ -123,6 +123,9 @@ "GPMC_BEn0_CLE", "timer5", "output", "GPMC_WEn", "timer6", "output", "GPMC_OEn_REn", "timer7", "output", + /* USB0 and USB1 */ + "USB0_DRVVBUS", "USB0_DRVVBUS", "output", + "USB1_DRVVBUS", "USB1_DRVVBUS", "output", /* PWM */ "GPMC_A2", "ehrpwm1A", "output", "GPMC_A3", "ehrpwm1B", "output", Modified: head/sys/boot/fdt/dts/beaglebone.dts ============================================================================== --- head/sys/boot/fdt/dts/beaglebone.dts Sun Jul 7 04:22:08 2013 (r252913) +++ head/sys/boot/fdt/dts/beaglebone.dts Sun Jul 7 04:23:29 2013 (r252914) @@ -74,6 +74,9 @@ "MMC0_DAT1", "mmc0_dat1", "input_pullup", "MMC0_DAT2", "mmc0_dat2", "input_pullup", "MMC0_DAT3", "mmc0_dat3", "input_pullup", + /* USB0 and USB1 */ + "USB0_DRVVBUS", "USB0_DRVVBUS", "output", + "USB1_DRVVBUS", "USB1_DRVVBUS", "output", /* GPIO */ "ECAP0_IN_PWM0_OUT", "gpio0_7", "input_pulldown", "GPMC_AD10", "gpio0_26", "input_pulldown", From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 04:24:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 911523EA; Sun, 7 Jul 2013 04:24:39 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 837BA105F; Sun, 7 Jul 2013 04:24:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r674Odi8038886; Sun, 7 Jul 2013 04:24:39 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r674Ocil038885; Sun, 7 Jul 2013 04:24:38 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201307070424.r674Ocil038885@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 7 Jul 2013 04:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252915 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 04:24:39 -0000 Author: gonzo Date: Sun Jul 7 04:24:38 2013 New Revision: 252915 URL: http://svnweb.freebsd.org/changeset/base/252915 Log: - Add USFS driver as an example of device mode for AM335x-based devices Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Sun Jul 7 04:23:29 2013 (r252914) +++ head/sys/arm/conf/BEAGLEBONE Sun Jul 7 04:24:38 2013 (r252915) @@ -123,6 +123,10 @@ device bpf device miibus device axe # ASIX Electronics USB Ethernet +# Device mode support and USFS template +device usb_template # Control of the gadget +device usfs + # Flattened Device Tree options FDT options FDT_DTB_STATIC From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 04:28:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 89B43531; Sun, 7 Jul 2013 04:28:38 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [88.198.91.248]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3A3106D; Sun, 7 Jul 2013 04:28:38 +0000 (UTC) Received: from [207.6.254.8] (helo=[192.168.1.65]) by id.bluezbox.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1UvgaR-000DFz-18; Sat, 06 Jul 2013 21:28:37 -0700 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r252912 - head/sys/dev/usb/controller From: Oleksandr Tymoshenko In-Reply-To: <201307070418.r674IZZg036437@svn.freebsd.org> Date: Sat, 6 Jul 2013 21:28:16 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <201307070418.r674IZZg036437@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.1503) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 2013-07-06, at 9:18 PM, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Sun Jul 7 04:18:35 2013 > New Revision: 252912 > URL: http://svnweb.freebsd.org/changeset/base/252912 > > Log: > - Add initial host mode support for Mentor Graphics USB OTG controller > - Sync musb_otg_atmelarm with new core logic API [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 04:28:38 -0000 On 2013-07-06, at 9:18 PM, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Sun Jul 7 04:18:35 2013 > New Revision: 252912 > URL: http://svnweb.freebsd.org/changeset/base/252912 > > Log: > - Add initial host mode support for Mentor Graphics USB OTG controller > - Sync musb_otg_atmelarm with new core logic API Reviewed by: hselasky@ From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 04:33:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 60119690 for ; Sun, 7 Jul 2013 04:33:36 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by mx1.freebsd.org (Postfix) with ESMTP id C42D11090 for ; Sun, 7 Jul 2013 04:33:35 +0000 (UTC) Received: by mail-lb0-f170.google.com with SMTP id t13so2956083lbd.15 for ; Sat, 06 Jul 2013 21:33:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=VnihBvgPTFvS29ISNS96JZyFsmyBpCBFbxU0Epyi4Ng=; b=oGmD/OoK8/zGlESFwuXfLrbzuftj3SUARMHwN2OlQUxbbmulppiIoZHLeQRaizbyFL Za68BcEq2HHlGbhed6fr6qe6wAtQTDxyQjEXZ2YtbU0W2SSvOgyejP+o4NYxA40e2hnZ YTZ6HDku3BHvPx0OwKzZPOazqJ47bx/XutxCXg3M0Pm6+iwjNGn+mxeqwINfeKhDawYT zsO09jb5GUHj9Isbx44PeCRZfLHmiIJmX4rfRixoGFfjsik5Qy/bT52juezOiuS+72RX +TvKVLCvjR4wG8HOfeQyN3CQ33LxBRp81V2BRQICaSnTA9m8kDG/IMd8ShmfYFwPRxg+ MW1g== X-Received: by 10.112.77.164 with SMTP id t4mr8217924lbw.52.1373171608533; Sat, 06 Jul 2013 21:33:28 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.113.231 with HTTP; Sat, 6 Jul 2013 21:33:08 -0700 (PDT) In-Reply-To: <201307070422.r674M9HM038537@svn.freebsd.org> References: <201307070422.r674M9HM038537@svn.freebsd.org> From: Juli Mallett Date: Sat, 6 Jul 2013 21:33:08 -0700 X-Google-Sender-Auth: --qx7yBPRUZhJ0s7ZKpZ2-dw98U Message-ID: Subject: Re: svn commit: r252913 - head/sys/arm/ti/am335x To: Oleksandr Tymoshenko Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnKEJWwQoGr5fjw06ANFdDK3KtGcFhwMET1GAEWaKgub4M3iUn4+1JlkWoxlR869ddjpL/x Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 04:33:36 -0000 Thanks for this and the other commits, Oleksandr! Much appreciated. Looking forward to giving it a spin on my BeagleBones Black! On Sat, Jul 6, 2013 at 9:22 PM, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Sun Jul 7 04:22:08 2013 > New Revision: 252913 > URL: http://svnweb.freebsd.org/changeset/base/252913 > > Log: > - Add USBSS driver for AM335x SoC. Driver is a wrapper around Mentors Graphic > USB OTG core. > > Added: > head/sys/arm/ti/am335x/am335x_usbss.c (contents, props changed) > Modified: > head/sys/arm/ti/am335x/files.am335x > > Added: head/sys/arm/ti/am335x/am335x_usbss.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/arm/ti/am335x/am335x_usbss.c Sun Jul 7 04:22:08 2013 (r252913) > @@ -0,0 +1,481 @@ > +/*- > + * Copyright (c) 2013 Oleksandr Tymoshenko > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#define USB_DEBUG_VAR usbssdebug > + > +#include > +#include > +#include > +#include > + > +#include > + > +#include > +#include > +#include > + > +#define AM335X_USB_PORTS 2 > + > +#define USBSS_REVREG 0x00 > +#define USBSS_SYSCONFIG 0x10 > +#define USBSS_SYSCONFIG_SRESET 1 > + > +#define USBCTRL_REV 0x00 > +#define USBCTRL_CTRL 0x14 > +#define USBCTRL_STAT 0x18 > +#define USBCTRL_IRQ_STAT0 0x30 > +#define IRQ_STAT0_RXSHIFT 16 > +#define IRQ_STAT0_TXSHIFT 0 > +#define USBCTRL_IRQ_STAT1 0x34 > +#define IRQ_STAT1_DRVVBUS (1 << 8) > +#define USBCTRL_INTEN_SET0 0x38 > +#define USBCTRL_INTEN_SET1 0x3C > +#define USBCTRL_INTEN_USB_ALL 0x1ff > +#define USBCTRL_INTEN_USB_SOF (1 << 3) > +#define USBCTRL_INTEN_CLR0 0x40 > +#define USBCTRL_INTEN_CLR1 0x44 > +#define USBCTRL_UTMI 0xE0 > +#define USBCTRL_UTMI_FSDATAEXT (1 << 1) > +#define USBCTRL_MODE 0xE8 > +#define USBCTRL_MODE_IDDIG (1 << 8) > +#define USBCTRL_MODE_IDDIGMUX (1 << 7) > + > +/* USBSS resource + 2 MUSB ports */ > + > +#define RES_USBSS 0 > +#define RES_USBCTRL(i) (3*i+1) > +#define RES_USBPHY(i) (3*i+2) > +#define RES_USBCORE(i) (3*i+3) > + > +#define USB_WRITE4(sc, idx, reg, val) do { \ > + bus_write_4((sc)->sc_mem_res[idx], (reg), (val)); \ > +} while (0) > + > +#define USB_READ4(sc, idx, reg) bus_read_4((sc)->sc_mem_res[idx], (reg)) > + > +#define USBSS_WRITE4(sc, reg, val) \ > + USB_WRITE4((sc), RES_USBSS, (reg), (val)) > +#define USBSS_READ4(sc, reg) \ > + USB_READ4((sc), RES_USBSS, (reg)) > +#define USBCTRL_WRITE4(sc, unit, reg, val) \ > + USB_WRITE4((sc), RES_USBCTRL(unit), (reg), (val)) > +#define USBCTRL_READ4(sc, unit, reg) \ > + USB_READ4((sc), RES_USBCTRL(unit), (reg)) > +#define USBPHY_WRITE4(sc, unit, reg, val) \ > + USB_WRITE4((sc), RES_USBPHY(unit), (reg), (val)) > +#define USBPHY_READ4(sc, unit, reg) \ > + USB_READ4((sc), RES_USBPHY(unit), (reg)) > + > +static struct resource_spec am335x_musbotg_mem_spec[] = { > + { SYS_RES_MEMORY, 0, RF_ACTIVE }, > + { SYS_RES_MEMORY, 1, RF_ACTIVE }, > + { SYS_RES_MEMORY, 2, RF_ACTIVE }, > + { SYS_RES_MEMORY, 3, RF_ACTIVE }, > + { SYS_RES_MEMORY, 4, RF_ACTIVE }, > + { SYS_RES_MEMORY, 5, RF_ACTIVE }, > + { SYS_RES_MEMORY, 6, RF_ACTIVE }, > + { -1, 0, 0 } > +}; > + > +static struct resource_spec am335x_musbotg_irq_spec[] = { > + { SYS_RES_IRQ, 0, RF_ACTIVE }, > + { SYS_RES_IRQ, 1, RF_ACTIVE }, > + { SYS_RES_IRQ, 2, RF_ACTIVE }, > + { -1, 0, 0 } > +}; > + > +#ifdef USB_DEBUG > +static int usbssdebug = 0; > + > +static SYSCTL_NODE(_hw_usb, OID_AUTO, am335x_usbss, CTLFLAG_RW, 0, "AM335x USBSS"); > +SYSCTL_INT(_hw_usb_am335x_usbss, OID_AUTO, debug, CTLFLAG_RW, > + &usbssdebug, 0, "Debug level"); > +#endif > + > +static device_probe_t musbotg_probe; > +static device_attach_t musbotg_attach; > +static device_detach_t musbotg_detach; > + > +struct musbotg_super_softc { > + struct musbotg_softc sc_otg[AM335X_USB_PORTS]; > + struct resource *sc_mem_res[AM335X_USB_PORTS*3+1]; > + struct resource *sc_irq_res[AM335X_USB_PORTS+1]; > + void *sc_intr_hdl; > +}; > + > +static void > +musbotg_vbus_poll(struct musbotg_super_softc *sc, int port) > +{ > + uint32_t stat; > + > + if (sc->sc_otg[port].sc_mode == MUSB2_DEVICE_MODE) > + musbotg_vbus_interrupt(&sc->sc_otg[port], 1); > + else { > + stat = USBCTRL_READ4(sc, port, USBCTRL_STAT); > + musbotg_vbus_interrupt(&sc->sc_otg[port], stat & 1); > + } > +} > + > +/* > + * Arg to musbotg_clocks_on and musbot_clocks_off is > + * a uint32_t * pointing to the SCM register offset. > + */ > +static uint32_t USB_CTRL[] = {SCM_USB_CTRL0, SCM_USB_CTRL1}; > + > +static void > +musbotg_clocks_on(void *arg) > +{ > + uint32_t c, reg = *(uint32_t *)arg; > + > + ti_scm_reg_read_4(reg, &c); > + c &= ~3; /* Enable power */ > + c |= 1 << 19; /* VBUS detect enable */ > + c |= 1 << 20; /* Session end enable */ > + ti_scm_reg_write_4(reg, c); > +} > + > +static void > +musbotg_clocks_off(void *arg) > +{ > + uint32_t c, reg = *(uint32_t *)arg; > + > + /* Disable power to PHY */ > + ti_scm_reg_read_4(reg, &c); > + ti_scm_reg_write_4(reg, c | 3); > +} > + > +static void > +musbotg_ep_int_set(struct musbotg_softc *sc, int ep, int on) > +{ > + struct musbotg_super_softc *ssc = sc->sc_platform_data; > + uint32_t epmask; > + > + epmask = ((1 << ep) << IRQ_STAT0_RXSHIFT); > + epmask |= ((1 << ep) << IRQ_STAT0_TXSHIFT); > + if (on) > + USBCTRL_WRITE4(ssc, sc->sc_id, > + USBCTRL_INTEN_SET0, epmask); > + else > + USBCTRL_WRITE4(ssc, sc->sc_id, > + USBCTRL_INTEN_CLR0, epmask); > +} > + > +static void > +musbotg_usbss_interrupt(void *arg) > +{ > + panic("USBSS real interrupt"); > +} > + > +static void > +musbotg_wrapper_interrupt(void *arg) > +{ > + struct musbotg_softc *sc = arg; > + struct musbotg_super_softc *ssc = sc->sc_platform_data; > + uint32_t stat, stat0, stat1; > + stat = USBCTRL_READ4(ssc, sc->sc_id, USBCTRL_STAT); > + stat0 = USBCTRL_READ4(ssc, sc->sc_id, USBCTRL_IRQ_STAT0); > + stat1 = USBCTRL_READ4(ssc, sc->sc_id, USBCTRL_IRQ_STAT1); > + if (stat0) > + USBCTRL_WRITE4(ssc, sc->sc_id, USBCTRL_IRQ_STAT0, stat0); > + if (stat1) > + USBCTRL_WRITE4(ssc, sc->sc_id, USBCTRL_IRQ_STAT1, stat1); > + > + DPRINTFN(4, "port%d: stat0=%08x stat1=%08x, stat=%08x\n", > + sc->sc_id, stat0, stat1, stat); > + > + if (stat1 & IRQ_STAT1_DRVVBUS) > + musbotg_vbus_interrupt(sc, stat & 1); > + > + musbotg_interrupt(arg, ((stat0 >> 16) & 0xffff), > + stat0 & 0xffff, stat1 & 0xff); > +} > + > +static int > +musbotg_probe(device_t dev) > +{ > + if (!ofw_bus_is_compatible(dev, "ti,musb-am33xx")) > + return (ENXIO); > + > + device_set_desc(dev, "TI AM33xx integrated USB OTG controller"); > + > + return (BUS_PROBE_DEFAULT); > +} > + > +static int > +musbotg_attach(device_t dev) > +{ > + struct musbotg_super_softc *sc = device_get_softc(dev); > + int err; > + int i; > + uint32_t rev, reg; > + > + /* Request the memory resources */ > + err = bus_alloc_resources(dev, am335x_musbotg_mem_spec, > + sc->sc_mem_res); > + if (err) { > + device_printf(dev, > + "Error: could not allocate mem resources\n"); > + return (ENXIO); > + } > + > + /* Request the IRQ resources */ > + err = bus_alloc_resources(dev, am335x_musbotg_irq_spec, > + sc->sc_irq_res); > + if (err) { > + device_printf(dev, > + "Error: could not allocate irq resources\n"); > + return (ENXIO); > + } > + > + /* > + * Reset USBSS, USB0 and USB1 > + */ > + rev = USBSS_READ4(sc, USBSS_REVREG); > + device_printf(dev, "TI AM335X USBSS v%d.%d.%d\n", > + (rev >> 8) & 7, (rev >> 6) & 3, rev & 63); > + > + ti_prcm_clk_enable(MUSB0_CLK); > + > + USBSS_WRITE4(sc, USBSS_SYSCONFIG, > + USBSS_SYSCONFIG_SRESET); > + while (USBSS_READ4(sc, USBSS_SYSCONFIG) & > + USBSS_SYSCONFIG_SRESET) > + ; > + > + err = bus_setup_intr(dev, sc->sc_irq_res[0], > + INTR_TYPE_BIO | INTR_MPSAFE, > + NULL, (driver_intr_t *)musbotg_usbss_interrupt, sc, > + &sc->sc_intr_hdl); > + > + if (err) { > + sc->sc_intr_hdl = NULL; > + device_printf(dev, "Failed to setup USBSS interrupt\n"); > + goto error; > + } > + > + for (i = 0; i < AM335X_USB_PORTS; i++) { > + /* setup MUSB OTG USB controller interface softc */ > + sc->sc_otg[i].sc_clocks_on = &musbotg_clocks_on; > + sc->sc_otg[i].sc_clocks_off = &musbotg_clocks_off; > + sc->sc_otg[i].sc_clocks_arg = &USB_CTRL[i]; > + > + sc->sc_otg[i].sc_ep_int_set = musbotg_ep_int_set; > + > + /* initialise some bus fields */ > + sc->sc_otg[i].sc_bus.parent = dev; > + sc->sc_otg[i].sc_bus.devices = sc->sc_otg[i].sc_devices; > + sc->sc_otg[i].sc_bus.devices_max = MUSB2_MAX_DEVICES; > + > + /* get all DMA memory */ > + if (usb_bus_mem_alloc_all(&sc->sc_otg[i].sc_bus, > + USB_GET_DMA_TAG(dev), NULL)) { > + device_printf(dev, > + "Failed allocate bus mem for musb%d\n", i); > + return (ENOMEM); > + } > + sc->sc_otg[i].sc_io_res = sc->sc_mem_res[RES_USBCORE(i)]; > + sc->sc_otg[i].sc_io_tag = > + rman_get_bustag(sc->sc_otg[i].sc_io_res); > + sc->sc_otg[i].sc_io_hdl = > + rman_get_bushandle(sc->sc_otg[i].sc_io_res); > + sc->sc_otg[i].sc_io_size = > + rman_get_size(sc->sc_otg[i].sc_io_res); > + > + sc->sc_otg[i].sc_irq_res = sc->sc_irq_res[i+1]; > + > + sc->sc_otg[i].sc_bus.bdev = device_add_child(dev, "usbus", -1); > + if (!(sc->sc_otg[i].sc_bus.bdev)) { > + device_printf(dev, "No busdev for musb%d\n", i); > + goto error; > + } > + device_set_ivars(sc->sc_otg[i].sc_bus.bdev, > + &sc->sc_otg[i].sc_bus); > + > + err = bus_setup_intr(dev, sc->sc_otg[i].sc_irq_res, > + INTR_TYPE_BIO | INTR_MPSAFE, > + NULL, (driver_intr_t *)musbotg_wrapper_interrupt, > + &sc->sc_otg[i], &sc->sc_otg[i].sc_intr_hdl); > + if (err) { > + sc->sc_otg[i].sc_intr_hdl = NULL; > + device_printf(dev, > + "Failed to setup interrupt for musb%d\n", i); > + goto error; > + } > + > + sc->sc_otg[i].sc_id = i; > + sc->sc_otg[i].sc_platform_data = sc; > + if (i == 0) > + sc->sc_otg[i].sc_mode = MUSB2_DEVICE_MODE; > + else > + sc->sc_otg[i].sc_mode = MUSB2_HOST_MODE; > + > + /* > + * software-controlled function > + */ > + > + if (sc->sc_otg[i].sc_mode == MUSB2_HOST_MODE) { > + reg = USBCTRL_READ4(sc, i, USBCTRL_MODE); > + reg |= USBCTRL_MODE_IDDIGMUX; > + reg &= ~USBCTRL_MODE_IDDIG; > + USBCTRL_WRITE4(sc, i, USBCTRL_MODE, reg); > + USBCTRL_WRITE4(sc, i, USBCTRL_UTMI, > + USBCTRL_UTMI_FSDATAEXT); > + } else { > + reg = USBCTRL_READ4(sc, i, USBCTRL_MODE); > + reg |= USBCTRL_MODE_IDDIGMUX; > + reg |= USBCTRL_MODE_IDDIG; > + USBCTRL_WRITE4(sc, i, USBCTRL_MODE, reg); > + } > + > + reg = USBCTRL_INTEN_USB_ALL & ~USBCTRL_INTEN_USB_SOF; > + USBCTRL_WRITE4(sc, i, USBCTRL_INTEN_SET1, reg); > + USBCTRL_WRITE4(sc, i, USBCTRL_INTEN_CLR0, 0xffffffff); > + > + err = musbotg_init(&sc->sc_otg[i]); > + if (!err) > + err = device_probe_and_attach(sc->sc_otg[i].sc_bus.bdev); > + > + if (err) > + goto error; > + > + /* poll VBUS one time */ > + musbotg_vbus_poll(sc, i); > + } > + > + return (0); > + > +error: > + musbotg_detach(dev); > + return (ENXIO); > +} > + > +static int > +musbotg_detach(device_t dev) > +{ > + struct musbotg_super_softc *sc = device_get_softc(dev); > + device_t bdev; > + int err; > + int i; > + > + for (i = 0; i < AM335X_USB_PORTS; i++) { > + if (sc->sc_otg[i].sc_bus.bdev) { > + bdev = sc->sc_otg[i].sc_bus.bdev; > + device_detach(bdev); > + device_delete_child(dev, bdev); > + } > + > + if (sc->sc_otg[i].sc_irq_res && sc->sc_otg[i].sc_intr_hdl) { > + /* > + * only call musbotg_uninit() after musbotg_init() > + */ > + musbotg_uninit(&sc->sc_otg[i]); > + > + err = bus_teardown_intr(dev, sc->sc_otg[i].sc_irq_res, > + sc->sc_otg[i].sc_intr_hdl); > + sc->sc_otg[i].sc_intr_hdl = NULL; > + } > + > + usb_bus_mem_free_all(&sc->sc_otg[i].sc_bus, NULL); > + } > + > + if (sc->sc_intr_hdl) { > + bus_teardown_intr(dev, sc->sc_irq_res[0], > + sc->sc_intr_hdl); > + sc->sc_intr_hdl = NULL; > + } > + > + > + /* Free resources if any */ > + if (sc->sc_mem_res[0]) > + bus_release_resources(dev, am335x_musbotg_mem_spec, > + sc->sc_mem_res); > + > + if (sc->sc_irq_res[0]) > + bus_release_resources(dev, am335x_musbotg_irq_spec, > + sc->sc_irq_res); > + > + /* during module unload there are lots of children leftover */ > + device_delete_children(dev); > + > + return (0); > +} > + > +static device_method_t musbotg_methods[] = { > + /* Device interface */ > + DEVMETHOD(device_probe, musbotg_probe), > + DEVMETHOD(device_attach, musbotg_attach), > + DEVMETHOD(device_detach, musbotg_detach), > + DEVMETHOD(device_suspend, bus_generic_suspend), > + DEVMETHOD(device_resume, bus_generic_resume), > + DEVMETHOD(device_shutdown, bus_generic_shutdown), > + > + DEVMETHOD_END > +}; > + > +static driver_t musbotg_driver = { > + .name = "musbotg", > + .methods = musbotg_methods, > + .size = sizeof(struct musbotg_super_softc), > +}; > + > +static devclass_t musbotg_devclass; > + > +DRIVER_MODULE(musbotg, simplebus, musbotg_driver, musbotg_devclass, 0, 0); > +MODULE_DEPEND(musbotg, usb, 1, 1, 1); > > Modified: head/sys/arm/ti/am335x/files.am335x > ============================================================================== > --- head/sys/arm/ti/am335x/files.am335x Sun Jul 7 04:18:35 2013 (r252912) > +++ head/sys/arm/ti/am335x/files.am335x Sun Jul 7 04:22:08 2013 (r252913) > @@ -7,6 +7,7 @@ arm/ti/am335x/am335x_scm_padconf.c stand > arm/ti/am335x/am335x_lcd.c optional sc > arm/ti/am335x/am335x_lcd_syscons.c optional sc > arm/ti/am335x/am335x_pwm.c standard > +arm/ti/am335x/am335x_usbss.c optional musb fdt > arm/ti/ti_edma3.c standard > arm/ti/ti_mmchs.c optional mmc > arm/ti/cpsw/if_cpsw.c optional cpsw From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 05:36:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1E302C63; Sun, 7 Jul 2013 05:36:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-gh0-x22f.google.com (mail-gh0-x22f.google.com [IPv6:2607:f8b0:4002:c05::22f]) by mx1.freebsd.org (Postfix) with ESMTP id 90CBE119A; Sun, 7 Jul 2013 05:36:13 +0000 (UTC) Received: by mail-gh0-f175.google.com with SMTP id z19so1264975ghb.6 for ; Sat, 06 Jul 2013 22:36:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=x/Waj2fly9J1WySxi//s8ybjYZPeWRIUjh4g2INBN/Y=; b=fXgDDpKH8PdtW7XeDZGiWXzYJN0EZ1savsUk2HS8hxtGpaA+e5CD3HDQiin+ce4Fs+ 10FgwWgsox5heQiNEDQ3bLtvLCP1PFL2map8rpJmU0CFMOOf0ffCnJ5tVMPTWsUPYc3Z 5fo2j/23yceCvf7c+C1KmzNWQ1RSI4Fjv/YeitTtXrCjRd3l2QaOvpm9zotkzE8jPIP8 EBj41Eac0cthbmhxSDJLMXfS1cvqcyyxRuvrRniORtv1k4YgobRDsSQ0hcCPWphZrHPg Q6YtKOrEKm0n1Juq/fK7xONkOibEG9vdh3U2zYyySn5e05Aku3V21DMpEnmX0vC78wYD xHXw== X-Received: by 10.236.31.202 with SMTP id m50mr9340824yha.19.1373175372704; Sat, 06 Jul 2013 22:36:12 -0700 (PDT) Received: from [10.77.122.209] (mobile-166-147-108-080.mycingular.net. [166.147.108.80]) by mx.google.com with ESMTPSA id e69sm26783412yhl.3.2013.07.06.22.36.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 06 Jul 2013 22:36:12 -0700 (PDT) References: <201307040026.r640QOCd079203@svn.freebsd.org> <20130704105843.B982@besplex.bde.org> <20130706184249.GD25842@garage.freebsd.pl> <20130706195108.GA34684@stack.nl> <20130707114237.L897@besplex.bde.org> Mime-Version: 1.0 (1.0) In-Reply-To: <20130707114237.L897@besplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <9C9CE501-055E-44A6-82BD-FFB44A04B30F@gmail.com> X-Mailer: iPhone Mail (10B329) From: Garrett Cooper Subject: Re: svn commit: r252672 - head/sbin/nvmecontrol Date: Sat, 6 Jul 2013 22:36:04 -0700 To: Bruce Evans Cc: Jim Harris , "src-committers@FreeBSD.org" , Pawel Jakub Dawidek , Jilles Tjoelker , "svn-src-all@FreeBSD.org" , Bruce Evans , "svn-src-head@FreeBSD.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 05:36:14 -0000 One minor interjection and I'll butt out of the discussion... Sent from my iPhone On Jul 6, 2013, at 7:26 PM, Bruce Evans wrote: > On Sat, 6 Jul 2013, Jilles Tjoelker wrote: >=20 >> On Sat, Jul 06, 2013 at 08:42:49PM +0200, Pawel Jakub Dawidek wrote: >>> On Thu, Jul 04, 2013 at 11:44:28AM +1000, Bruce Evans wrote: >>>> Many style bugs are visible in this patch: >>> [...] >>>> - sysexits.h is used >>> [...] >>=20 >>> Bruce, until sysexits(3) doesn't explicitly say it shouldn't be used, >>> please stop calling this a bug, because you are just confusing people. >>> At this point sysexits(3) actually even suggests it is blessed by >>> style(9). This is how it starts: >>=20 >>> According to style(9), it is not a good practice to call exit(3) >>> with arbitrary values to indicate a failure condition when >>> ending a program. Instead, the pre-defined exit codes from >>> sysexits should be used, so the caller of the process can get a >>> rough estimation about the failure class without looking up the >>> source code. >=20 > This is just another bug in sysexits(3). This is not according to > style(9), since style(9) was fixed to not say that after I complained > previously :-). It has never been normal practice to use sysexits(3), > but someone who likes it added recommendations to use it to style(9) when t= hey added the man pages for sysexits(3). Before that, it was > so rarely used that it had no man page. >=20 >>> In my personal opinion it doesn't hurt to use sysexits(3) - if you don't= >>> want to interpret exit status then treat every value !=3D 0 as an error.= >>> In HAST (IIRC) I do interpret exit status - if I get EX_TEMPFAIL, I know= >>> I can try to restart the process, if I get something else I don't >>> restart it, as I risk an infinite loop. >=20 > That's fine for suites of programs that agree on exit codes. You can't > depend on this for anything else. >=20 >>> Apart from my personal opinion, if you want to call it a bug and not >>> confuse people, then start discussion and change the manual page to >>> recommend avoiding sysexits(3). As of now we are just sending mixed >>> signals and create confusion. >>=20 >> This is indeed confusing, because style(9) itself does not recommend >> sysexits at all. This was changed in 2008 but sysexits(3) was not >> adjusted along with that. >>=20 >> The text in style(9) that only allows 0 or 1 is not universally valid >> either. Firstly, in some application areas like mail delivery, it is >> conventional and documented to use and interpret sysexits codes. (So if >> HAST uses sysexits, it should document that fact.) Secondly, some other >> utilities such as test, cmp and diff use 0 for a "true" condition, 1 for >> a "false" condition and greater than 1 (usually 2) for failures. >=20 > 0 and 1 are all that are universally valid. Programs shouldn't generate > more than these unless they have special requirements/protocols. But > nonzero meaning "failed" should be accepted by all POSIX programs. >=20 > This is even more implementation-defined than I remembered in plain C > programs. In C99, EXIT_SUCCESS (0) is mapped to success in some > implementation-defined way; EXIT_FAILURE (1) is mapped to failure > in some implementation-defined way; for all other exit() args, the > whole mapping is implementation-defined, so 2 and everything in > sysexits.h may be mapped to success. Therefore, portable C programs > must not use anythying except 0 or 1 (preferably spelled using the > C99 macros). Not using sysexits.h also keeps the sources portable. > sysexits.h is in neither C99 nor POSIX. >=20 > style(9) isn't the place to give portability lessons like the above. > I think we discussed using EXIT_SUCCESS and EXIT_FAILURE when we changed > it to not mention sysexits, but for some reason it hard code 0 and 1. >=20 > The original style rule against using cryptic error codes hasn't been > restored. =46rom the 4.4BSD style guide: >=20 > % /* > % * Exits should be 0 on success, and 1 on failure. Don't denote > % * all the possible exit points, using the integers 1 through 300. > % */ > % exit(0); /* Avoid obvious comments such as "Exit 0 on success." */= >=20 > (Here 300 is off by 45. Exit statuses less than 0 and greater than 255 > give implementation-defined behaviour that is worse than usual.) I think > this rule is to limit cryptic undocumented exit codes. I don't like > sysexits because it gives cryptic documented exit codes instead. All > that can be safeley done (except in prgram suites) is map all nonzero > exit codes to "failed" (or killed by a signal). >=20 > In another thread involving Pawel, phk campaigns against errno and asks > for error strings (even if they are only in English). Using perror() > did this long ago for program termination, and using the err() family > does it better. Except possibly for program suites -- translating a > single numeric error is easier for programs than translating an > unstructured string. I actually prefer using binary representations > for programs. Your argument would be valid if computers were parsing output and putting it= in more meaningful forms, but it's invalid when humans need to understand w= hy things fail. Many devs who consume FreeBSD don't understand the concept o= f man 5 errno, and if they don't, I doubt end-users of FreeBSD (and its deri= vatives) will. Thanks.= From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 07:02:02 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 37EAD986; Sun, 7 Jul 2013 07:02:02 +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 C0C921341; Sun, 7 Jul 2013 07:02:00 +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 KAA18529; Sun, 07 Jul 2013 10:01:58 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Uviys-00033N-Ei; Sun, 07 Jul 2013 10:01:58 +0300 Message-ID: <51D9122F.3050405@FreeBSD.org> Date: Sun, 07 Jul 2013 10:01:03 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130405 Thunderbird/17.0.5 MIME-Version: 1.0 To: Jeff Roberson Subject: Re: svn commit: r252226 - head/sys/vm References: <201306260057.r5Q0vcG8021089@svn.freebsd.org> In-Reply-To: <201306260057.r5Q0vcG8021089@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 07:02:02 -0000 on 26/06/2013 03:57 Jeff Roberson said the following: > + { NULL, "4 Bucket", BUCKET_SIZE(4), 4096 }, Looks like BUCKET_SIZE(4) is zero, if I am not mistaken. Is this OK / intended? -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 07:06:21 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A048DAD3; Sun, 7 Jul 2013 07:06:21 +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 35F341354; Sun, 7 Jul 2013 07:06:19 +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 KAA18563; Sun, 07 Jul 2013 10:06:18 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Uvj34-00033s-8e; Sun, 07 Jul 2013 10:06:18 +0300 Message-ID: <51D91334.8060402@FreeBSD.org> Date: Sun, 07 Jul 2013 10:05:24 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130405 Thunderbird/17.0.5 MIME-Version: 1.0 To: Jeff Roberson Subject: Re: svn commit: r251826 - head/sys/vm References: <201306170343.r5H3hmtq006361@svn.freebsd.org> In-Reply-To: <201306170343.r5H3hmtq006361@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 07:06:21 -0000 on 17/06/2013 06:43 Jeff Roberson said the following: > + void *uz_arg; /* Import/release argument. */ Would it make sense to use a more descriptive/distinct name for this member? The one that would signify its relation to import/release as opposed to being some other kind of argument. Unfortunately I can not come up with anything descriptive and short at the moments. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 08:30:19 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 886FD36B; Sun, 7 Jul 2013 08:30:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id EFB051A88; Sun, 7 Jul 2013 08:30:18 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id C978D1042308; Sun, 7 Jul 2013 18:30:15 +1000 (EST) Date: Sun, 7 Jul 2013 18:30:15 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper Subject: Re: svn commit: r252672 - head/sbin/nvmecontrol In-Reply-To: <9C9CE501-055E-44A6-82BD-FFB44A04B30F@gmail.com> Message-ID: <20130707181851.E4398@besplex.bde.org> References: <201307040026.r640QOCd079203@svn.freebsd.org> <20130704105843.B982@besplex.bde.org> <20130706184249.GD25842@garage.freebsd.pl> <20130706195108.GA34684@stack.nl> <20130707114237.L897@besplex.bde.org> <9C9CE501-055E-44A6-82BD-FFB44A04B30F@gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=K8x6hFqI c=1 sm=1 a=RvpeemXtX5oA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=X2rCv88ZkwkA:10 a=qlV08caaGxAhSlL7ab0A:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: Jim Harris , "src-committers@FreeBSD.org" , Pawel Jakub Dawidek , Jilles Tjoelker , "svn-src-all@FreeBSD.org" , Bruce Evans , "svn-src-head@FreeBSD.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 08:30:19 -0000 > One minor interjection and I'll butt out of the discussion... >> .... >> In another thread involving Pawel, phk campaigns against errno and asks >> for error strings (even if they are only in English). Using perror() >> did this long ago for program termination, and using the err() family >> does it better. Except possibly for program suites -- translating a >> single numeric error is easier for programs than translating an >> unstructured string. I actually prefer using binary representations >> for programs. > > Your argument would be valid if computers were parsing output and putting it in more meaningful forms, but it's invalid when humans need to understand why things fail. Many devs who consume FreeBSD don't understand the concept of man 5 errno, and if they don't, I doubt end-users of FreeBSD (and its derivatives) will. That was more than half of my argument. perror() and err() give messages that are readable by humans. Extra info in exit statuses adds less than nothing for most humans. Some programs can parse it, but most can't. Sysexits is thus useless for almost everything. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 09:21:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6BA1DD49; Sun, 7 Jul 2013 09:21:40 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E3E11C12; Sun, 7 Jul 2013 09:21:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r679Leji025574; Sun, 7 Jul 2013 09:21:40 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r679LeKM025573; Sun, 7 Jul 2013 09:21:40 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201307070921.r679LeKM025573@svn.freebsd.org> From: Martin Matuska Date: Sun, 7 Jul 2013 09:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252920 - stable/9/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 09:21:40 -0000 Author: mm Date: Sun Jul 7 09:21:39 2013 New Revision: 252920 URL: http://svnweb.freebsd.org/changeset/base/252920 Log: MFC r252732: Fix misleading or remove irrelevant illumos messages and manpage references in the zfs command. PR: bin/178996 Submitted by: Peter Schaefer Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/zfs/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Jul 7 07:06:15 2013 (r252919) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Jul 7 09:21:39 2013 (r252920) @@ -5590,8 +5590,8 @@ share_mount_one(zfs_handle_t *zhp, int o (void) fprintf(stderr, gettext("cannot share '%s': " "legacy share\n"), zfs_get_name(zhp)); - (void) fprintf(stderr, gettext("use share(1M) to " - "share this filesystem, or set " + (void) fprintf(stderr, gettext("to " + "share this filesystem set " "sharenfs property on\n")); return (1); } @@ -5607,7 +5607,7 @@ share_mount_one(zfs_handle_t *zhp, int o (void) fprintf(stderr, gettext("cannot %s '%s': " "legacy mountpoint\n"), cmdname, zfs_get_name(zhp)); - (void) fprintf(stderr, gettext("use %s(1M) to " + (void) fprintf(stderr, gettext("use %s(8) to " "%s this filesystem\n"), cmdname, cmdname); return (1); } @@ -6045,8 +6045,10 @@ unshare_unmount_path(int op, char *path, strcmp(smbshare_prop, "off") == 0) { (void) fprintf(stderr, gettext("cannot unshare " "'%s': legacy share\n"), path); +#ifdef illumos (void) fprintf(stderr, gettext("use " "unshare(1M) to unshare this filesystem\n")); +#endif } else if (!zfs_is_shared(zhp)) { (void) fprintf(stderr, gettext("cannot unshare '%s': " "not currently shared\n"), path); @@ -6065,7 +6067,7 @@ unshare_unmount_path(int op, char *path, (void) fprintf(stderr, gettext("cannot unmount " "'%s': legacy mountpoint\n"), zfs_get_name(zhp)); - (void) fprintf(stderr, gettext("use umount(1M) " + (void) fprintf(stderr, gettext("use umount(8) " "to unmount this filesystem\n")); } else { ret = zfs_unmountall(zhp, flags); @@ -6287,9 +6289,11 @@ unshare_unmount(int op, int argc, char * (void) fprintf(stderr, gettext("cannot " "unshare '%s': legacy share\n"), zfs_get_name(zhp)); +#ifdef illumos (void) fprintf(stderr, gettext("use " "unshare(1M) to unshare this " "filesystem\n")); +#endif ret = 1; } else if (!zfs_is_shared(zhp)) { (void) fprintf(stderr, gettext("cannot " @@ -6307,7 +6311,7 @@ unshare_unmount(int op, int argc, char * "unmount '%s': legacy " "mountpoint\n"), zfs_get_name(zhp)); (void) fprintf(stderr, gettext("use " - "umount(1M) to unmount this " + "umount(8) to unmount this " "filesystem\n")); ret = 1; } else if (!zfs_is_mounted(zhp, NULL)) { @@ -6493,12 +6497,12 @@ manual_mount(int argc, char **argv) } } else { (void) fprintf(stderr, gettext("filesystem '%s' cannot be " - "mounted using 'mount -F zfs'\n"), dataset); + "mounted using 'mount -t zfs'\n"), dataset); (void) fprintf(stderr, gettext("Use 'zfs set mountpoint=%s' " "instead.\n"), path); - (void) fprintf(stderr, gettext("If you must use 'mount -F zfs' " - "or /etc/vfstab, use 'zfs set mountpoint=legacy'.\n")); - (void) fprintf(stderr, gettext("See zfs(1M) for more " + (void) fprintf(stderr, gettext("If you must use 'mount -t zfs' " + "or /etc/fstab, use 'zfs set mountpoint=legacy'.\n")); + (void) fprintf(stderr, gettext("See zfs(8) for more " "information.\n")); ret = 1; } From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 09:22:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8DFA9E9E; Sun, 7 Jul 2013 09:22:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8090A1C1A; Sun, 7 Jul 2013 09:22:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r679M4Ab025738; Sun, 7 Jul 2013 09:22:04 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r679M4st025737; Sun, 7 Jul 2013 09:22:04 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201307070922.r679M4st025737@svn.freebsd.org> From: Martin Matuska Date: Sun, 7 Jul 2013 09:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252921 - stable/8/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 09:22:04 -0000 Author: mm Date: Sun Jul 7 09:22:03 2013 New Revision: 252921 URL: http://svnweb.freebsd.org/changeset/base/252921 Log: MFC r252732: Fix misleading or remove irrelevant illumos messages and manpage references in the zfs command. PR: bin/178996 Submitted by: Peter Schaefer Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Jul 7 09:21:39 2013 (r252920) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Jul 7 09:22:03 2013 (r252921) @@ -5590,8 +5590,8 @@ share_mount_one(zfs_handle_t *zhp, int o (void) fprintf(stderr, gettext("cannot share '%s': " "legacy share\n"), zfs_get_name(zhp)); - (void) fprintf(stderr, gettext("use share(1M) to " - "share this filesystem, or set " + (void) fprintf(stderr, gettext("to " + "share this filesystem set " "sharenfs property on\n")); return (1); } @@ -5607,7 +5607,7 @@ share_mount_one(zfs_handle_t *zhp, int o (void) fprintf(stderr, gettext("cannot %s '%s': " "legacy mountpoint\n"), cmdname, zfs_get_name(zhp)); - (void) fprintf(stderr, gettext("use %s(1M) to " + (void) fprintf(stderr, gettext("use %s(8) to " "%s this filesystem\n"), cmdname, cmdname); return (1); } @@ -6045,8 +6045,10 @@ unshare_unmount_path(int op, char *path, strcmp(smbshare_prop, "off") == 0) { (void) fprintf(stderr, gettext("cannot unshare " "'%s': legacy share\n"), path); +#ifdef illumos (void) fprintf(stderr, gettext("use " "unshare(1M) to unshare this filesystem\n")); +#endif } else if (!zfs_is_shared(zhp)) { (void) fprintf(stderr, gettext("cannot unshare '%s': " "not currently shared\n"), path); @@ -6065,7 +6067,7 @@ unshare_unmount_path(int op, char *path, (void) fprintf(stderr, gettext("cannot unmount " "'%s': legacy mountpoint\n"), zfs_get_name(zhp)); - (void) fprintf(stderr, gettext("use umount(1M) " + (void) fprintf(stderr, gettext("use umount(8) " "to unmount this filesystem\n")); } else { ret = zfs_unmountall(zhp, flags); @@ -6287,9 +6289,11 @@ unshare_unmount(int op, int argc, char * (void) fprintf(stderr, gettext("cannot " "unshare '%s': legacy share\n"), zfs_get_name(zhp)); +#ifdef illumos (void) fprintf(stderr, gettext("use " "unshare(1M) to unshare this " "filesystem\n")); +#endif ret = 1; } else if (!zfs_is_shared(zhp)) { (void) fprintf(stderr, gettext("cannot " @@ -6307,7 +6311,7 @@ unshare_unmount(int op, int argc, char * "unmount '%s': legacy " "mountpoint\n"), zfs_get_name(zhp)); (void) fprintf(stderr, gettext("use " - "umount(1M) to unmount this " + "umount(8) to unmount this " "filesystem\n")); ret = 1; } else if (!zfs_is_mounted(zhp, NULL)) { @@ -6493,12 +6497,12 @@ manual_mount(int argc, char **argv) } } else { (void) fprintf(stderr, gettext("filesystem '%s' cannot be " - "mounted using 'mount -F zfs'\n"), dataset); + "mounted using 'mount -t zfs'\n"), dataset); (void) fprintf(stderr, gettext("Use 'zfs set mountpoint=%s' " "instead.\n"), path); - (void) fprintf(stderr, gettext("If you must use 'mount -F zfs' " - "or /etc/vfstab, use 'zfs set mountpoint=legacy'.\n")); - (void) fprintf(stderr, gettext("See zfs(1M) for more " + (void) fprintf(stderr, gettext("If you must use 'mount -t zfs' " + "or /etc/fstab, use 'zfs set mountpoint=legacy'.\n")); + (void) fprintf(stderr, gettext("See zfs(8) for more " "information.\n")); ret = 1; } From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:10:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AF62A259; Sun, 7 Jul 2013 11:10:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A08CC1FFD; Sun, 7 Jul 2013 11:10:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67BAGkU056252; Sun, 7 Jul 2013 11:10:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67BAGxS056251; Sun, 7 Jul 2013 11:10:16 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071110.r67BAGxS056251@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 11:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252922 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:10:16 -0000 Author: tuexen Date: Sun Jul 7 11:10:15 2013 New Revision: 252922 URL: http://svnweb.freebsd.org/changeset/base/252922 Log: MFC r238122: Use consistent method to determine IPV4_OUTPUT/IPV6_OUTPUT. Modified: stable/9/sys/netinet/sctp_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 09:22:03 2013 (r252921) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 11:10:15 2013 (r252922) @@ -10981,8 +10981,9 @@ sctp_send_resp_msg(struct sockaddr *src, return; } SCTP_ATTACH_CHAIN(o_pak, mout, len); + switch (dst->sa_family) { #ifdef INET - if (ip != NULL) { + case AF_INET: if (port) { if (V_udp_cksum) { udp->uh_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, udp->uh_ulen + htons(IPPROTO_UDP)); @@ -11016,10 +11017,10 @@ sctp_send_resp_msg(struct sockaddr *src, } #endif SCTP_IP_OUTPUT(ret, o_pak, NULL, NULL, vrf_id); - } + break; #endif #ifdef INET6 - if (ip6 != NULL) { + case AF_INET6: ip6->ip6_plen = len - sizeof(struct ip6_hdr); if (port) { #if defined(SCTP_WITH_NO_CSUM) @@ -11046,8 +11047,15 @@ sctp_send_resp_msg(struct sockaddr *src, } #endif SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id); - } + break; #endif + default: + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Unknown protocol (TSNH) type %d\n", + dst->sa_family); + sctp_m_freem(mout); + SCTP_LTRACE_ERR_RET_PKT(mout, NULL, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EFAULT); + return; + } SCTP_STAT_INCR(sctps_sendpackets); SCTP_STAT_INCR_COUNTER64(sctps_outpackets); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:15:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3722E3D1; Sun, 7 Jul 2013 11:15:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 297001020; Sun, 7 Jul 2013 11:15:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67BFt74058710; Sun, 7 Jul 2013 11:15:55 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67BFtC8058709; Sun, 7 Jul 2013 11:15:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071115.r67BFtC8058709@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 11:15:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252923 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:15:55 -0000 Author: tuexen Date: Sun Jul 7 11:15:54 2013 New Revision: 252923 URL: http://svnweb.freebsd.org/changeset/base/252923 Log: MFC r238455: Use case for selecting the address family (as in other places). Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 11:10:15 2013 (r252922) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 11:15:54 2013 (r252923) @@ -1203,11 +1203,18 @@ sctp_findassociation_ep_addr(struct sctp uint16_t rport; inp = *inp_p; - if (remote->sa_family == AF_INET) { + switch (remote->sa_family) { +#ifdef INET + case AF_INET: rport = (((struct sockaddr_in *)remote)->sin_port); - } else if (remote->sa_family == AF_INET6) { + break; +#endif +#ifdef INET6 + case AF_INET6: rport = (((struct sockaddr_in6 *)remote)->sin6_port); - } else { + break; +#endif + default: return (NULL); } if (locked_tcb) { From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:20:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8BF3C512; Sun, 7 Jul 2013 11:20:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 64C271033; Sun, 7 Jul 2013 11:20:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67BKDGH059279; Sun, 7 Jul 2013 11:20:13 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67BKDQC059278; Sun, 7 Jul 2013 11:20:13 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071120.r67BKDQC059278@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 11:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252924 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:20:13 -0000 Author: tuexen Date: Sun Jul 7 11:20:12 2013 New Revision: 252924 URL: http://svnweb.freebsd.org/changeset/base/252924 Log: MFC r239035: Testing an interface property should depend on the interface, not on an address. Modified: stable/9/sys/netinet/sctp_bsd_addr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/9/sys/netinet/sctp_bsd_addr.c Sun Jul 7 11:15:54 2013 (r252923) +++ stable/9/sys/netinet/sctp_bsd_addr.c Sun Jul 7 11:20:12 2013 (r252924) @@ -152,12 +152,12 @@ sctp_gather_internal_ifa_flags(struct sc static uint32_t -sctp_is_desired_interface_type(struct ifaddr *ifa) +sctp_is_desired_interface_type(struct ifnet *ifn) { int result; /* check the interface type to see if it's one we care about */ - switch (ifa->ifa_ifp->if_type) { + switch (ifn->if_type) { case IFT_ETHER: case IFT_ISO88023: case IFT_ISO88024: @@ -216,6 +216,10 @@ sctp_init_ifns_for_vrf(int vrfid) IFNET_RLOCK(); TAILQ_FOREACH(ifn, &MODULE_GLOBAL(ifnet), if_list) { + if (sctp_is_desired_interface_type(ifn) == 0) { + /* non desired type */ + continue; + } IF_ADDR_RLOCK(ifn); TAILQ_FOREACH(ifa, &ifn->if_addrlist, ifa_list) { if (ifa->ifa_addr == NULL) { @@ -240,10 +244,6 @@ sctp_init_ifns_for_vrf(int vrfid) default: continue; } - if (sctp_is_desired_interface_type(ifa) == 0) { - /* non desired type */ - continue; - } switch (ifa->ifa_addr->sa_family) { #ifdef INET case AF_INET: @@ -317,6 +317,10 @@ sctp_addr_change(struct ifaddr *ifa, int if (ifa->ifa_addr == NULL) { return; } + if (sctp_is_desired_interface_type(ifa->ifa_ifp) == 0) { + /* non desired type */ + return; + } switch (ifa->ifa_addr->sa_family) { #ifdef INET case AF_INET: @@ -338,22 +342,16 @@ sctp_addr_change(struct ifaddr *ifa, int /* non inet/inet6 skip */ return; } - - if (sctp_is_desired_interface_type(ifa) == 0) { - /* non desired type */ - return; - } if (cmd == RTM_ADD) { (void)sctp_add_addr_to_vrf(SCTP_DEFAULT_VRFID, (void *)ifa->ifa_ifp, - ifa->ifa_ifp->if_index, ifa->ifa_ifp->if_type, - ifa->ifa_ifp->if_xname, + ifa->ifa_ifp->if_index, ifa->ifa_ifp->if_type, ifa->ifa_ifp->if_xname, (void *)ifa, ifa->ifa_addr, ifa_flags, 1); } else { sctp_del_addr_from_vrf(SCTP_DEFAULT_VRFID, ifa->ifa_addr, ifa->ifa_ifp->if_index, - ifa->ifa_ifp->if_xname - ); + ifa->ifa_ifp->if_xname); + /* * We don't bump refcount here so when it completes the * final delete will happen. From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:26:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4C6D870E; Sun, 7 Jul 2013 11:26:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3DD971059; Sun, 7 Jul 2013 11:26:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67BQGoR061614; Sun, 7 Jul 2013 11:26:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67BQGhk061613; Sun, 7 Jul 2013 11:26:16 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071126.r67BQGhk061613@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 11:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252925 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:26:16 -0000 Author: tuexen Date: Sun Jul 7 11:26:15 2013 New Revision: 252925 URL: http://svnweb.freebsd.org/changeset/base/252925 Log: MFC r240114: Whitespace change. Modified: stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Jul 7 11:20:12 2013 (r252924) +++ stable/9/sys/netinet/sctputil.c Sun Jul 7 11:26:15 2013 (r252925) @@ -2385,7 +2385,7 @@ sctp_calculate_rto(struct sctp_tcb *stcb timevalsub(&now, old); /* store the current RTT in us */ net->rtt = (uint64_t) 1000000 *(uint64_t) now.tv_sec + - (uint64_t) now.tv_usec; + (uint64_t) now.tv_usec; /* computer rtt in ms */ rtt = net->rtt / 1000; From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:28:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 75E9184F; Sun, 7 Jul 2013 11:28:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 577E0106C; Sun, 7 Jul 2013 11:28:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67BSj3w061916; Sun, 7 Jul 2013 11:28:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67BSjWx061915; Sun, 7 Jul 2013 11:28:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071128.r67BSjWx061915@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 11:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252926 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:28:45 -0000 Author: tuexen Date: Sun Jul 7 11:28:44 2013 New Revision: 252926 URL: http://svnweb.freebsd.org/changeset/base/252926 Log: MFC r240115: Use the consistenly the size of a variable. This helps to keep the code simpler for the userland implementation. Modified: stable/9/sys/netinet/sctp_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 11:26:15 2013 (r252925) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 11:28:44 2013 (r252926) @@ -3371,7 +3371,7 @@ sctp_find_cmsg(int c_type, void *data, s return (found); } m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); - if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(cmh))) { /* We dont't have a complete CMSG header. */ return (found); } @@ -3386,11 +3386,11 @@ sctp_find_cmsg(int c_type, void *data, s (cmh.cmsg_type == SCTP_PRINFO) || (cmh.cmsg_type == SCTP_AUTHINFO))))) { if (c_type == cmh.cmsg_type) { - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < cpsize) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < cpsize) { return (found); } /* It is exactly what we want. Copy it out. */ - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), cpsize, (caddr_t)data); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), cpsize, (caddr_t)data); return (1); } else { struct sctp_sndrcvinfo *sndrcvinfo; @@ -3404,10 +3404,10 @@ sctp_find_cmsg(int c_type, void *data, s } switch (cmh.cmsg_type) { case SCTP_SNDINFO: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_sndinfo)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_sndinfo)) { return (found); } - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_sndinfo), (caddr_t)&sndinfo); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_sndinfo), (caddr_t)&sndinfo); sndrcvinfo->sinfo_stream = sndinfo.snd_sid; sndrcvinfo->sinfo_flags = sndinfo.snd_flags; sndrcvinfo->sinfo_ppid = sndinfo.snd_ppid; @@ -3415,18 +3415,18 @@ sctp_find_cmsg(int c_type, void *data, s sndrcvinfo->sinfo_assoc_id = sndinfo.snd_assoc_id; break; case SCTP_PRINFO: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_prinfo)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_prinfo)) { return (found); } - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_prinfo), (caddr_t)&prinfo); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_prinfo), (caddr_t)&prinfo); sndrcvinfo->sinfo_timetolive = prinfo.pr_value; sndrcvinfo->sinfo_flags |= prinfo.pr_policy; break; case SCTP_AUTHINFO: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_authinfo)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_authinfo)) { return (found); } - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_authinfo), (caddr_t)&authinfo); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_authinfo), (caddr_t)&authinfo); sndrcvinfo->sinfo_keynumber_valid = 1; sndrcvinfo->sinfo_keynumber = authinfo.auth_keynumber; break; @@ -3466,7 +3466,7 @@ sctp_process_cmsgs_for_init(struct sctp_ return (1); } m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); - if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(cmh))) { /* We dont't have a complete CMSG header. */ *error = EINVAL; return (1); @@ -3479,11 +3479,11 @@ sctp_process_cmsgs_for_init(struct sctp_ if (cmh.cmsg_level == IPPROTO_SCTP) { switch (cmh.cmsg_type) { case SCTP_INIT: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct sctp_initmsg)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct sctp_initmsg)) { *error = EINVAL; return (1); } - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct sctp_initmsg), (caddr_t)&initmsg); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct sctp_initmsg), (caddr_t)&initmsg); if (initmsg.sinit_max_attempts) stcb->asoc.max_init_times = initmsg.sinit_max_attempts; if (initmsg.sinit_num_ostreams) @@ -3523,7 +3523,7 @@ sctp_process_cmsgs_for_init(struct sctp_ break; #ifdef INET case SCTP_DSTADDRV4: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in_addr)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct in_addr)) { *error = EINVAL; return (1); } @@ -3531,7 +3531,7 @@ sctp_process_cmsgs_for_init(struct sctp_ sin.sin_family = AF_INET; sin.sin_len = sizeof(struct sockaddr_in); sin.sin_port = stcb->rport; - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); if ((sin.sin_addr.s_addr == INADDR_ANY) || (sin.sin_addr.s_addr == INADDR_BROADCAST) || IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { @@ -3547,7 +3547,7 @@ sctp_process_cmsgs_for_init(struct sctp_ #endif #ifdef INET6 case SCTP_DSTADDRV6: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in6_addr)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct in6_addr)) { *error = EINVAL; return (1); } @@ -3555,7 +3555,7 @@ sctp_process_cmsgs_for_init(struct sctp_ sin6.sin6_family = AF_INET6; sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_port = stcb->rport; - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); if (IN6_IS_ADDR_UNSPECIFIED(&sin6.sin6_addr) || IN6_IS_ADDR_MULTICAST(&sin6.sin6_addr)) { *error = EINVAL; @@ -3623,7 +3623,7 @@ sctp_findassociation_cmsgs(struct sctp_i return (NULL); } m_copydata(control, at, sizeof(cmh), (caddr_t)&cmh); - if (cmh.cmsg_len < CMSG_ALIGN(sizeof(struct cmsghdr))) { + if (cmh.cmsg_len < CMSG_ALIGN(sizeof(cmh))) { /* We dont't have a complete CMSG header. */ *error = EINVAL; return (NULL); @@ -3637,7 +3637,7 @@ sctp_findassociation_cmsgs(struct sctp_i switch (cmh.cmsg_type) { #ifdef INET case SCTP_DSTADDRV4: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in_addr)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct in_addr)) { *error = EINVAL; return (NULL); } @@ -3645,13 +3645,13 @@ sctp_findassociation_cmsgs(struct sctp_i sin.sin_family = AF_INET; sin.sin_len = sizeof(struct sockaddr_in); sin.sin_port = port; - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct in_addr), (caddr_t)&sin.sin_addr); addr = (struct sockaddr *)&sin; break; #endif #ifdef INET6 case SCTP_DSTADDRV6: - if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr))) < sizeof(struct in6_addr)) { + if ((size_t)(cmh.cmsg_len - CMSG_ALIGN(sizeof(cmh))) < sizeof(struct in6_addr)) { *error = EINVAL; return (NULL); } @@ -3659,7 +3659,7 @@ sctp_findassociation_cmsgs(struct sctp_i sin6.sin6_family = AF_INET6; sin6.sin6_len = sizeof(struct sockaddr_in6); sin6.sin6_port = port; - m_copydata(control, at + CMSG_ALIGN(sizeof(struct cmsghdr)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); + m_copydata(control, at + CMSG_ALIGN(sizeof(cmh)), sizeof(struct in6_addr), (caddr_t)&sin6.sin6_addr); #ifdef INET if (IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)) { in6_sin6_2_sin(&sin, &sin6); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:33:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8C4029B9; Sun, 7 Jul 2013 11:33:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7D82A108F; Sun, 7 Jul 2013 11:33:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67BXriG064258; Sun, 7 Jul 2013 11:33:53 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67BXpEW064246; Sun, 7 Jul 2013 11:33:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071133.r67BXpEW064246@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 11:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252927 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:33:53 -0000 Author: tuexen Date: Sun Jul 7 11:33:51 2013 New Revision: 252927 URL: http://svnweb.freebsd.org/changeset/base/252927 Log: MFC r240148: Using %p in a format string requires a void *. Modified: stable/9/sys/netinet/sctp_asconf.c stable/9/sys/netinet/sctp_auth.c stable/9/sys/netinet/sctp_cc_functions.c stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_timer.c stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_asconf.c ============================================================================== --- stable/9/sys/netinet/sctp_asconf.c Sun Jul 7 11:28:44 2013 (r252926) +++ stable/9/sys/netinet/sctp_asconf.c Sun Jul 7 11:33:51 2013 (r252927) @@ -2278,7 +2278,7 @@ sctp_set_primary_ip_address_sa(struct sc /* set primary queuing succeeded */ SCTPDBG(SCTP_DEBUG_ASCONF1, "set_primary_ip_address_sa: queued on tcb=%p, ", - stcb); + (void *)stcb); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) { #ifdef SCTP_TIMER_BASED_ASCONF @@ -2291,7 +2291,7 @@ sctp_set_primary_ip_address_sa(struct sc } } else { SCTPDBG(SCTP_DEBUG_ASCONF1, "set_primary_ip_address_sa: failed to add to queue on tcb=%p, ", - stcb); + (void *)stcb); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); return (-1); } @@ -2314,7 +2314,7 @@ sctp_set_primary_ip_address(struct sctp_ SCTP_SET_PRIM_ADDR)) { /* set primary queuing succeeded */ SCTPDBG(SCTP_DEBUG_ASCONF1, "set_primary_ip_address: queued on stcb=%p, ", - stcb); + (void *)stcb); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, &ifa->address.sa); if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_OPEN) { #ifdef SCTP_TIMER_BASED_ASCONF Modified: stable/9/sys/netinet/sctp_auth.c ============================================================================== --- stable/9/sys/netinet/sctp_auth.c Sun Jul 7 11:28:44 2013 (r252926) +++ stable/9/sys/netinet/sctp_auth.c Sun Jul 7 11:33:51 2013 (r252927) @@ -591,7 +591,7 @@ sctp_auth_key_acquire(struct sctp_tcb *s atomic_add_int(&skey->refcount, 1); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u refcount acquire to %d\n", - __FUNCTION__, stcb, key_id, skey->refcount); + __FUNCTION__, (void *)stcb, key_id, skey->refcount); } } @@ -612,7 +612,7 @@ sctp_auth_key_release(struct sctp_tcb *s sctp_free_sharedkey(skey); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u refcount release to %d\n", - __FUNCTION__, stcb, key_id, skey->refcount); + __FUNCTION__, (void *)stcb, key_id, skey->refcount); /* see if a notification should be generated */ if ((skey->refcount <= 1) && (skey->deactivated)) { @@ -621,7 +621,7 @@ sctp_auth_key_release(struct sctp_tcb *s key_id, 0, so_locked); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u no longer used, %d\n", - __FUNCTION__, stcb, key_id, skey->refcount); + __FUNCTION__, (void *)stcb, key_id, skey->refcount); } } } Modified: stable/9/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/9/sys/netinet/sctp_cc_functions.c Sun Jul 7 11:28:44 2013 (r252926) +++ stable/9/sys/netinet/sctp_cc_functions.c Sun Jul 7 11:33:51 2013 (r252927) @@ -984,7 +984,7 @@ sctp_cwnd_update_exit_pf_common(struct s stcb->asoc.my_vtag, ((stcb->sctp_ep->sctp_lport << 16) | (stcb->rport)), net, old_cwnd, net->cwnd); SCTPDBG(SCTP_DEBUG_INDATA1, "Destination %p moved from PF to reachable with cwnd %d.\n", - net, net->cwnd); + (void *)net, net->cwnd); } Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sun Jul 7 11:28:44 2013 (r252926) +++ stable/9/sys/netinet/sctp_indata.c Sun Jul 7 11:33:51 2013 (r252927) @@ -4420,7 +4420,7 @@ sctp_handle_sack(struct mbuf *m, int off cum_ack, send_s); if (tp1) { SCTP_PRINTF("Got send_s from tsn:%x + 1 of tp1:%p\n", - tp1->rec.data.TSN_seq, tp1); + tp1->rec.data.TSN_seq, (void *)tp1); } hopeless_peer: *abort_now = 1; Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Jul 7 11:28:44 2013 (r252926) +++ stable/9/sys/netinet/sctp_input.c Sun Jul 7 11:33:51 2013 (r252927) @@ -91,7 +91,7 @@ sctp_handle_init(struct mbuf *m, int iph struct mbuf *op_err; SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_init: handling INIT tcb:%p\n", - stcb); + (void *)stcb); if (stcb == NULL) { SCTP_INP_RLOCK(inp); } @@ -2652,7 +2652,7 @@ sctp_handle_cookie_echo(struct mbuf *m, SCTP_INP_INCR_REF((*stcb)->sctp_ep); if ((*stcb)->sctp_ep != l_inp) { SCTP_PRINTF("Huh? ep:%p diff then l_inp:%p?\n", - (*stcb)->sctp_ep, l_inp); + (void *)(*stcb)->sctp_ep, (void *)l_inp); } } } @@ -4404,7 +4404,7 @@ __attribute__((noinline)) #endif SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_process_control: iphlen=%u, offset=%u, length=%u stcb:%p\n", - iphlen, *offset, length, stcb); + iphlen, *offset, length, (void *)stcb); /* validate chunk header length... */ if (ntohs(ch->chunk_length) < sizeof(*ch)) { @@ -5023,7 +5023,7 @@ process_control_chunks: break; case SCTP_ABORT_ASSOCIATION: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_ABORT, stcb %p\n", - stcb); + (void *)stcb); if ((stcb) && netp && *netp) sctp_handle_abort((struct sctp_abort_chunk *)ch, stcb, *netp); @@ -5032,7 +5032,7 @@ process_control_chunks: break; case SCTP_SHUTDOWN: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN, stcb %p\n", - stcb); + (void *)stcb); if ((stcb == NULL) || (chk_length != sizeof(struct sctp_shutdown_chunk))) { *offset = length; if (locked_tcb) { @@ -5052,7 +5052,7 @@ process_control_chunks: } break; case SCTP_SHUTDOWN_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-ACK, stcb %p\n", stcb); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-ACK, stcb %p\n", (void *)stcb); if ((stcb) && (netp) && (*netp)) sctp_handle_shutdown_ack((struct sctp_shutdown_ack_chunk *)ch, stcb, *netp); *offset = length; @@ -5068,7 +5068,7 @@ process_control_chunks: break; case SCTP_COOKIE_ECHO: SCTPDBG(SCTP_DEBUG_INPUT3, - "SCTP_COOKIE-ECHO, stcb %p\n", stcb); + "SCTP_COOKIE-ECHO, stcb %p\n", (void *)stcb); if ((stcb) && (stcb->asoc.total_output_queue_size)) { ; } else { @@ -5170,7 +5170,7 @@ process_control_chunks: } break; case SCTP_COOKIE_ACK: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_COOKIE-ACK, stcb %p\n", stcb); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_COOKIE-ACK, stcb %p\n", (void *)stcb); if ((stcb == NULL) || chk_length != sizeof(struct sctp_cookie_ack_chunk)) { if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); @@ -5260,7 +5260,7 @@ process_control_chunks: } break; case SCTP_SHUTDOWN_COMPLETE: - SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-COMPLETE, stcb %p\n", stcb); + SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SHUTDOWN-COMPLETE, stcb %p\n", (void *)stcb); /* must be first and only chunk */ if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { @@ -5619,7 +5619,7 @@ sctp_common_input_processing(struct mbuf sh->checksum = check; if (calc_check != check) { SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", - calc_check, check, m, length, iphlen); + calc_check, check, (void *)m, length, iphlen); stcb = sctp_findassociation_addr(m, offset, src, dst, sh, ch, &inp, &net, vrf_id); if ((net != NULL) && (port != 0)) { @@ -5724,13 +5724,13 @@ sctp_common_input_processing(struct mbuf } #endif SCTPDBG(SCTP_DEBUG_INPUT1, "Ok, Common input processing called, m:%p iphlen:%d offset:%d length:%d stcb:%p\n", - m, iphlen, offset, length, stcb); + (void *)m, iphlen, offset, length, (void *)stcb); if (stcb) { /* always clear this before beginning a packet */ stcb->asoc.authenticated = 0; stcb->asoc.seen_a_sack_this_pkt = 0; SCTPDBG(SCTP_DEBUG_INPUT1, "stcb:%p state:%x\n", - stcb, stcb->asoc.state); + (void *)stcb, stcb->asoc.state); if ((stcb->asoc.state & SCTP_STATE_WAS_ABORTED) || (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED)) { @@ -5968,9 +5968,9 @@ static void sctp_print_mbuf_chain(struct mbuf *m) { for (; m; m = SCTP_BUF_NEXT(m)) { - SCTP_PRINTF("%p: m_len = %ld\n", m, SCTP_BUF_LEN(m)); + SCTP_PRINTF("%p: m_len = %ld\n", (void *)m, SCTP_BUF_LEN(m)); if (SCTP_BUF_IS_EXTENDED(m)) - SCTP_PRINTF("%p: extend_size = %d\n", m, SCTP_BUF_EXTEND_SIZE(m)); + SCTP_PRINTF("%p: extend_size = %d\n", (void *)m, SCTP_BUF_EXTEND_SIZE(m)); } } Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 11:28:44 2013 (r252926) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 11:33:51 2013 (r252927) @@ -2985,7 +2985,7 @@ bound_all_plan_b: } SCTPDBG(SCTP_DEBUG_OUTPUT2, "num preferred:%d on interface:%p cur_addr_num:%d\n", - num_preferred, sctp_ifn, cur_addr_num); + num_preferred, (void *)sctp_ifn, cur_addr_num); /* * Ok we have num_eligible_addr set with how many we can @@ -3022,7 +3022,7 @@ again_with_private_addresses_allowed: goto plan_d; } LIST_FOREACH(sctp_ifa, &emit_ifn->ifalist, next_ifa) { - SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifa:%p\n", sctp_ifa); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifa:%p\n", (void *)sctp_ifa); if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0)) { SCTPDBG(SCTP_DEBUG_OUTPUT2, "Defer\n"); @@ -3072,7 +3072,7 @@ plan_d: * out and see if we can find an acceptable address somewhere * amongst all interfaces. */ - SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan D looked_at is %p\n", looked_at); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan D looked_at is %p\n", (void *)looked_at); LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { if (dest_is_loop == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { /* wrong base scope */ @@ -3812,7 +3812,7 @@ sctp_handle_no_route(struct sctp_tcb *st SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT1, &net->ro._l_addr.sa); if (net->dest_state & SCTP_ADDR_CONFIRMED) { if ((net->dest_state & SCTP_ADDR_REACHABLE) && stcb) { - SCTPDBG(SCTP_DEBUG_OUTPUT1, "no route takes interface %p down\n", net); + SCTPDBG(SCTP_DEBUG_OUTPUT1, "no route takes interface %p down\n", (void *)net); sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, stcb, 0, (void *)net, @@ -4106,7 +4106,7 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTPDBG(SCTP_DEBUG_OUTPUT3, "Destination is %x\n", (uint32_t) (ntohl(ip->ip_dst.s_addr))); SCTPDBG(SCTP_DEBUG_OUTPUT3, "RTP route is %p through\n", - ro->ro_rt); + (void *)ro->ro_rt); if (SCTP_GET_HEADER_FOR_OUTPUT(o_pak)) { /* failed to prepend data, give up */ @@ -12157,7 +12157,7 @@ sctp_lower_sosend(struct socket *so, sndlen = SCTP_HEADER_LEN(i_pak); } SCTPDBG(SCTP_DEBUG_OUTPUT1, "Send called addr:%p send length %d\n", - addr, + (void *)addr, sndlen); if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && (inp->sctp_socket->so_qlimit)) { Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 11:28:44 2013 (r252926) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 11:33:51 2013 (r252927) @@ -553,7 +553,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo (sctp_ifap->ifn_p->ifn_index == ifn_index)) { SCTPDBG(SCTP_DEBUG_PCB4, "Using existing ifn %s (0x%x) for ifa %p\n", sctp_ifap->ifn_p->ifn_name, ifn_index, - sctp_ifap); + (void *)sctp_ifap); if (new_ifn_af) { /* Remove the created one that we don't want */ sctp_delete_ifn(sctp_ifnp, SCTP_ADDR_LOCKED); @@ -575,7 +575,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo * old one */ SCTPDBG(SCTP_DEBUG_PCB4, "Moving ifa %p from %s (0x%x) to %s (0x%x)\n", - sctp_ifap, sctp_ifap->ifn_p->ifn_name, + (void *)sctp_ifap, sctp_ifap->ifn_p->ifn_name, sctp_ifap->ifn_p->ifn_index, if_name, ifn_index); /* remove the address from the old ifn */ @@ -587,7 +587,7 @@ sctp_add_addr_to_vrf(uint32_t vrf_id, vo /* repair ifnp which was NULL ? */ sctp_ifap->localifa_flags = SCTP_ADDR_VALID; SCTPDBG(SCTP_DEBUG_PCB4, "Repairing ifn %p for ifa %p\n", - sctp_ifnp, sctp_ifap); + (void *)sctp_ifnp, (void *)sctp_ifap); sctp_add_ifa_to_ifn(sctp_ifnp, sctp_ifap); } goto exit_stage_left; @@ -763,7 +763,7 @@ sctp_del_addr_from_vrf(uint32_t vrf_id, return; } } - SCTPDBG(SCTP_DEBUG_PCB4, "Deleting ifa %p\n", sctp_ifap); + SCTPDBG(SCTP_DEBUG_PCB4, "Deleting ifa %p\n", (void *)sctp_ifap); sctp_ifap->localifa_flags &= SCTP_ADDR_VALID; sctp_ifap->localifa_flags |= SCTP_BEING_DELETED; vrf->total_ifa_count--; @@ -1678,7 +1678,7 @@ sctp_endpoint_probe(struct sockaddr *nam continue; } SCTPDBG(SCTP_DEBUG_PCB1, "Ok laddr->ifa:%p is possible, ", - laddr->ifa); + (void *)laddr->ifa); if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) { SCTPDBG(SCTP_DEBUG_PCB1, "Huh IFA being deleted\n"); continue; @@ -2181,7 +2181,7 @@ sctp_findassociation_addr(struct mbuf *m retval = sctp_findassociation_addr_sa(src, dst, &inp, netp, find_tcp_pool, vrf_id); } - SCTPDBG(SCTP_DEBUG_PCB1, "retval:%p inp:%p\n", retval, inp); + SCTPDBG(SCTP_DEBUG_PCB1, "retval:%p inp:%p\n", (void *)retval, (void *)inp); if (retval == NULL && inp) { /* Found a EP but not this address */ if ((ch->chunk_type == SCTP_INITIATION) || @@ -2207,7 +2207,7 @@ sctp_findassociation_addr(struct mbuf *m } } } - SCTPDBG(SCTP_DEBUG_PCB1, "retval is %p\n", retval); + SCTPDBG(SCTP_DEBUG_PCB1, "retval is %p\n", (void *)retval); return (retval); } @@ -3100,7 +3100,7 @@ continue_anyway: /* put it in the bucket */ LIST_INSERT_HEAD(head, inp, sctp_hash); SCTPDBG(SCTP_DEBUG_PCB1, "Main hash to bind at head:%p, bound port:%d - in tcp_pool=%d\n", - head, ntohs(lport), port_reuse_active); + (void *)head, ntohs(lport), port_reuse_active); /* set in the port */ inp->sctp_lport = lport; @@ -3368,7 +3368,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, sctp_streamhead); if (sp == NULL) { SCTP_PRINTF("Error, sp is NULL, locked on sending is %p strm:%d\n", - asoc->asoc.locked_on_sending, + (void *)asoc->asoc.locked_on_sending, asoc->asoc.locked_on_sending->stream_no); } else { if ((sp->length == 0) && (sp->msg_is_complete == 0)) @@ -4341,7 +4341,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, LIST_INSERT_HEAD(head, stcb, sctp_tcbhash); } SCTP_INP_WUNLOCK(inp); - SCTPDBG(SCTP_DEBUG_PCB1, "Association %p now allocated\n", stcb); + SCTPDBG(SCTP_DEBUG_PCB1, "Association %p now allocated\n", (void *)stcb); return (stcb); } Modified: stable/9/sys/netinet/sctp_timer.c ============================================================================== --- stable/9/sys/netinet/sctp_timer.c Sun Jul 7 11:28:44 2013 (r252926) +++ stable/9/sys/netinet/sctp_timer.c Sun Jul 7 11:33:51 2013 (r252927) @@ -90,7 +90,7 @@ sctp_threshold_management(struct sctp_in if (net) { net->error_count++; SCTPDBG(SCTP_DEBUG_TIMER4, "Error count for %p now %d thresh:%d\n", - net, net->error_count, + (void *)net, net->error_count, net->failure_threshold); if (net->error_count > net->failure_threshold) { /* We had a threshold failure */ @@ -138,7 +138,7 @@ sctp_threshold_management(struct sctp_in stcb->asoc.overall_error_count++; } SCTPDBG(SCTP_DEBUG_TIMER4, "Overall error count for %p now %d thresh:%u state:%x\n", - &stcb->asoc, stcb->asoc.overall_error_count, + (void *)&stcb->asoc, stcb->asoc.overall_error_count, (uint32_t) threshold, ((net == NULL) ? (uint32_t) 0 : (uint32_t) net->dest_state)); /* @@ -439,7 +439,7 @@ sctp_recover_sent_list(struct sctp_tcb * TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.TSN_seq)) { SCTP_PRINTF("Found chk:%p tsn:%x <= last_acked_seq:%x\n", - chk, chk->rec.data.TSN_seq, asoc->last_acked_seq); + (void *)chk, chk->rec.data.TSN_seq, asoc->last_acked_seq); TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); if (chk->pr_sctp_on) { if (asoc->pr_sctp_cnt != 0) @@ -460,7 +460,7 @@ sctp_recover_sent_list(struct sctp_tcb * } SCTP_PRINTF("after recover order is as follows\n"); TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { - SCTP_PRINTF("chk:%p TSN:%x\n", chk, chk->rec.data.TSN_seq); + SCTP_PRINTF("chk:%p TSN:%x\n", (void *)chk, chk->rec.data.TSN_seq); } } @@ -767,7 +767,7 @@ start_again: if (audit_tf) { SCTPDBG(SCTP_DEBUG_TIMER4, "Audit total flight due to negative value net:%p\n", - net); + (void *)net); stcb->asoc.total_flight = 0; stcb->asoc.total_flight_count = 0; /* Clear all networks flight size */ @@ -775,7 +775,7 @@ start_again: lnets->flight_size = 0; SCTPDBG(SCTP_DEBUG_TIMER4, "Net:%p c-f cwnd:%d ssthresh:%d\n", - lnets, lnets->cwnd, lnets->ssthresh); + (void *)lnets, lnets->cwnd, lnets->ssthresh); } TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { if (chk->sent < SCTP_DATAGRAM_RESEND) { Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Jul 7 11:28:44 2013 (r252926) +++ stable/9/sys/netinet/sctputil.c Sun Jul 7 11:33:51 2013 (r252927) @@ -686,7 +686,7 @@ sctp_auditing(int from, struct sctp_inpc } if (lnet->flight_size != tot_out) { SCTP_PRINTF("net:%p flight was %d corrected to %d\n", - lnet, lnet->flight_size, + (void *)lnet, lnet->flight_size, tot_out); lnet->flight_size = tot_out; } @@ -1434,7 +1434,7 @@ sctp_timeout_handler(void *t) if (tmr->self != (void *)tmr) { /* * SCTP_PRINTF("Stale SCTP timer fired (%p), ignoring...\n", - * tmr); + * (void *)tmr); */ CURVNET_RESTORE(); return; @@ -2112,7 +2112,7 @@ sctp_timer_start(int t_type, struct sctp } if ((to_ticks <= 0) || (tmr == NULL)) { SCTPDBG(SCTP_DEBUG_TIMER1, "%s: %d:software error to_ticks:%d tmr:%p not set ??\n", - __FUNCTION__, t_type, to_ticks, tmr); + __FUNCTION__, t_type, to_ticks, (void *)tmr); return; } if (SCTP_OS_TIMER_PENDING(&tmr->timer)) { From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:36:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 73287BEE; Sun, 7 Jul 2013 11:36:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 639A710AC; Sun, 7 Jul 2013 11:36:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67BalBi064646; Sun, 7 Jul 2013 11:36:47 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67BalXW064645; Sun, 7 Jul 2013 11:36:47 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071136.r67BalXW064645@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 11:36:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252928 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:36:47 -0000 Author: tuexen Date: Sun Jul 7 11:36:46 2013 New Revision: 252928 URL: http://svnweb.freebsd.org/changeset/base/252928 Log: MFC r240158: Get rid of a gcc'ism. Modified: stable/9/sys/netinet/sctp_cc_functions.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_cc_functions.c ============================================================================== --- stable/9/sys/netinet/sctp_cc_functions.c Sun Jul 7 11:33:51 2013 (r252927) +++ stable/9/sys/netinet/sctp_cc_functions.c Sun Jul 7 11:36:46 2013 (r252928) @@ -1917,10 +1917,9 @@ measure_achieved_throughput(struct sctp_ return; } net->cc_mod.htcp_ca.bytecount += net->net_ack; - - if (net->cc_mod.htcp_ca.bytecount >= net->cwnd - ((net->cc_mod.htcp_ca.alpha >> 7 ? : 1) * net->mtu) - && now - net->cc_mod.htcp_ca.lasttime >= net->cc_mod.htcp_ca.minRTT - && net->cc_mod.htcp_ca.minRTT > 0) { + if ((net->cc_mod.htcp_ca.bytecount >= net->cwnd - (((net->cc_mod.htcp_ca.alpha >> 7) ? (net->cc_mod.htcp_ca.alpha >> 7) : 1) * net->mtu)) && + (now - net->cc_mod.htcp_ca.lasttime >= net->cc_mod.htcp_ca.minRTT) && + (net->cc_mod.htcp_ca.minRTT > 0)) { uint32_t cur_Bi = net->cc_mod.htcp_ca.bytecount / net->mtu * hz / (now - net->cc_mod.htcp_ca.lasttime); if (htcp_ccount(&net->cc_mod.htcp_ca) <= 3) { From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:41:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D0BB0EEF; Sun, 7 Jul 2013 11:41:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B546D10E0; Sun, 7 Jul 2013 11:41:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67BfDeR066909; Sun, 7 Jul 2013 11:41:13 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67BfCox066901; Sun, 7 Jul 2013 11:41:12 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071141.r67BfCox066901@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 11:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252929 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:41:13 -0000 Author: tuexen Date: Sun Jul 7 11:41:12 2013 New Revision: 252929 URL: http://svnweb.freebsd.org/changeset/base/252929 Log: MFC r240198: Don't include a structure containing a flexible array in another structure. Modified: stable/9/sys/netinet/sctp_header.h stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_input.h stable/9/sys/netinet/sctp_structs.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_header.h ============================================================================== --- stable/9/sys/netinet/sctp_header.h Sun Jul 7 11:36:46 2013 (r252928) +++ stable/9/sys/netinet/sctp_header.h Sun Jul 7 11:41:12 2013 (r252929) @@ -510,16 +510,6 @@ struct sctp_stream_reset_add_strm { * streams then the request will need to be an overlay structure. */ -struct sctp_stream_reset_out_req { - struct sctp_chunkhdr ch; - struct sctp_stream_reset_out_request sr_req; -} SCTP_PACKED; - -struct sctp_stream_reset_in_req { - struct sctp_chunkhdr ch; - struct sctp_stream_reset_in_request sr_req; -} SCTP_PACKED; - struct sctp_stream_reset_tsn_req { struct sctp_chunkhdr ch; struct sctp_stream_reset_tsn_request sr_req; Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sun Jul 7 11:36:46 2013 (r252928) +++ stable/9/sys/netinet/sctp_indata.c Sun Jul 7 11:41:12 2013 (r252929) @@ -2113,7 +2113,7 @@ finish_express_del: */ struct sctp_queued_to_read *ctl, *nctl; - sctp_reset_in_stream(stcb, liste->number_entries, liste->req.list_of_streams); + sctp_reset_in_stream(stcb, liste->number_entries, liste->list_of_streams); TAILQ_REMOVE(&asoc->resetHead, liste, next_resp); SCTP_FREE(liste, SCTP_M_STRESET); /* sa_ignore FREED_MEMORY */ Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Jul 7 11:36:46 2013 (r252928) +++ stable/9/sys/netinet/sctp_input.c Sun Jul 7 11:41:12 2013 (r252929) @@ -3455,9 +3455,9 @@ process_chunk_drop(struct sctp_tcb *stcb } void -sctp_reset_in_stream(struct sctp_tcb *stcb, int number_entries, uint16_t * list) +sctp_reset_in_stream(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t * list) { - int i; + uint32_t i; uint16_t temp; /* @@ -3511,7 +3511,7 @@ struct sctp_stream_reset_out_request * sctp_find_stream_reset(struct sctp_tcb *stcb, uint32_t seq, struct sctp_tmit_chunk **bchk) { struct sctp_association *asoc; - struct sctp_stream_reset_out_req *req; + struct sctp_chunkhdr *ch; struct sctp_stream_reset_out_request *r; struct sctp_tmit_chunk *chk; int len, clen; @@ -3534,8 +3534,8 @@ sctp_find_stream_reset(struct sctp_tcb * *bchk = chk; } clen = chk->send_size; - req = mtod(chk->data, struct sctp_stream_reset_out_req *); - r = &req->sr_req; + ch = mtod(chk->data, struct sctp_chunkhdr *); + r = (struct sctp_stream_reset_out_request *)(ch + 1); if (ntohl(r->request_seq) == seq) { /* found it */ return (r); @@ -3888,8 +3888,7 @@ sctp_handle_str_reset_request_out(struct } liste->tsn = tsn; liste->number_entries = number_entries; - memcpy(&liste->req, req, - (sizeof(struct sctp_stream_reset_out_request) + (number_entries * sizeof(uint16_t)))); + memcpy(&liste->list_of_streams, req->list_of_streams, number_entries * sizeof(uint16_t)); TAILQ_INSERT_TAIL(&asoc->resetHead, liste, next_resp); asoc->last_reset_action[0] = SCTP_STREAM_RESET_RESULT_PERFORMED; } @@ -4059,7 +4058,7 @@ __attribute__((noinline)) #endif static int sctp_handle_stream_reset(struct sctp_tcb *stcb, struct mbuf *m, int offset, - struct sctp_stream_reset_out_req *sr_req) + struct sctp_chunkhdr *ch_req) { int chk_length, param_len, ptype; struct sctp_paramhdr pstore; @@ -4074,7 +4073,7 @@ __attribute__((noinline)) int num_param = 0; /* now it may be a reset or a reset-response */ - chk_length = ntohs(sr_req->ch.chunk_length); + chk_length = ntohs(ch_req->chunk_length); /* setup for adding the response */ sctp_alloc_a_chunk(stcb, chk); @@ -5413,7 +5412,7 @@ process_control_chunks: */ stcb->asoc.peer_supports_strreset = 1; } - if (sctp_handle_stream_reset(stcb, m, *offset, (struct sctp_stream_reset_out_req *)ch)) { + if (sctp_handle_stream_reset(stcb, m, *offset, ch)) { /* stop processing */ *offset = length; return (NULL); Modified: stable/9/sys/netinet/sctp_input.h ============================================================================== --- stable/9/sys/netinet/sctp_input.h Sun Jul 7 11:36:46 2013 (r252928) +++ stable/9/sys/netinet/sctp_input.h Sun Jul 7 11:41:12 2013 (r252929) @@ -53,7 +53,7 @@ sctp_find_stream_reset(struct sctp_tcb * struct sctp_tmit_chunk **bchk); void -sctp_reset_in_stream(struct sctp_tcb *stcb, int number_entries, +sctp_reset_in_stream(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t * list); Modified: stable/9/sys/netinet/sctp_structs.h ============================================================================== --- stable/9/sys/netinet/sctp_structs.h Sun Jul 7 11:36:46 2013 (r252928) +++ stable/9/sys/netinet/sctp_structs.h Sun Jul 7 11:41:12 2013 (r252929) @@ -77,8 +77,8 @@ TAILQ_HEAD(sctpnetlisthead, sctp_nets); struct sctp_stream_reset_list { TAILQ_ENTRY(sctp_stream_reset_list) next_resp; uint32_t tsn; - int number_entries; - struct sctp_stream_reset_out_request req; + uint32_t number_entries; + uint16_t list_of_streams[]; }; TAILQ_HEAD(sctp_resethead, sctp_stream_reset_list); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:44:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85E3FCA; Sun, 7 Jul 2013 11:44:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7719110F7; Sun, 7 Jul 2013 11:44:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67BiXH8067352; Sun, 7 Jul 2013 11:44:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67BiXVS067351; Sun, 7 Jul 2013 11:44:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071144.r67BiXVS067351@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 11:44:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252930 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:44:33 -0000 Author: tuexen Date: Sun Jul 7 11:44:32 2013 New Revision: 252930 URL: http://svnweb.freebsd.org/changeset/base/252930 Log: MFC r240250: Whitespace cleanup. Modified: stable/9/sys/netinet/sctp_asconf.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_asconf.c ============================================================================== --- stable/9/sys/netinet/sctp_asconf.c Sun Jul 7 11:41:12 2013 (r252929) +++ stable/9/sys/netinet/sctp_asconf.c Sun Jul 7 11:44:32 2013 (r252930) @@ -1862,7 +1862,6 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * { int status; - if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) == 0 || sctp_is_feature_off(inp, SCTP_PCB_FLAGS_DO_ASCONF)) { /* subset bound, no ASCONF allowed case, so ignore */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:45:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0CAF03CA; Sun, 7 Jul 2013 11:45:58 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from thyme.infocus-llc.com (server.infocus-llc.com [206.156.254.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2196F1112; Sun, 7 Jul 2013 11:45:56 +0000 (UTC) Received: from draco.over-yonder.net (c-75-65-60-66.hsd1.ms.comcast.net [75.65.60.66]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by thyme.infocus-llc.com (Postfix) with ESMTPSA id B31E737B4E0; Sun, 7 Jul 2013 06:45:55 -0500 (CDT) Received: by draco.over-yonder.net (Postfix, from userid 100) id 3bp7KH2GpxzSZk; Sun, 7 Jul 2013 06:45:55 -0500 (CDT) Date: Sun, 7 Jul 2013 06:45:55 -0500 From: "Matthew D. Fuller" To: John Baldwin Subject: Re: svn commit: r252209 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20130707114555.GB13386@over-yonder.net> References: <201306251844.r5PIiFDZ009708@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201306251844.r5PIiFDZ009708@svn.freebsd.org> X-Editor: vi X-OS: FreeBSD User-Agent: Mutt/1.5.21-fullermd.4 (2010-09-15) X-Virus-Scanned: clamav-milter 0.97.8 at thyme.infocus-llc.com X-Virus-Status: Clean Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:45:58 -0000 On Tue, Jun 25, 2013 at 06:44:15PM +0000 I heard the voice of John Baldwin, and lo! it spake thus: > Author: jhb > Date: Tue Jun 25 18:44:15 2013 > New Revision: 252209 > URL: http://svnweb.freebsd.org/changeset/base/252209 > > Log: > Several improvements to rmlock(9). Many of these are based on patches > provided by Isilon. This breaks the kernel build with INVARIANT_SUPPORT but not INVARIANTS: /usr/src/sys/kern/kern_rmlock.c:714:1: error: expected identifier or '(' Presumably, because: > +#ifndef INVARIANTS > +#define _rm_assert(c, what, file, line) > +#endif thus #define's, but then later > +#ifdef INVARIANT_SUPPORT > +/* > + * Note that this does not need to use witness_assert() for read lock > + * assertions since an exact count of read locks held by this thread > + * is computable. > + */ > +void > +_rm_assert(const struct rmlock *rm, int what, const char *file, int line) tries to make a function but the preprocessor has already munged it up. -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ On the Internet, nobody can hear you scream. From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:47:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 89E31515; Sun, 7 Jul 2013 11:47:07 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7AE971127; Sun, 7 Jul 2013 11:47:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67Bl7k5067727; Sun, 7 Jul 2013 11:47:07 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67Bl7Ap067726; Sun, 7 Jul 2013 11:47:07 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071147.r67Bl7Ap067726@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 11:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252931 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:47:07 -0000 Author: tuexen Date: Sun Jul 7 11:47:06 2013 New Revision: 252931 URL: http://svnweb.freebsd.org/changeset/base/252931 Log: MFC r240263: Whitespace changes. Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 11:44:32 2013 (r252930) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 11:47:06 2013 (r252931) @@ -2757,7 +2757,6 @@ sctp_inpcb_bind(struct socket *so, struc return (EINVAL); } lport = sin6->sin6_port; - /* * For LOOPBACK the prison_local_ip6() call * will transmute the ipv6 address to the @@ -2795,7 +2794,7 @@ sctp_inpcb_bind(struct socket *so, struc SCTP_INP_INCR_REF(inp); if (lport) { /* - * Did the caller specify a port? if so we must see if a ep + * Did the caller specify a port? if so we must see if an ep * already has this one bound. */ /* got to be root to get at low ports */ @@ -2876,8 +2875,7 @@ continue_anyway: if (bindall) { /* verify that no lport is not used by a singleton */ if ((port_reuse_active == 0) && - (inp_tmp = sctp_isport_inuse(inp, lport, vrf_id)) - ) { + (inp_tmp = sctp_isport_inuse(inp, lport, vrf_id))) { /* Sorry someone already has this one bound */ if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_PORTREUSE)) && (sctp_is_feature_on(inp_tmp, SCTP_PCB_FLAGS_PORTREUSE))) { @@ -3043,9 +3041,9 @@ continue_anyway: * zero out the port to find the address! yuck! can't do * this earlier since need port for sctp_pcb_findep() */ - if (sctp_ifap != NULL) + if (sctp_ifap != NULL) { ifa = sctp_ifap; - else { + } else { /* * Note for BSD we hit here always other O/S's will * pass things in via the sctp_ifap argument From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:50:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 243F2788; Sun, 7 Jul 2013 11:50:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 14F8A114F; Sun, 7 Jul 2013 11:50:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67Bop1E069794; Sun, 7 Jul 2013 11:50:51 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67Bop1K069793; Sun, 7 Jul 2013 11:50:51 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071150.r67Bop1K069793@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 11:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252932 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:50:52 -0000 Author: tuexen Date: Sun Jul 7 11:50:51 2013 New Revision: 252932 URL: http://svnweb.freebsd.org/changeset/base/252932 Log: MFC r240507: Small cleanups. No functional change. Modified: stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Jul 7 11:47:06 2013 (r252931) +++ stable/9/sys/netinet/sctputil.c Sun Jul 7 11:50:51 2013 (r252932) @@ -58,8 +58,7 @@ extern struct sctp_cc_functions sctp_cc_ extern struct sctp_ss_functions sctp_ss_functions[]; void -sctp_sblog(struct sockbuf *sb, - struct sctp_tcb *stcb, int from, int incr) +sctp_sblog(struct sockbuf *sb, struct sctp_tcb *stcb, int from, int incr) { struct sctp_cwnd_log sctp_clog; @@ -103,7 +102,6 @@ sctp_log_closing(struct sctp_inpcb *inp, sctp_clog.x.misc.log4); } - void rto_logging(struct sctp_nets *net, int from) { @@ -198,8 +196,7 @@ sctp_log_map(uint32_t map, uint32_t cum, } void -sctp_log_fr(uint32_t biggest_tsn, uint32_t biggest_new_tsn, uint32_t tsn, - int from) +sctp_log_fr(uint32_t biggest_tsn, uint32_t biggest_new_tsn, uint32_t tsn, int from) { struct sctp_cwnd_log sctp_clog; @@ -242,8 +239,7 @@ sctp_log_mb(struct mbuf *m, int from) } void -sctp_log_strm_del(struct sctp_queued_to_read *control, struct sctp_queued_to_read *poschk, - int from) +sctp_log_strm_del(struct sctp_queued_to_read *control, struct sctp_queued_to_read *poschk, int from) { struct sctp_cwnd_log sctp_clog; @@ -4215,7 +4211,6 @@ sctp_print_address(struct sockaddr *sa) #ifdef INET6 char ip6buf[INET6_ADDRSTRLEN]; - ip6buf[0] = 0; #endif switch (sa->sa_family) { From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:53:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 78CC08C3; Sun, 7 Jul 2013 11:53:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5A701115B; Sun, 7 Jul 2013 11:53:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67BrZhx070140; Sun, 7 Jul 2013 11:53:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67BrZk8070136; Sun, 7 Jul 2013 11:53:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071153.r67BrZk8070136@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 11:53:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252933 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:53:35 -0000 Author: tuexen Date: Sun Jul 7 11:53:34 2013 New Revision: 252933 URL: http://svnweb.freebsd.org/changeset/base/252933 Log: MFC r240826: Small cleanups. No functional change. Modified: stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_output.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 11:50:51 2013 (r252932) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 11:53:34 2013 (r252933) @@ -11394,11 +11394,11 @@ sctp_send_cwr(struct sctp_tcb *stcb, str struct sctp_cwr_chunk *cwr; struct sctp_tmit_chunk *chk; - asoc = &stcb->asoc; SCTP_TCB_LOCK_ASSERT(stcb); if (net == NULL) { return; } + asoc = &stcb->asoc; TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { if ((chk->rec.chunk_id.id == SCTP_ECN_CWR) && (net == chk->whoTo)) { /* @@ -11453,13 +11453,11 @@ sctp_add_stream_reset_out(struct sctp_tm int number_entries, uint16_t * list, uint32_t seq, uint32_t resp_seq, uint32_t last_sent) { - int len, old_len, i; + uint16_t len, old_len, i; struct sctp_stream_reset_out_request *req_out; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11493,19 +11491,16 @@ sctp_add_stream_reset_out(struct sctp_tm return; } - -void +static void sctp_add_stream_reset_in(struct sctp_tmit_chunk *chk, int number_entries, uint16_t * list, uint32_t seq) { - int len, old_len, i; + uint16_t len, old_len, i; struct sctp_stream_reset_in_request *req_in; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11537,18 +11532,15 @@ sctp_add_stream_reset_in(struct sctp_tmi return; } - -void +static void sctp_add_stream_reset_tsn(struct sctp_tmit_chunk *chk, uint32_t seq) { - int len, old_len; + uint16_t len, old_len; struct sctp_stream_reset_tsn_request *req_tsn; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11572,13 +11564,11 @@ void sctp_add_stream_reset_result(struct sctp_tmit_chunk *chk, uint32_t resp_seq, uint32_t result) { - int len, old_len; + uint16_t len, old_len; struct sctp_stream_reset_response *resp; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11597,22 +11587,18 @@ sctp_add_stream_reset_result(struct sctp chk->send_size = SCTP_SIZE32(chk->book_size); SCTP_BUF_LEN(chk->data) = chk->send_size; return; - } - void sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk, uint32_t resp_seq, uint32_t result, uint32_t send_una, uint32_t recv_next) { - int len, old_len; + uint16_t len, old_len; struct sctp_stream_reset_response_tsn *resp; struct sctp_chunkhdr *ch; ch = mtod(chk->data, struct sctp_chunkhdr *); - - old_len = len = SCTP_SIZE32(ntohs(ch->chunk_length)); /* get to new offset for the param. */ @@ -11640,7 +11626,7 @@ sctp_add_an_out_stream(struct sctp_tmit_ uint32_t seq, uint16_t adding) { - int len, old_len; + uint16_t len, old_len; struct sctp_chunkhdr *ch; struct sctp_stream_reset_add_strm *addstr; @@ -11673,7 +11659,7 @@ sctp_add_an_in_stream(struct sctp_tmit_c uint32_t seq, uint16_t adding) { - int len, old_len; + uint16_t len, old_len; struct sctp_chunkhdr *ch; struct sctp_stream_reset_add_strm *addstr; @@ -11700,8 +11686,6 @@ sctp_add_an_in_stream(struct sctp_tmit_c return; } - - int sctp_send_str_reset_req(struct sctp_tcb *stcb, int number_entries, uint16_t * list, @@ -11710,8 +11694,7 @@ sctp_send_str_reset_req(struct sctp_tcb uint8_t send_tsn_req, uint8_t add_stream, uint16_t adding_o, - uint16_t adding_i, uint8_t peer_asked -) + uint16_t adding_i, uint8_t peer_asked) { struct sctp_association *asoc; Modified: stable/9/sys/netinet/sctp_output.h ============================================================================== --- stable/9/sys/netinet/sctp_output.h Sun Jul 7 11:50:51 2013 (r252932) +++ stable/9/sys/netinet/sctp_output.h Sun Jul 7 11:53:34 2013 (r252933) @@ -173,37 +173,19 @@ void sctp_send_cwr(struct sctp_tcb *, st void -sctp_add_stream_reset_out(struct sctp_tmit_chunk *chk, - int number_entries, uint16_t * list, - uint32_t seq, uint32_t resp_seq, uint32_t last_sent); +sctp_add_stream_reset_out(struct sctp_tmit_chunk *, + int, uint16_t *, uint32_t, uint32_t, uint32_t); void -sctp_add_stream_reset_in(struct sctp_tmit_chunk *chk, - int number_entries, uint16_t * list, - uint32_t seq); + sctp_add_stream_reset_result(struct sctp_tmit_chunk *, uint32_t, uint32_t); void -sctp_add_stream_reset_tsn(struct sctp_tmit_chunk *chk, - uint32_t seq); - -void -sctp_add_stream_reset_result(struct sctp_tmit_chunk *chk, - uint32_t resp_seq, uint32_t result); - -void -sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk, - uint32_t resp_seq, uint32_t result, - uint32_t send_una, uint32_t recv_next); +sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *, + uint32_t, uint32_t, uint32_t, uint32_t); int -sctp_send_str_reset_req(struct sctp_tcb *stcb, - int number_entries, uint16_t * list, - uint8_t send_out_req, - uint8_t send_in_req, - uint8_t send_tsn_req, - uint8_t add_stream, - uint16_t adding_o, - uint16_t adding_i, uint8_t from_peer); +sctp_send_str_reset_req(struct sctp_tcb *, int, uint16_t *, uint8_t, uint8_t, + uint8_t, uint8_t, uint16_t, uint16_t, uint8_t); void sctp_send_abort(struct mbuf *, int, struct sockaddr *, struct sockaddr *, From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:56:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D8695AE4; Sun, 7 Jul 2013 11:56:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA7701170; Sun, 7 Jul 2013 11:56:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67BuSGt070670; Sun, 7 Jul 2013 11:56:28 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67BuSPL070669; Sun, 7 Jul 2013 11:56:28 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071156.r67BuSPL070669@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 11:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252934 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:56:28 -0000 Author: tuexen Date: Sun Jul 7 11:56:28 2013 New Revision: 252934 URL: http://svnweb.freebsd.org/changeset/base/252934 Log: MFC r240842: Fix a bug related to handling Re-config chunks. It is not true that the association can be removed if the socket is gone. Modified: stable/9/sys/netinet/sctp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Jul 7 11:53:34 2013 (r252933) +++ stable/9/sys/netinet/sctp_input.c Sun Jul 7 11:56:28 2013 (r252934) @@ -5387,23 +5387,6 @@ process_control_chunks: *offset = length; return (NULL); } - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - /* We are not interested anymore */ -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - so = SCTP_INP_SO(inp); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - SCTP_SOCKET_LOCK(so, 1); - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); -#endif - (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_30); -#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) - SCTP_SOCKET_UNLOCK(so, 1); -#endif - *offset = length; - return (NULL); - } if (stcb->asoc.peer_supports_strreset == 0) { /* * hmm, peer should have announced this, but From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 11:58:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F184DC2B; Sun, 7 Jul 2013 11:58:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E29AA1181; Sun, 7 Jul 2013 11:58:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67Bwhhn070973; Sun, 7 Jul 2013 11:58:43 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67BwhMm070971; Sun, 7 Jul 2013 11:58:43 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071158.r67BwhMm070971@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 11:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252935 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 11:58:44 -0000 Author: tuexen Date: Sun Jul 7 11:58:43 2013 New Revision: 252935 URL: http://svnweb.freebsd.org/changeset/base/252935 Log: MFC r240848: Declare a static function as such. Modified: stable/9/sys/netinet/sctp_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 11:56:28 2013 (r252934) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 11:58:43 2013 (r252935) @@ -6412,7 +6412,7 @@ error_out: } } -int +static int sctp_med_chunk_output(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_association *asoc, From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 12:25:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0B401837; Sun, 7 Jul 2013 12:25:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F14BD1281; Sun, 7 Jul 2013 12:25:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67CPSu4080113; Sun, 7 Jul 2013 12:25:28 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67CPSf3080112; Sun, 7 Jul 2013 12:25:28 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071225.r67CPSf3080112@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 12:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252936 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 12:25:29 -0000 Author: tuexen Date: Sun Jul 7 12:25:28 2013 New Revision: 252936 URL: http://svnweb.freebsd.org/changeset/base/252936 Log: MFC r240849: Whitespace change. Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 11:58:43 2013 (r252935) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 12:25:28 2013 (r252936) @@ -3323,8 +3323,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, continue; } else if (TAILQ_EMPTY(&asoc->asoc.send_queue) && TAILQ_EMPTY(&asoc->asoc.sent_queue) && - (asoc->asoc.stream_queue_cnt == 0) - ) { + (asoc->asoc.stream_queue_cnt == 0)) { if (asoc->asoc.locked_on_sending) { goto abort_anyway; } From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 12:29:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4C808A5E; Sun, 7 Jul 2013 12:29:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3EFCF1298; Sun, 7 Jul 2013 12:29:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67CT22Q080602; Sun, 7 Jul 2013 12:29:02 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67CT2GY080601; Sun, 7 Jul 2013 12:29:02 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071229.r67CT2GY080601@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 12:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252937 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 12:29:02 -0000 Author: tuexen Date: Sun Jul 7 12:29:01 2013 New Revision: 252937 URL: http://svnweb.freebsd.org/changeset/base/252937 Log: MFC r242326: Add braces (as used elsewhere in the SCTP code). Modified: stable/9/sys/netinet/sctp_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 12:25:28 2013 (r252936) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 12:29:01 2013 (r252937) @@ -3981,9 +3981,9 @@ sctp_lowlevel_chunk_output(struct sctp_i } if ((nofragment_flag) && (port == 0)) { ip->ip_off = IP_DF; - } else + } else { ip->ip_off = 0; - + } /* FreeBSD has a function for ip_id's */ ip->ip_id = ip_newid(); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 12:32:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5465DBC9; Sun, 7 Jul 2013 12:32:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 367E612BF; Sun, 7 Jul 2013 12:32:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67CWVfm082700; Sun, 7 Jul 2013 12:32:31 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67CWUHu082697; Sun, 7 Jul 2013 12:32:30 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071232.r67CWUHu082697@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 12:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252938 - in stable/9/sys: netinet netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 12:32:31 -0000 Author: tuexen Date: Sun Jul 7 12:32:30 2013 New Revision: 252938 URL: http://svnweb.freebsd.org/changeset/base/252938 Log: MFC r242327: Whitespace changes due to upstream integration of SCTP changes in the FreeBSD code base. Modified: stable/9/sys/netinet/sctp_uio.h stable/9/sys/netinet/sctp_var.h stable/9/sys/netinet6/sctp6_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_uio.h ============================================================================== --- stable/9/sys/netinet/sctp_uio.h Sun Jul 7 12:29:01 2013 (r252937) +++ stable/9/sys/netinet/sctp_uio.h Sun Jul 7 12:32:30 2013 (r252938) @@ -1278,33 +1278,39 @@ void sctp_freeladdrs(struct sockaddr *); int sctp_opt_info(int, sctp_assoc_t, int, void *, socklen_t *); /* deprecated */ -ssize_t sctp_sendmsg -(int, const void *, size_t, const struct sockaddr *, +ssize_t +sctp_sendmsg(int, const void *, size_t, const struct sockaddr *, socklen_t, uint32_t, uint32_t, uint16_t, uint32_t, uint32_t); /* deprecated */ - ssize_t sctp_send(int, const void *, size_t, - const struct sctp_sndrcvinfo *, int); +ssize_t +sctp_send(int, const void *, size_t, + const struct sctp_sndrcvinfo *, int); /* deprecated */ - ssize_t sctp_sendx(int, const void *, size_t, struct sockaddr *, - int, struct sctp_sndrcvinfo *, int); +ssize_t +sctp_sendx(int, const void *, size_t, struct sockaddr *, + int, struct sctp_sndrcvinfo *, int); /* deprecated */ - ssize_t sctp_sendmsgx(int sd, const void *, size_t, struct sockaddr *, - int, uint32_t, uint32_t, uint16_t, uint32_t, uint32_t); +ssize_t +sctp_sendmsgx(int sd, const void *, size_t, struct sockaddr *, + int, uint32_t, uint32_t, uint16_t, uint32_t, uint32_t); - sctp_assoc_t sctp_getassocid(int, struct sockaddr *); +sctp_assoc_t sctp_getassocid(int, struct sockaddr *); /* deprecated */ - ssize_t sctp_recvmsg(int, void *, size_t, struct sockaddr *, socklen_t *, - struct sctp_sndrcvinfo *, int *); - - ssize_t sctp_sendv(int, const struct iovec *, int, struct sockaddr *, - int, void *, socklen_t, unsigned int, int); - - ssize_t sctp_recvv(int, const struct iovec *, int, struct sockaddr *, - socklen_t *, void *, socklen_t *, unsigned int *, int *); +ssize_t +sctp_recvmsg(int, void *, size_t, struct sockaddr *, socklen_t *, + struct sctp_sndrcvinfo *, int *); + +ssize_t +sctp_sendv(int, const struct iovec *, int, struct sockaddr *, + int, void *, socklen_t, unsigned int, int); + +ssize_t +sctp_recvv(int, const struct iovec *, int, struct sockaddr *, + socklen_t *, void *, socklen_t *, unsigned int *, int *); __END_DECLS Modified: stable/9/sys/netinet/sctp_var.h ============================================================================== --- stable/9/sys/netinet/sctp_var.h Sun Jul 7 12:29:01 2013 (r252937) +++ stable/9/sys/netinet/sctp_var.h Sun Jul 7 12:32:30 2013 (r252938) @@ -321,48 +321,34 @@ struct sctphdr; void sctp_close(struct socket *so); int sctp_disconnect(struct socket *so); - void sctp_ctlinput(int, struct sockaddr *, void *); int sctp_ctloutput(struct socket *, struct sockopt *); #ifdef INET void sctp_input_with_port(struct mbuf *, int, uint16_t); - -#endif -#ifdef INET void sctp_input(struct mbuf *, int); #endif void sctp_pathmtu_adjustment(struct sctp_tcb *, uint16_t); void sctp_drain(void); void sctp_init(void); - void sctp_finish(void); - int sctp_flush(struct socket *, int); int sctp_shutdown(struct socket *); -void sctp_notify -(struct sctp_inpcb *, struct ip *ip, struct sctphdr *, +void +sctp_notify(struct sctp_inpcb *, struct ip *ip, struct sctphdr *, struct sockaddr *, struct sctp_tcb *, struct sctp_nets *); - - int sctp_bindx(struct socket *, int, struct sockaddr_storage *, - int, int, struct proc *); +int +sctp_bindx(struct socket *, int, struct sockaddr_storage *, + int, int, struct proc *); /* can't use sctp_assoc_t here */ - int sctp_peeloff(struct socket *, struct socket *, int, caddr_t, int *); - - int sctp_ingetaddr(struct socket *, - struct sockaddr ** -); - - int sctp_peeraddr(struct socket *, - struct sockaddr ** -); - - int sctp_listen(struct socket *, int, struct thread *); - - int sctp_accept(struct socket *, struct sockaddr **); +int sctp_peeloff(struct socket *, struct socket *, int, caddr_t, int *); +int sctp_ingetaddr(struct socket *, struct sockaddr **); +int sctp_peeraddr(struct socket *, struct sockaddr **); +int sctp_listen(struct socket *, int, struct thread *); +int sctp_accept(struct socket *, struct sockaddr **); #endif /* _KERNEL */ Modified: stable/9/sys/netinet6/sctp6_var.h ============================================================================== --- stable/9/sys/netinet6/sctp6_var.h Sun Jul 7 12:29:01 2013 (r252937) +++ stable/9/sys/netinet6/sctp6_var.h Sun Jul 7 12:32:30 2013 (r252938) @@ -41,21 +41,15 @@ __FBSDID("$FreeBSD$"); SYSCTL_DECL(_net_inet6_sctp6); extern struct pr_usrreqs sctp6_usrreqs; - int sctp6_input(struct mbuf **, int *, int); -int sctp6_output -(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, +int +sctp6_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct proc *); - void sctp6_ctlinput(int, struct sockaddr *, void *); - - - extern void sctp6_notify(struct sctp_inpcb *inp, - struct icmp6_hdr *icmph, - struct sctphdr *sh, - struct sockaddr *to, - struct sctp_tcb *stcb, - struct sctp_nets *net); +void sctp6_ctlinput(int, struct sockaddr *, void *); +extern void +sctp6_notify(struct sctp_inpcb *, struct icmp6_hdr *, + struct sctphdr *, struct sockaddr *, + struct sctp_tcb *, struct sctp_nets *); - -#endif /* _KERNEL */ +#endif #endif From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 12:34:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 45BF6DFE; Sun, 7 Jul 2013 12:34:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 36A5112DD; Sun, 7 Jul 2013 12:34:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67CYm5D083036; Sun, 7 Jul 2013 12:34:48 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67CYmDT083035; Sun, 7 Jul 2013 12:34:48 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071234.r67CYmDT083035@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 12:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252939 - stable/9/lib/libc/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 12:34:48 -0000 Author: tuexen Date: Sun Jul 7 12:34:47 2013 New Revision: 252939 URL: http://svnweb.freebsd.org/changeset/base/252939 Log: MFC r242512: Fix errno in a couple of error cases. Modified: stable/9/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/9/lib/libc/net/sctp_sys_calls.c Sun Jul 7 12:32:30 2013 (r252938) +++ stable/9/lib/libc/net/sctp_sys_calls.c Sun Jul 7 12:34:47 2013 (r252939) @@ -449,6 +449,7 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, opt_len = (socklen_t) ((size_t)asoc + sizeof(struct sctp_getaddresses)); addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { + errno = ENOMEM; return (-1); } addrs->sget_assoc_id = id; @@ -777,6 +778,7 @@ sctp_sendx(int sd, const void *msg, size } buf = malloc(len); if (buf == NULL) { + errno = ENOMEM; return (-1); } aa = (int *)buf; @@ -1052,7 +1054,7 @@ sctp_sendv(int sd, CMSG_SPACE(sizeof(struct sctp_authinfo)) + (size_t)addrcnt * CMSG_SPACE(sizeof(struct in6_addr))); if (cmsgbuf == NULL) { - errno = ENOBUFS; + errno = ENOMEM; return (-1); } msg.msg_control = cmsgbuf; From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 12:50:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 932801BB; Sun, 7 Jul 2013 12:50:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 75AC41331; Sun, 7 Jul 2013 12:50:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67Co5Tv086612; Sun, 7 Jul 2013 12:50:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67Co4lw086608; Sun, 7 Jul 2013 12:50:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071250.r67Co4lw086608@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 12:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252940 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 12:50:05 -0000 Author: tuexen Date: Sun Jul 7 12:50:04 2013 New Revision: 252940 URL: http://svnweb.freebsd.org/changeset/base/252940 Log: MFC r242627: Move from early SSN assignment to late SSN assignment. This doesn't change functionality, but makes upcoming change much easier. Developed with rrs@ at the IETF 85. Modified: stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_structs.h stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Jul 7 12:34:47 2013 (r252939) +++ stable/9/sys/netinet/sctp_input.c Sun Jul 7 12:50:04 2013 (r252940) @@ -1942,7 +1942,7 @@ sctp_process_cookie_existing(struct mbuf sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_NOT_LOCKED); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { stcb->asoc.strmout[i].stream_no = i; - stcb->asoc.strmout[i].next_sequence_sent = 0; + stcb->asoc.strmout[i].next_sequence_send = 0; stcb->asoc.strmout[i].last_msg_incomplete = 0; } /* process the INIT-ACK info (my info) */ @@ -3489,7 +3489,7 @@ sctp_reset_out_streams(struct sctp_tcb * if (number_entries == 0) { for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - stcb->asoc.strmout[i].next_sequence_sent = 0; + stcb->asoc.strmout[i].next_sequence_send = 0; } } else if (number_entries) { for (i = 0; i < number_entries; i++) { @@ -3500,7 +3500,7 @@ sctp_reset_out_streams(struct sctp_tcb * /* no such stream */ continue; } - stcb->asoc.strmout[temp].next_sequence_sent = 0; + stcb->asoc.strmout[temp].next_sequence_send = 0; } } sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_SEND, stcb, number_entries, (void *)list, SCTP_SO_NOT_LOCKED); Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 12:34:47 2013 (r252939) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 12:50:04 2013 (r252940) @@ -3513,7 +3513,7 @@ sctp_process_cmsgs_for_init(struct sctp_ stcb->asoc.pre_open_streams = stcb->asoc.streamoutcnt; } for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - stcb->asoc.strmout[i].next_sequence_sent = 0; + stcb->asoc.strmout[i].next_sequence_send = 0; TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; @@ -6194,7 +6194,6 @@ sctp_msg_append(struct sctp_tcb *stcb, sp->timetolive = srcv->sinfo_timetolive; sp->ppid = srcv->sinfo_ppid; sp->context = srcv->sinfo_context; - sp->strseq = 0; if (sp->sinfo_flags & SCTP_ADDR_OVER) { sp->net = net; atomic_add_int(&sp->net->ref_count, 1); @@ -6235,10 +6234,6 @@ sctp_msg_append(struct sctp_tcb *stcb, sctp_snd_sb_alloc(stcb, sp->length); atomic_add_int(&stcb->asoc.stream_queue_cnt, 1); TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); - if ((srcv->sinfo_flags & SCTP_UNORDERED) == 0) { - sp->strseq = strm->next_sequence_sent; - strm->next_sequence_sent++; - } stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, strm, sp, 1); m = NULL; if (hold_stcb_lock == 0) { @@ -7379,7 +7374,10 @@ dont_do_it: chk->asoc = &stcb->asoc; chk->pad_inplace = 0; chk->no_fr_allowed = 0; - chk->rec.data.stream_seq = sp->strseq; + chk->rec.data.stream_seq = strq->next_sequence_send; + if (rcv_flags & SCTP_DATA_LAST_FRAG) { + strq->next_sequence_send++; + } chk->rec.data.stream_number = sp->stream; chk->rec.data.payloadtype = sp->ppid; chk->rec.data.context = sp->context; @@ -11794,7 +11792,7 @@ sctp_send_str_reset_req(struct sctp_tcb stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 0, 1); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); - stcb->asoc.strmout[i].next_sequence_sent = oldstream[i].next_sequence_sent; + stcb->asoc.strmout[i].next_sequence_send = oldstream[i].next_sequence_send; stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; stcb->asoc.strmout[i].stream_no = i; stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], &oldstream[i]); @@ -11814,7 +11812,7 @@ sctp_send_str_reset_req(struct sctp_tcb /* now the new streams */ stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1); for (i = stcb->asoc.streamoutcnt; i < (stcb->asoc.streamoutcnt + adding_o); i++) { - stcb->asoc.strmout[i].next_sequence_sent = 0x0; + stcb->asoc.strmout[i].next_sequence_send = 0x0; TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; @@ -11971,7 +11969,6 @@ sctp_copy_it_in(struct sctp_tcb *stcb, sp->timetolive = srcv->sinfo_timetolive; sp->ppid = srcv->sinfo_ppid; sp->context = srcv->sinfo_context; - sp->strseq = 0; (void)SCTP_GETTIME_TIMEVAL(&sp->ts); sp->stream = srcv->sinfo_stream; @@ -12724,15 +12721,7 @@ skip_preblock: } sctp_snd_sb_alloc(stcb, sp->length); atomic_add_int(&asoc->stream_queue_cnt, 1); - if ((srcv->sinfo_flags & SCTP_UNORDERED) == 0) { - sp->strseq = strm->next_sequence_sent; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_AT_SEND_2_SCTP) { - sctp_misc_ints(SCTP_STRMOUT_LOG_ASSIGN, - (uintptr_t) stcb, sp->length, - (uint32_t) ((srcv->sinfo_stream << 16) | sp->strseq), 0); - } - strm->next_sequence_sent++; - } else { + if (srcv->sinfo_flags & SCTP_UNORDERED) { SCTP_STAT_INCR(sctps_sends_with_unord); } TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); Modified: stable/9/sys/netinet/sctp_structs.h ============================================================================== --- stable/9/sys/netinet/sctp_structs.h Sun Jul 7 12:34:47 2013 (r252939) +++ stable/9/sys/netinet/sctp_structs.h Sun Jul 7 12:50:04 2013 (r252940) @@ -517,7 +517,6 @@ struct sctp_stream_queue_pending { uint32_t context; uint16_t sinfo_flags; uint16_t stream; - uint16_t strseq; uint16_t act_flags; uint16_t auth_keyid; uint8_t holds_key_ref; @@ -590,7 +589,7 @@ struct sctp_stream_out { struct sctp_streamhead outqueue; union scheduling_parameters ss_params; uint16_t stream_no; - uint16_t next_sequence_sent; /* next one I expect to send out */ + uint16_t next_sequence_send; /* next one I expect to send out */ uint8_t last_msg_incomplete; }; Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Jul 7 12:34:47 2013 (r252939) +++ stable/9/sys/netinet/sctputil.c Sun Jul 7 12:50:04 2013 (r252940) @@ -1052,7 +1052,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str * that were dropped must be notified to the upper layer as * failed to send. */ - asoc->strmout[i].next_sequence_sent = 0x0; + asoc->strmout[i].next_sequence_send = 0x0; TAILQ_INIT(&asoc->strmout[i].outqueue); asoc->strmout[i].stream_no = i; asoc->strmout[i].last_msg_incomplete = 0; @@ -2973,7 +2973,7 @@ sctp_notify_send_failed2(struct sctp_tcb /* not exactly what the user sent in, but should be close :) */ bzero(&ssf->ssf_info, sizeof(ssf->ssf_info)); ssf->ssf_info.sinfo_stream = sp->stream; - ssf->ssf_info.sinfo_ssn = sp->strseq; + ssf->ssf_info.sinfo_ssn = 0; if (sp->some_taken) { ssf->ssf_info.sinfo_flags = SCTP_DATA_LAST_FRAG; } else { @@ -4774,77 +4774,69 @@ sctp_release_pr_sctp_chunk(struct sctp_t * Still no eom found. That means there is stuff left on the * stream out queue.. yuck. */ - strq = &stcb->asoc.strmout[stream]; SCTP_TCB_SEND_LOCK(stcb); - TAILQ_FOREACH(sp, &strq->outqueue, next) { - /* FIXME: Shouldn't this be a serial number check? */ - if (sp->strseq > seq) { - break; - } - /* Check if its our SEQ */ - if (sp->strseq == seq) { - sp->discard_rest = 1; - /* - * We may need to put a chunk on the queue - * that holds the TSN that would have been - * sent with the LAST bit. - */ + strq = &stcb->asoc.strmout[stream]; + sp = TAILQ_FIRST(&strq->outqueue); + if (sp != NULL) { + sp->discard_rest = 1; + /* + * We may need to put a chunk on the queue that + * holds the TSN that would have been sent with the + * LAST bit. + */ + if (chk == NULL) { + /* Yep, we have to */ + sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { - /* Yep, we have to */ - sctp_alloc_a_chunk(stcb, chk); - if (chk == NULL) { - /* - * we are hosed. All we can - * do is nothing.. which - * will cause an abort if - * the peer is paying - * attention. - */ - goto oh_well; - } - memset(chk, 0, sizeof(*chk)); - chk->rec.data.rcv_flags = SCTP_DATA_LAST_FRAG; - chk->sent = SCTP_FORWARD_TSN_SKIP; - chk->asoc = &stcb->asoc; - chk->rec.data.stream_seq = sp->strseq; - chk->rec.data.stream_number = sp->stream; - chk->rec.data.payloadtype = sp->ppid; - chk->rec.data.context = sp->context; - chk->flags = sp->act_flags; - if (sp->net) - chk->whoTo = sp->net; - else - chk->whoTo = stcb->asoc.primary_destination; - atomic_add_int(&chk->whoTo->ref_count, 1); - chk->rec.data.TSN_seq = atomic_fetchadd_int(&stcb->asoc.sending_seq, 1); - stcb->asoc.pr_sctp_cnt++; - chk->pr_sctp_on = 1; - TAILQ_INSERT_TAIL(&stcb->asoc.sent_queue, chk, sctp_next); - stcb->asoc.sent_queue_cnt++; - stcb->asoc.pr_sctp_cnt++; - } else { - chk->rec.data.rcv_flags |= SCTP_DATA_LAST_FRAG; - } - oh_well: - if (sp->data) { /* - * Pull any data to free up the SB - * and allow sender to "add more" - * while we will throw away :-) + * we are hosed. All we can do is + * nothing.. which will cause an + * abort if the peer is paying + * attention. */ - sctp_free_spbufspace(stcb, &stcb->asoc, - sp); - ret_sz += sp->length; - do_wakeup_routine = 1; - sp->some_taken = 1; - sctp_m_freem(sp->data); - sp->data = NULL; - sp->tail_mbuf = NULL; - sp->length = 0; + goto oh_well; } - break; + memset(chk, 0, sizeof(*chk)); + chk->rec.data.rcv_flags = SCTP_DATA_LAST_FRAG; + chk->sent = SCTP_FORWARD_TSN_SKIP; + chk->asoc = &stcb->asoc; + chk->rec.data.stream_seq = strq->next_sequence_send; + chk->rec.data.stream_number = sp->stream; + chk->rec.data.payloadtype = sp->ppid; + chk->rec.data.context = sp->context; + chk->flags = sp->act_flags; + if (sp->net) + chk->whoTo = sp->net; + else + chk->whoTo = stcb->asoc.primary_destination; + atomic_add_int(&chk->whoTo->ref_count, 1); + chk->rec.data.TSN_seq = atomic_fetchadd_int(&stcb->asoc.sending_seq, 1); + stcb->asoc.pr_sctp_cnt++; + chk->pr_sctp_on = 1; + TAILQ_INSERT_TAIL(&stcb->asoc.sent_queue, chk, sctp_next); + stcb->asoc.sent_queue_cnt++; + stcb->asoc.pr_sctp_cnt++; + } else { + chk->rec.data.rcv_flags |= SCTP_DATA_LAST_FRAG; + } + strq->next_sequence_send++; + oh_well: + if (sp->data) { + /* + * Pull any data to free up the SB and allow + * sender to "add more" while we will throw + * away :-) + */ + sctp_free_spbufspace(stcb, &stcb->asoc, sp); + ret_sz += sp->length; + do_wakeup_routine = 1; + sp->some_taken = 1; + sctp_m_freem(sp->data); + sp->data = NULL; + sp->tail_mbuf = NULL; + sp->length = 0; } - } /* End tailq_foreach */ + } SCTP_TCB_SEND_UNLOCK(stcb); } if (do_wakeup_routine) { From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 12:54:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 550BD3B7; Sun, 7 Jul 2013 12:54:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 47138134D; Sun, 7 Jul 2013 12:54:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67CsGNU088697; Sun, 7 Jul 2013 12:54:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67CsFrr088693; Sun, 7 Jul 2013 12:54:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071254.r67CsFrr088693@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 12:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252941 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 12:54:16 -0000 Author: tuexen Date: Sun Jul 7 12:54:15 2013 New Revision: 252941 URL: http://svnweb.freebsd.org/changeset/base/252941 Log: MFC r242708, r242709: Improve PR-SCTP if used in combination with NR-SACK. Based on work done by Mohammad Rajiullah. Modified: stable/9/sys/netinet/sctp_constants.h stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_constants.h ============================================================================== --- stable/9/sys/netinet/sctp_constants.h Sun Jul 7 12:50:04 2013 (r252940) +++ stable/9/sys/netinet/sctp_constants.h Sun Jul 7 12:54:15 2013 (r252941) @@ -370,6 +370,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_DATAGRAM_ACKED 10010 #define SCTP_DATAGRAM_MARKED 20010 #define SCTP_FORWARD_TSN_SKIP 30010 +#define SCTP_DATAGRAM_NR_MARKED 40010 /* chunk output send from locations */ #define SCTP_OUTPUT_FROM_USR_SEND 0 Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sun Jul 7 12:50:04 2013 (r252940) +++ stable/9/sys/netinet/sctp_indata.c Sun Jul 7 12:54:15 2013 (r252941) @@ -2975,9 +2975,10 @@ sctp_process_segment_range(struct sctp_t * All chunks NOT UNSENT fall through here and are marked * (leave PR-SCTP ones that are to skip alone though) */ - if (tp1->sent != SCTP_FORWARD_TSN_SKIP) + if ((tp1->sent != SCTP_FORWARD_TSN_SKIP) && + (tp1->sent != SCTP_DATAGRAM_NR_MARKED)) { tp1->sent = SCTP_DATAGRAM_MARKED; - + } if (tp1->rec.data.chunk_was_revoked) { /* deflate the cwnd */ tp1->whoTo->cwnd -= tp1->book_size; @@ -2985,6 +2986,7 @@ sctp_process_segment_range(struct sctp_t } /* NR Sack code here */ if (nr_sacking) { + tp1->sent = SCTP_DATAGRAM_NR_MARKED; if (tp1->data) { /* * sa_ignore @@ -3600,12 +3602,14 @@ sctp_try_advance_peer_ack_point(struct s } TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { if (tp1->sent != SCTP_FORWARD_TSN_SKIP && - tp1->sent != SCTP_DATAGRAM_RESEND) { + tp1->sent != SCTP_DATAGRAM_RESEND && + tp1->sent != SCTP_DATAGRAM_NR_MARKED) { /* no chance to advance, out of here */ break; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_TRY_ADVANCE) { - if (tp1->sent == SCTP_FORWARD_TSN_SKIP) { + if ((tp1->sent == SCTP_FORWARD_TSN_SKIP) || + (tp1->sent == SCTP_DATAGRAM_NR_MARKED)) { sctp_misc_ints(SCTP_FWD_TSN_CHECK, asoc->advanced_peer_ack_point, tp1->rec.data.TSN_seq, 0, 0); @@ -3653,7 +3657,8 @@ sctp_try_advance_peer_ack_point(struct s * the chunk, advance our peer ack point and we can check * the next chunk. */ - if (tp1->sent == SCTP_FORWARD_TSN_SKIP) { + if ((tp1->sent == SCTP_FORWARD_TSN_SKIP) || + (tp1->sent == SCTP_DATAGRAM_NR_MARKED)) { /* advance PeerAckPoint goes forward */ if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, asoc->advanced_peer_ack_point)) { asoc->advanced_peer_ack_point = tp1->rec.data.TSN_seq; Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 12:50:04 2013 (r252940) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 12:54:15 2013 (r252941) @@ -10152,7 +10152,8 @@ sctp_fill_in_rest: unsigned int cnt_of_skipped = 0; TAILQ_FOREACH(at, &asoc->sent_queue, sctp_next) { - if (at->sent != SCTP_FORWARD_TSN_SKIP) { + if ((at->sent != SCTP_FORWARD_TSN_SKIP) && + (at->sent != SCTP_DATAGRAM_NR_MARKED)) { /* no more to look at */ break; } From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 12:57:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5CEC95E4; Sun, 7 Jul 2013 12:57:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4CF32136A; Sun, 7 Jul 2013 12:57:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67CvlMr089269; Sun, 7 Jul 2013 12:57:47 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67CvkEC089260; Sun, 7 Jul 2013 12:57:46 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071257.r67CvkEC089260@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 12:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252942 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 12:57:47 -0000 Author: tuexen Date: Sun Jul 7 12:57:45 2013 New Revision: 252942 URL: http://svnweb.freebsd.org/changeset/base/252942 Log: MFC r242714: Add per outgoing stream accounting for chunks in the send and sent queue. This provides no functional change, but is a preparation for an upcoming stream reset improvement. Done with rrs@. Modified: stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_structs.h stable/9/sys/netinet/sctp_timer.c stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sun Jul 7 12:54:15 2013 (r252941) +++ stable/9/sys/netinet/sctp_indata.c Sun Jul 7 12:57:45 2013 (r252942) @@ -3963,7 +3963,15 @@ sctp_express_handle_sack(struct sctp_tcb tp1->whoTo->cwnd -= tp1->book_size; tp1->rec.data.chunk_was_revoked = 0; } - tp1->sent = SCTP_DATAGRAM_ACKED; + if (tp1->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", tp1->rec.data.stream_number); +#endif + } + } TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next); if (tp1->data) { /* sa_ignore NO_NULL_CHK */ @@ -4699,10 +4707,14 @@ sctp_handle_sack(struct mbuf *m, int off if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, cum_ack)) { break; } - if (tp1->sent == SCTP_DATAGRAM_UNSENT) { - /* no more sent on list */ - SCTP_PRINTF("Warning, tp1->sent == %d and its now acked?\n", - tp1->sent); + if (tp1->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", tp1->rec.data.stream_number); +#endif + } } TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next); if (tp1->pr_sctp_on) { Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Jul 7 12:54:15 2013 (r252941) +++ stable/9/sys/netinet/sctp_input.c Sun Jul 7 12:57:45 2013 (r252942) @@ -311,6 +311,13 @@ sctp_process_init(struct sctp_init_chunk if (chk->rec.data.stream_number >= newcnt) { TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); asoc->send_queue_cnt--; + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 12:54:15 2013 (r252941) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 12:57:45 2013 (r252942) @@ -4949,6 +4949,15 @@ sctp_free_assoc(struct sctp_inpcb *inp, } /* sent queue SHOULD be empty */ TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { + if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } + } TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); if (chk->data) { if (so) { Modified: stable/9/sys/netinet/sctp_structs.h ============================================================================== --- stable/9/sys/netinet/sctp_structs.h Sun Jul 7 12:54:15 2013 (r252941) +++ stable/9/sys/netinet/sctp_structs.h Sun Jul 7 12:57:45 2013 (r252942) @@ -588,6 +588,7 @@ union scheduling_parameters { struct sctp_stream_out { struct sctp_streamhead outqueue; union scheduling_parameters ss_params; + uint32_t chunks_on_queues; uint16_t stream_no; uint16_t next_sequence_send; /* next one I expect to send out */ uint8_t last_msg_incomplete; Modified: stable/9/sys/netinet/sctp_timer.c ============================================================================== --- stable/9/sys/netinet/sctp_timer.c Sun Jul 7 12:54:15 2013 (r252941) +++ stable/9/sys/netinet/sctp_timer.c Sun Jul 7 12:57:45 2013 (r252942) @@ -440,6 +440,11 @@ sctp_recover_sent_list(struct sctp_tcb * if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.TSN_seq)) { SCTP_PRINTF("Found chk:%p tsn:%x <= last_acked_seq:%x\n", (void *)chk, chk->rec.data.TSN_seq, asoc->last_acked_seq); + if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; + } + } TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); if (chk->pr_sctp_on) { if (asoc->pr_sctp_cnt != 0) Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Jul 7 12:54:15 2013 (r252941) +++ stable/9/sys/netinet/sctputil.c Sun Jul 7 12:57:45 2013 (r252942) @@ -3727,6 +3727,15 @@ sctp_report_all_outbound(struct sctp_tcb TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); asoc->sent_queue_cnt--; + if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } + } if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); sctp_ulp_notify(SCTP_NOTIFY_SENT_DG_FAIL, stcb, @@ -3743,6 +3752,13 @@ sctp_report_all_outbound(struct sctp_tcb TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); asoc->send_queue_cnt--; + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } if (chk->data != NULL) { sctp_free_bufspace(stcb, asoc, chk, 1); sctp_ulp_notify(SCTP_NOTIFY_UNSENT_DG_FAIL, stcb, From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 13:04:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E25B3812; Sun, 7 Jul 2013 13:04:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D41701388; Sun, 7 Jul 2013 13:04:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67D4Wvl092071; Sun, 7 Jul 2013 13:04:32 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67D4V8D092063; Sun, 7 Jul 2013 13:04:31 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071304.r67D4V8D092063@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 13:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252943 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 13:04:33 -0000 Author: tuexen Date: Sun Jul 7 13:04:31 2013 New Revision: 252943 URL: http://svnweb.freebsd.org/changeset/base/252943 Log: MFC r243157: Get the accounting working. We now have counters how many chunks for each SCTP outgoing stream are in the send and sent queue. While there, improve the naming of NR-SACK related constants recently introduced. Modified: stable/9/sys/netinet/sctp_constants.h stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_timer.c stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_constants.h ============================================================================== --- stable/9/sys/netinet/sctp_constants.h Sun Jul 7 12:57:45 2013 (r252942) +++ stable/9/sys/netinet/sctp_constants.h Sun Jul 7 13:04:31 2013 (r252943) @@ -370,7 +370,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_DATAGRAM_ACKED 10010 #define SCTP_DATAGRAM_MARKED 20010 #define SCTP_FORWARD_TSN_SKIP 30010 -#define SCTP_DATAGRAM_NR_MARKED 40010 +#define SCTP_DATAGRAM_NR_ACKED 40010 /* chunk output send from locations */ #define SCTP_OUTPUT_FROM_USR_SEND 0 Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sun Jul 7 12:57:45 2013 (r252942) +++ stable/9/sys/netinet/sctp_indata.c Sun Jul 7 13:04:31 2013 (r252943) @@ -2976,7 +2976,7 @@ sctp_process_segment_range(struct sctp_t * (leave PR-SCTP ones that are to skip alone though) */ if ((tp1->sent != SCTP_FORWARD_TSN_SKIP) && - (tp1->sent != SCTP_DATAGRAM_NR_MARKED)) { + (tp1->sent != SCTP_DATAGRAM_NR_ACKED)) { tp1->sent = SCTP_DATAGRAM_MARKED; } if (tp1->rec.data.chunk_was_revoked) { @@ -2985,8 +2985,16 @@ sctp_process_segment_range(struct sctp_t tp1->rec.data.chunk_was_revoked = 0; } /* NR Sack code here */ - if (nr_sacking) { - tp1->sent = SCTP_DATAGRAM_NR_MARKED; + if (nr_sacking && + (tp1->sent != SCTP_DATAGRAM_NR_ACKED)) { + if (stcb->asoc.strmout[tp1->rec.data.stream_number].chunks_on_queues > 0) { + stcb->asoc.strmout[tp1->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", tp1->rec.data.stream_number); +#endif + } + tp1->sent = SCTP_DATAGRAM_NR_ACKED; if (tp1->data) { /* * sa_ignore @@ -3091,7 +3099,6 @@ sctp_check_for_revoked(struct sctp_tcb * uint32_t biggest_tsn_acked) { struct sctp_tmit_chunk *tp1; - int tot_revoked = 0; TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, cumack)) { @@ -3126,7 +3133,6 @@ sctp_check_for_revoked(struct sctp_tcb * * artificial inflation of the flight_size. */ tp1->whoTo->cwnd += tp1->book_size; - tot_revoked++; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SACK_LOGGING_ENABLE) { sctp_log_sack(asoc->last_acked_seq, cumack, @@ -3603,13 +3609,13 @@ sctp_try_advance_peer_ack_point(struct s TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { if (tp1->sent != SCTP_FORWARD_TSN_SKIP && tp1->sent != SCTP_DATAGRAM_RESEND && - tp1->sent != SCTP_DATAGRAM_NR_MARKED) { + tp1->sent != SCTP_DATAGRAM_NR_ACKED) { /* no chance to advance, out of here */ break; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_TRY_ADVANCE) { if ((tp1->sent == SCTP_FORWARD_TSN_SKIP) || - (tp1->sent == SCTP_DATAGRAM_NR_MARKED)) { + (tp1->sent == SCTP_DATAGRAM_NR_ACKED)) { sctp_misc_ints(SCTP_FWD_TSN_CHECK, asoc->advanced_peer_ack_point, tp1->rec.data.TSN_seq, 0, 0); @@ -3658,7 +3664,7 @@ sctp_try_advance_peer_ack_point(struct s * the next chunk. */ if ((tp1->sent == SCTP_FORWARD_TSN_SKIP) || - (tp1->sent == SCTP_DATAGRAM_NR_MARKED)) { + (tp1->sent == SCTP_DATAGRAM_NR_ACKED)) { /* advance PeerAckPoint goes forward */ if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, asoc->advanced_peer_ack_point)) { asoc->advanced_peer_ack_point = tp1->rec.data.TSN_seq; @@ -3963,7 +3969,7 @@ sctp_express_handle_sack(struct sctp_tcb tp1->whoTo->cwnd -= tp1->book_size; tp1->rec.data.chunk_was_revoked = 0; } - if (tp1->sent != SCTP_DATAGRAM_NR_MARKED) { + if (tp1->sent != SCTP_DATAGRAM_NR_ACKED) { if (asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues > 0) { asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues--; #ifdef INVARIANTS @@ -4630,7 +4636,9 @@ sctp_handle_sack(struct mbuf *m, int off tp1->whoTo->cwnd -= tp1->book_size; tp1->rec.data.chunk_was_revoked = 0; } - tp1->sent = SCTP_DATAGRAM_ACKED; + if (tp1->sent != SCTP_DATAGRAM_NR_ACKED) { + tp1->sent = SCTP_DATAGRAM_ACKED; + } } } else { break; @@ -4707,7 +4715,7 @@ sctp_handle_sack(struct mbuf *m, int off if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, cum_ack)) { break; } - if (tp1->sent != SCTP_DATAGRAM_NR_MARKED) { + if (tp1->sent != SCTP_DATAGRAM_NR_ACKED) { if (asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues > 0) { asoc->strmout[tp1->rec.data.stream_number].chunks_on_queues--; #ifdef INVARIANTS Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Jul 7 12:57:45 2013 (r252942) +++ stable/9/sys/netinet/sctp_input.c Sun Jul 7 13:04:31 2013 (r252943) @@ -1948,6 +1948,7 @@ sctp_process_cookie_existing(struct mbuf sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_NOT_LOCKED); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + stcb->asoc.strmout[i].chunks_on_queues = 0; stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].next_sequence_send = 0; stcb->asoc.strmout[i].last_msg_incomplete = 0; Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 12:57:45 2013 (r252942) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 13:04:31 2013 (r252943) @@ -3513,8 +3513,9 @@ sctp_process_cmsgs_for_init(struct sctp_ stcb->asoc.pre_open_streams = stcb->asoc.streamoutcnt; } for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - stcb->asoc.strmout[i].next_sequence_send = 0; TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); + stcb->asoc.strmout[i].chunks_on_queues = 0; + stcb->asoc.strmout[i].next_sequence_send = 0; stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL); @@ -7494,6 +7495,7 @@ dont_do_it: *locked = 1; } asoc->chunks_on_out_queue++; + strq->chunks_on_queues++; TAILQ_INSERT_TAIL(&asoc->send_queue, chk, sctp_next); asoc->send_queue_cnt++; out_of: @@ -10153,7 +10155,7 @@ sctp_fill_in_rest: TAILQ_FOREACH(at, &asoc->sent_queue, sctp_next) { if ((at->sent != SCTP_FORWARD_TSN_SKIP) && - (at->sent != SCTP_DATAGRAM_NR_MARKED)) { + (at->sent != SCTP_DATAGRAM_NR_ACKED)) { /* no more to look at */ break; } @@ -11793,6 +11795,7 @@ sctp_send_str_reset_req(struct sctp_tcb stcb->asoc.ss_functions.sctp_ss_clear(stcb, &stcb->asoc, 0, 1); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); + stcb->asoc.strmout[i].chunks_on_queues = oldstream[i].chunks_on_queues; stcb->asoc.strmout[i].next_sequence_send = oldstream[i].next_sequence_send; stcb->asoc.strmout[i].last_msg_incomplete = oldstream[i].last_msg_incomplete; stcb->asoc.strmout[i].stream_no = i; @@ -11813,8 +11816,9 @@ sctp_send_str_reset_req(struct sctp_tcb /* now the new streams */ stcb->asoc.ss_functions.sctp_ss_init(stcb, &stcb->asoc, 1); for (i = stcb->asoc.streamoutcnt; i < (stcb->asoc.streamoutcnt + adding_o); i++) { - stcb->asoc.strmout[i].next_sequence_send = 0x0; TAILQ_INIT(&stcb->asoc.strmout[i].outqueue); + stcb->asoc.strmout[i].chunks_on_queues = 0; + stcb->asoc.strmout[i].next_sequence_send = 0x0; stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL); Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 12:57:45 2013 (r252942) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 13:04:31 2013 (r252943) @@ -4925,6 +4925,13 @@ sctp_free_assoc(struct sctp_inpcb *inp, } /* pending send queue SHOULD be empty */ TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { + if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { + asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; +#ifdef INVARIANTS + } else { + panic("No chunks on the queues for sid %u.", chk->rec.data.stream_number); +#endif + } TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); if (chk->data) { if (so) { @@ -4949,7 +4956,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, } /* sent queue SHOULD be empty */ TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { - if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (chk->sent != SCTP_DATAGRAM_NR_ACKED) { if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; #ifdef INVARIANTS @@ -4977,6 +4984,13 @@ sctp_free_assoc(struct sctp_inpcb *inp, SCTP_DECR_CHK_COUNT(); /* sa_ignore FREED_MEMORY */ } +#ifdef INVARIANTS + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (stcb->asoc.strmout[i].chunks_on_queues > 0) { + panic("%u chunks left for stream %u.", stcb->asoc.strmout[i].chunks_on_queues, i); + } + } +#endif /* control queue MAY not be empty */ TAILQ_FOREACH_SAFE(chk, &asoc->control_send_queue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next); Modified: stable/9/sys/netinet/sctp_timer.c ============================================================================== --- stable/9/sys/netinet/sctp_timer.c Sun Jul 7 12:57:45 2013 (r252942) +++ stable/9/sys/netinet/sctp_timer.c Sun Jul 7 13:04:31 2013 (r252943) @@ -440,7 +440,7 @@ sctp_recover_sent_list(struct sctp_tcb * if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.TSN_seq)) { SCTP_PRINTF("Found chk:%p tsn:%x <= last_acked_seq:%x\n", (void *)chk, chk->rec.data.TSN_seq, asoc->last_acked_seq); - if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (chk->sent != SCTP_DATAGRAM_NR_ACKED) { if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; } Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Jul 7 12:57:45 2013 (r252942) +++ stable/9/sys/netinet/sctputil.c Sun Jul 7 13:04:31 2013 (r252943) @@ -1054,6 +1054,7 @@ sctp_init_asoc(struct sctp_inpcb *m, str */ asoc->strmout[i].next_sequence_send = 0x0; TAILQ_INIT(&asoc->strmout[i].outqueue); + asoc->strmout[i].chunks_on_queues = 0; asoc->strmout[i].stream_no = i; asoc->strmout[i].last_msg_incomplete = 0; asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i], NULL); @@ -3727,7 +3728,7 @@ sctp_report_all_outbound(struct sctp_tcb TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); asoc->sent_queue_cnt--; - if (chk->sent != SCTP_DATAGRAM_NR_MARKED) { + if (chk->sent != SCTP_DATAGRAM_NR_ACKED) { if (asoc->strmout[chk->rec.data.stream_number].chunks_on_queues > 0) { asoc->strmout[chk->rec.data.stream_number].chunks_on_queues--; #ifdef INVARIANTS From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 13:07:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C54579E3; Sun, 7 Jul 2013 13:07:43 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B6BBD13A4; Sun, 7 Jul 2013 13:07:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67D7hCi092625; Sun, 7 Jul 2013 13:07:43 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67D7gwQ092619; Sun, 7 Jul 2013 13:07:42 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071307.r67D7gwQ092619@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 13:07:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252944 - in stable/9/sys: netinet netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 13:07:43 -0000 Author: tuexen Date: Sun Jul 7 13:07:42 2013 New Revision: 252944 URL: http://svnweb.freebsd.org/changeset/base/252944 Log: MFC r243186: Add support for SCTP/UDP/IPV6. his completes the support of http://tools.ietf.org/html/draft-ietf-tsvwg-sctp-udp-encaps Modified: stable/9/sys/netinet/sctp_pcb.h stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctputil.c stable/9/sys/netinet/sctputil.h stable/9/sys/netinet6/sctp6_usrreq.c stable/9/sys/netinet6/sctp6_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.h ============================================================================== --- stable/9/sys/netinet/sctp_pcb.h Sun Jul 7 13:04:31 2013 (r252943) +++ stable/9/sys/netinet/sctp_pcb.h Sun Jul 7 13:07:42 2013 (r252944) @@ -144,7 +144,12 @@ struct sctp_tagblock { struct sctp_epinfo { - struct socket *udp_tun_socket; +#ifdef INET + struct socket *udp4_tun_socket; +#endif +#ifdef INET6 + struct socket *udp6_tun_socket; +#endif struct sctpasochead *sctp_asochash; u_long hashasocmark; Modified: stable/9/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.c Sun Jul 7 13:04:31 2013 (r252943) +++ stable/9/sys/netinet/sctp_sysctl.c Sun Jul 7 13:07:42 2013 (r252944) @@ -549,8 +549,6 @@ skip: if ((var) < (min)) { (var) = (min); } \ else if ((var) > (max)) { (var) = (max); } -/* XXX: Remove the #if after tunneling over IPv6 works also on FreeBSD. */ -#if !defined(__FreeBSD__) || defined(INET) static int sysctl_sctp_udp_tunneling_check(SYSCTL_HANDLER_ARGS) { @@ -582,8 +580,6 @@ out: return (error); } -#endif - static int sysctl_sctp_check(SYSCTL_HANDLER_ARGS) @@ -1067,12 +1063,9 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT "Clear SCTP Logging buffer"); #endif -/* XXX: Remove the #if after tunneling over IPv6 works also on FreeBSD. */ -#if !defined(__FreeBSD__) || defined(INET) SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, udp_tunneling_port, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_udp_tunneling_port), 0, sysctl_sctp_udp_tunneling_check, "IU", SCTPCTL_UDP_TUNNELING_PORT_DESC); -#endif SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, enable_sack_immediately, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), 0, sysctl_sctp_check, "IU", Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Jul 7 13:04:31 2013 (r252943) +++ stable/9/sys/netinet/sctputil.c Sun Jul 7 13:07:42 2013 (r252944) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #ifdef INET6 +#include #endif #include #include @@ -48,6 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #ifndef KTR_SCTP @@ -6769,24 +6773,15 @@ sctp_log_trace(uint32_t subsys, const ch } #endif -/* XXX: Remove the #ifdef after tunneling over IPv6 works also on FreeBSD. */ -#ifdef INET -/* We will need to add support - * to bind the ports and such here - * so we can do UDP tunneling. In - * the mean-time, we return error - */ -#include -#include -#include -#ifdef INET6 -#include -#endif - static void sctp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *ignored) { struct ip *iph; + +#ifdef INET6 + struct ip6_hdr *ip6; + +#endif struct mbuf *sp, *last; struct udphdr *uhdr; uint16_t port; @@ -6836,10 +6831,10 @@ sctp_recv_udp_tunneled_packet(struct mbu #endif #ifdef INET6 case IPV6_VERSION >> 4: - /* Not yet supported. */ - goto out; + ip6 = mtod(m, struct ip6_hdr *); + ip6->ip6_plen = htons(ntohs(ip6->ip6_plen) - sizeof(struct udphdr)); + sctp6_input_with_port(&m, &off, port); break; - #endif default: goto out; @@ -6853,19 +6848,22 @@ out: void sctp_over_udp_stop(void) { - struct socket *sop; - /* * This function assumes sysctl caller holds sctp_sysctl_info_lock() * for writting! */ - if (SCTP_BASE_INFO(udp_tun_socket) == NULL) { - /* Nothing to do */ - return; +#ifdef INET + if (SCTP_BASE_INFO(udp4_tun_socket) != NULL) { + soclose(SCTP_BASE_INFO(udp4_tun_socket)); + SCTP_BASE_INFO(udp4_tun_socket) = NULL; } - sop = SCTP_BASE_INFO(udp_tun_socket); - soclose(sop); - SCTP_BASE_INFO(udp_tun_socket) = NULL; +#endif +#ifdef INET6 + if (SCTP_BASE_INFO(udp6_tun_socket) != NULL) { + soclose(SCTP_BASE_INFO(udp6_tun_socket)); + SCTP_BASE_INFO(udp6_tun_socket) = NULL; + } +#endif } int @@ -6873,53 +6871,83 @@ sctp_over_udp_start(void) { uint16_t port; int ret; + +#ifdef INET struct sockaddr_in sin; - struct socket *sop = NULL; - struct thread *th; - struct ucred *cred; +#endif +#ifdef INET6 + struct sockaddr_in6 sin6; + +#endif /* * This function assumes sysctl caller holds sctp_sysctl_info_lock() * for writting! */ port = SCTP_BASE_SYSCTL(sctp_udp_tunneling_port); - if (port == 0) { + if (ntohs(port) == 0) { /* Must have a port set */ return (EINVAL); } - if (SCTP_BASE_INFO(udp_tun_socket) != NULL) { +#ifdef INET + if (SCTP_BASE_INFO(udp4_tun_socket) != NULL) { + /* Already running -- must stop first */ + return (EALREADY); + } +#endif +#ifdef INET6 + if (SCTP_BASE_INFO(udp6_tun_socket) != NULL) { /* Already running -- must stop first */ return (EALREADY); } - th = curthread; - cred = th->td_ucred; - if ((ret = socreate(PF_INET, &sop, - SOCK_DGRAM, IPPROTO_UDP, cred, th))) { +#endif +#ifdef INET + if ((ret = socreate(PF_INET, &SCTP_BASE_INFO(udp4_tun_socket), + SOCK_DGRAM, IPPROTO_UDP, + curthread->td_ucred, curthread))) { + sctp_over_udp_stop(); return (ret); } - SCTP_BASE_INFO(udp_tun_socket) = sop; - /* call the special UDP hook */ - ret = udp_set_kernel_tunneling(sop, sctp_recv_udp_tunneled_packet); - if (ret) { - goto exit_stage_left; - } - /* Ok we have a socket, bind it to the port */ - memset(&sin, 0, sizeof(sin)); - sin.sin_len = sizeof(sin); + /* Call the special UDP hook. */ + if ((ret = udp_set_kernel_tunneling(SCTP_BASE_INFO(udp4_tun_socket), + sctp_recv_udp_tunneled_packet))) { + sctp_over_udp_stop(); + return (ret); + } + /* Ok, we have a socket, bind it to the port. */ + memset(&sin, 0, sizeof(struct sockaddr_in)); + sin.sin_len = sizeof(struct sockaddr_in); sin.sin_family = AF_INET; sin.sin_port = htons(port); - ret = sobind(sop, (struct sockaddr *)&sin, th); - if (ret) { - /* Close up we cant get the port */ -exit_stage_left: + if ((ret = sobind(SCTP_BASE_INFO(udp4_tun_socket), + (struct sockaddr *)&sin, curthread))) { sctp_over_udp_stop(); return (ret); } - /* - * Ok we should now get UDP packets directly to our input routine - * sctp_recv_upd_tunneled_packet(). - */ +#endif +#ifdef INET6 + if ((ret = socreate(PF_INET6, &SCTP_BASE_INFO(udp6_tun_socket), + SOCK_DGRAM, IPPROTO_UDP, + curthread->td_ucred, curthread))) { + sctp_over_udp_stop(); + return (ret); + } + /* Call the special UDP hook. */ + if ((ret = udp_set_kernel_tunneling(SCTP_BASE_INFO(udp6_tun_socket), + sctp_recv_udp_tunneled_packet))) { + sctp_over_udp_stop(); + return (ret); + } + /* Ok, we have a socket, bind it to the port. */ + memset(&sin6, 0, sizeof(struct sockaddr_in6)); + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_family = AF_INET6; + sin6.sin6_port = htons(port); + if ((ret = sobind(SCTP_BASE_INFO(udp6_tun_socket), + (struct sockaddr *)&sin6, curthread))) { + sctp_over_udp_stop(); + return (ret); + } +#endif return (0); } - -#endif Modified: stable/9/sys/netinet/sctputil.h ============================================================================== --- stable/9/sys/netinet/sctputil.h Sun Jul 7 13:04:31 2013 (r252943) +++ stable/9/sys/netinet/sctputil.h Sun Jul 7 13:07:42 2013 (r252944) @@ -323,13 +323,9 @@ do { \ } while (0) /* functions to start/stop udp tunneling */ -/* XXX: Remove the #ifdef after tunneling over IPv6 works also on FreeBSD. */ -#ifdef INET void sctp_over_udp_stop(void); int sctp_over_udp_start(void); -#endif - int sctp_soreceive(struct socket *so, struct sockaddr **psa, struct uio *uio, Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sun Jul 7 13:04:31 2013 (r252943) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sun Jul 7 13:07:42 2013 (r252944) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); extern struct protosw inetsw[]; int -sctp6_input(struct mbuf **i_pak, int *offp, int proto) +sctp6_input_with_port(struct mbuf **i_pak, int *offp, uint16_t port) { struct mbuf *m; int iphlen; @@ -84,7 +84,6 @@ sctp6_input(struct mbuf **i_pak, int *of #endif uint32_t mflowid; uint8_t use_mflowid; - uint16_t port = 0; iphlen = *offp; if (SCTP_GET_PKT_VRFID(*i_pak, vrf_id)) { @@ -195,6 +194,12 @@ out: } +int +sctp6_input(struct mbuf **i_pak, int *offp, int proto SCTP_UNUSED) +{ + return (sctp6_input_with_port(i_pak, offp, 0)); +} + static void sctp6_notify_mbuf(struct sctp_inpcb *inp, struct icmp6_hdr *icmp6, struct sctphdr *sh, struct sctp_tcb *stcb, struct sctp_nets *net) Modified: stable/9/sys/netinet6/sctp6_var.h ============================================================================== --- stable/9/sys/netinet6/sctp6_var.h Sun Jul 7 13:04:31 2013 (r252943) +++ stable/9/sys/netinet6/sctp6_var.h Sun Jul 7 13:07:42 2013 (r252944) @@ -42,6 +42,7 @@ SYSCTL_DECL(_net_inet6_sctp6); extern struct pr_usrreqs sctp6_usrreqs; int sctp6_input(struct mbuf **, int *, int); +int sctp6_input_with_port(struct mbuf **, int *, uint16_t); int sctp6_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct proc *); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 13:09:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 48B7EB23; Sun, 7 Jul 2013 13:09:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3982E13AF; Sun, 7 Jul 2013 13:09:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67D9IO4092921; Sun, 7 Jul 2013 13:09:18 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67D9IRY092920; Sun, 7 Jul 2013 13:09:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071309.r67D9IRY092920@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 13:09:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252945 - stable/9/lib/libc/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 13:09:18 -0000 Author: tuexen Date: Sun Jul 7 13:09:17 2013 New Revision: 252945 URL: http://svnweb.freebsd.org/changeset/base/252945 Log: MFC r243300: Fix the handling of mapped IPv6 addresses in sctp_connectx(). Modified: stable/9/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/9/lib/libc/net/sctp_sys_calls.c Sun Jul 7 13:07:42 2013 (r252944) +++ stable/9/lib/libc/net/sctp_sys_calls.c Sun Jul 7 13:09:17 2013 (r252945) @@ -202,7 +202,6 @@ sctp_connectx(int sd, const struct socka return (-1); } if (IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)at)->sin6_addr)) { - len += sizeof(struct sockaddr_in); in6_sin6_2_sin((struct sockaddr_in *)cpto, (struct sockaddr_in6 *)at); cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in)); len += sizeof(struct sockaddr_in); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 13:10:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7DEE4D2E; Sun, 7 Jul 2013 13:10:32 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 602EC13BA; Sun, 7 Jul 2013 13:10:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67DAV0W093294; Sun, 7 Jul 2013 13:10:31 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67DAVui093293; Sun, 7 Jul 2013 13:10:31 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071310.r67DAVui093293@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 13:10:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252946 - stable/9/lib/libc/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 13:10:32 -0000 Author: tuexen Date: Sun Jul 7 13:10:31 2013 New Revision: 252946 URL: http://svnweb.freebsd.org/changeset/base/252946 Log: MFC r243302: Cleanup the code a bit, which improves the portability. Modified: stable/9/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/9/lib/libc/net/sctp_sys_calls.c Sun Jul 7 13:09:17 2013 (r252945) +++ stable/9/lib/libc/net/sctp_sys_calls.c Sun Jul 7 13:10:31 2013 (r252946) @@ -188,15 +188,18 @@ sctp_connectx(int sd, const struct socka cpto = ((caddr_t)buf + sizeof(int)); /* validate all the addresses and get the size */ for (i = 0; i < addrcnt; i++) { - if (at->sa_family == AF_INET) { + switch (at->sa_family) { + case AF_INET: if (at->sa_len != sizeof(struct sockaddr_in)) { errno = EINVAL; return (-1); } - memcpy(cpto, at, at->sa_len); - cpto = ((caddr_t)cpto + at->sa_len); - len += at->sa_len; - } else if (at->sa_family == AF_INET6) { + memcpy(cpto, at, sizeof(struct sockaddr_in)); + cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in)); + len += sizeof(struct sockaddr_in); + at = (struct sockaddr *)((caddr_t)at + sizeof(struct sockaddr_in)); + break; + case AF_INET6: if (at->sa_len != sizeof(struct sockaddr_in6)) { errno = EINVAL; return (-1); @@ -206,11 +209,13 @@ sctp_connectx(int sd, const struct socka cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in)); len += sizeof(struct sockaddr_in); } else { - memcpy(cpto, at, at->sa_len); - cpto = ((caddr_t)cpto + at->sa_len); - len += at->sa_len; + memcpy(cpto, at, sizeof(struct sockaddr_in6)); + cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in6)); + len += sizeof(struct sockaddr_in6); } - } else { + at = (struct sockaddr *)((caddr_t)at + sizeof(struct sockaddr_in6)); + break; + default: errno = EINVAL; return (-1); } @@ -219,7 +224,6 @@ sctp_connectx(int sd, const struct socka errno = E2BIG; return (-1); } - at = (struct sockaddr *)((caddr_t)at + at->sa_len); cnt++; } /* do we have any? */ @@ -260,56 +264,57 @@ sctp_bindx(int sd, struct sockaddr *addr errno = EINVAL; return (-1); } - argsz = (sizeof(struct sockaddr_storage) + - sizeof(struct sctp_getaddresses)); - gaddrs = (struct sctp_getaddresses *)calloc(1, argsz); - if (gaddrs == NULL) { - errno = ENOMEM; - return (-1); - } /* First pre-screen the addresses */ sa = addrs; for (i = 0; i < addrcnt; i++) { - if (sa->sa_family == AF_INET) { - if (sa->sa_len != sizeof(struct sockaddr_in)) - goto out_error; + switch (sa->sa_family) { + case AF_INET: + if (sa->sa_len != sizeof(struct sockaddr_in)) { + errno = EINVAL; + return (-1); + } sin = (struct sockaddr_in *)sa; if (sin->sin_port) { /* non-zero port, check or save */ if (sport) { /* Check against our port */ if (sport != sin->sin_port) { - goto out_error; + errno = EINVAL; + return (-1); } } else { /* save off the port */ sport = sin->sin_port; } } - } else if (sa->sa_family == AF_INET6) { - if (sa->sa_len != sizeof(struct sockaddr_in6)) - goto out_error; + break; + case AF_INET6: + if (sa->sa_len != sizeof(struct sockaddr_in6)) { + errno = EINVAL; + return (-1); + } sin6 = (struct sockaddr_in6 *)sa; if (sin6->sin6_port) { /* non-zero port, check or save */ if (sport) { /* Check against our port */ if (sport != sin6->sin6_port) { - goto out_error; + errno = EINVAL; + return (-1); } } else { /* save off the port */ sport = sin6->sin6_port; } } - } else { - /* invalid address family specified */ - goto out_error; + break; + default: + /* Invalid address family specified. */ + errno = EINVAL; + return (-1); } - sa = (struct sockaddr *)((caddr_t)sa + sa->sa_len); } - sa = addrs; /* * Now if there was a port mentioned, assure that the first address * has that port to make sure it fails or succeeds correctly. @@ -318,20 +323,14 @@ sctp_bindx(int sd, struct sockaddr *addr sin = (struct sockaddr_in *)sa; sin->sin_port = sport; } + argsz = sizeof(struct sctp_getaddresses) + + sizeof(struct sockaddr_storage); + if ((gaddrs = (struct sctp_getaddresses *)malloc(argsz)) == NULL) { + errno = ENOMEM; + return (-1); + } + sa = addrs; for (i = 0; i < addrcnt; i++) { - if (sa->sa_family == AF_INET) { - if (sa->sa_len != sizeof(struct sockaddr_in)) - goto out_error; - } else if (sa->sa_family == AF_INET6) { - if (sa->sa_len != sizeof(struct sockaddr_in6)) - goto out_error; - } else { - /* invalid address family specified */ - out_error: - free(gaddrs); - errno = EINVAL; - return (-1); - } memset(gaddrs, 0, argsz); gaddrs->sget_assoc_id = 0; memcpy(gaddrs->addr, sa, sa->sa_len); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 13:13:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4B11CE80; Sun, 7 Jul 2013 13:13:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D6B4144D; Sun, 7 Jul 2013 13:13:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67DDg4V095429; Sun, 7 Jul 2013 13:13:42 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67DDfaa095426; Sun, 7 Jul 2013 13:13:41 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071313.r67DDfaa095426@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 13:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252947 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 13:13:42 -0000 Author: tuexen Date: Sun Jul 7 13:13:41 2013 New Revision: 252947 URL: http://svnweb.freebsd.org/changeset/base/252947 Log: MFC r243516: Remove unused function. Modified: stable/9/sys/netinet/sctp_peeloff.c stable/9/sys/netinet/sctp_peeloff.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/9/sys/netinet/sctp_peeloff.c Sun Jul 7 13:10:31 2013 (r252946) +++ stable/9/sys/netinet/sctp_peeloff.c Sun Jul 7 13:13:41 2013 (r252947) @@ -151,103 +151,3 @@ sctp_do_peeloff(struct socket *head, str return (0); } - - -struct socket * -sctp_get_peeloff(struct socket *head, sctp_assoc_t assoc_id, int *error) -{ - struct socket *newso; - struct sctp_inpcb *inp, *n_inp; - struct sctp_tcb *stcb; - - SCTPDBG(SCTP_DEBUG_PEEL1, "SCTP peel-off called\n"); - inp = (struct sctp_inpcb *)head->so_pcb; - if (inp == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, EFAULT); - *error = EFAULT; - return (NULL); - } - stcb = sctp_findassociation_ep_asocid(inp, assoc_id, 1); - if (stcb == NULL) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, ENOTCONN); - *error = ENOTCONN; - return (NULL); - } - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - CURVNET_SET(head->so_vnet); - newso = sonewconn(head, SS_ISCONNECTED - ); - CURVNET_RESTORE(); - if (newso == NULL) { - SCTPDBG(SCTP_DEBUG_PEEL1, "sctp_peeloff:sonewconn failed\n"); - SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_PEELOFF, ENOMEM); - *error = ENOMEM; - atomic_subtract_int(&stcb->asoc.refcnt, 1); - return (NULL); - - } - SCTP_TCB_LOCK(stcb); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - n_inp = (struct sctp_inpcb *)newso->so_pcb; - SOCK_LOCK(head); - n_inp->sctp_flags = (SCTP_PCB_FLAGS_UDPTYPE | - SCTP_PCB_FLAGS_CONNECTED | - SCTP_PCB_FLAGS_IN_TCPPOOL | /* Turn on Blocking IO */ - (SCTP_PCB_COPY_FLAGS & inp->sctp_flags)); - n_inp->sctp_features = inp->sctp_features; - n_inp->sctp_frag_point = inp->sctp_frag_point; - n_inp->sctp_cmt_on_off = inp->sctp_cmt_on_off; - n_inp->sctp_ecn_enable = inp->sctp_ecn_enable; - n_inp->partial_delivery_point = inp->partial_delivery_point; - n_inp->sctp_context = inp->sctp_context; - n_inp->local_strreset_support = inp->local_strreset_support; - n_inp->inp_starting_point_for_iterator = NULL; - - /* copy in the authentication parameters from the original endpoint */ - if (n_inp->sctp_ep.local_hmacs) - sctp_free_hmaclist(n_inp->sctp_ep.local_hmacs); - n_inp->sctp_ep.local_hmacs = - sctp_copy_hmaclist(inp->sctp_ep.local_hmacs); - if (n_inp->sctp_ep.local_auth_chunks) - sctp_free_chunklist(n_inp->sctp_ep.local_auth_chunks); - n_inp->sctp_ep.local_auth_chunks = - sctp_copy_chunklist(inp->sctp_ep.local_auth_chunks); - (void)sctp_copy_skeylist(&inp->sctp_ep.shared_keys, - &n_inp->sctp_ep.shared_keys); - - n_inp->sctp_socket = newso; - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE)) { - sctp_feature_off(n_inp, SCTP_PCB_FLAGS_AUTOCLOSE); - n_inp->sctp_ep.auto_close_time = 0; - sctp_timer_stop(SCTP_TIMER_TYPE_AUTOCLOSE, n_inp, stcb, NULL, - SCTP_FROM_SCTP_PEELOFF + SCTP_LOC_1); - } - /* Turn off any non-blocking semantic. */ - SCTP_CLEAR_SO_NBIO(newso); - newso->so_state |= SS_ISCONNECTED; - /* We remove it right away */ - -#ifdef SCTP_LOCK_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOCK_LOGGING_ENABLE) { - sctp_log_lock(inp, (struct sctp_tcb *)NULL, SCTP_LOG_LOCK_SOCK); - } -#endif - TAILQ_REMOVE(&head->so_comp, newso, so_list); - head->so_qlen--; - SOCK_UNLOCK(head); - /* - * Now we must move it from one hash table to another and get the - * stcb in the right place. - */ - sctp_move_pcb_and_assoc(inp, n_inp, stcb); - atomic_add_int(&stcb->asoc.refcnt, 1); - SCTP_TCB_UNLOCK(stcb); - /* - * And now the final hack. We move data in the pending side i.e. - * head to the new socket buffer. Let the GRUBBING begin :-0 - */ - sctp_pull_off_control_to_new_inp(inp, n_inp, stcb, SBL_WAIT); - atomic_subtract_int(&stcb->asoc.refcnt, 1); - return (newso); -} Modified: stable/9/sys/netinet/sctp_peeloff.h ============================================================================== --- stable/9/sys/netinet/sctp_peeloff.h Sun Jul 7 13:10:31 2013 (r252946) +++ stable/9/sys/netinet/sctp_peeloff.h Sun Jul 7 13:13:41 2013 (r252947) @@ -35,18 +35,9 @@ __FBSDID("$FreeBSD$"); #ifndef _NETINET_SCTP_PEELOFF_H_ #define _NETINET_SCTP_PEELOFF_H_ - - - - #if defined(_KERNEL) - int sctp_can_peel_off(struct socket *, sctp_assoc_t); int sctp_do_peeloff(struct socket *, struct socket *, sctp_assoc_t); -struct socket *sctp_get_peeloff(struct socket *, sctp_assoc_t, int *); - - #endif /* _KERNEL */ - -#endif +#endif /* _NETINET_SCTP_PEELOFF_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 13:15:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E9164FD2; Sun, 7 Jul 2013 13:15:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DB8C4146B; Sun, 7 Jul 2013 13:15:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67DFuCV095796; Sun, 7 Jul 2013 13:15:56 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67DFuFn095795; Sun, 7 Jul 2013 13:15:56 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071315.r67DFuFn095795@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 13:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252948 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 13:15:57 -0000 Author: tuexen Date: Sun Jul 7 13:15:56 2013 New Revision: 252948 URL: http://svnweb.freebsd.org/changeset/base/252948 Log: MFC r243558: Allow shutdown() to be used on fds returned from sctp_peeloff(). Modified: stable/9/sys/netinet/sctp_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Sun Jul 7 13:13:41 2013 (r252947) +++ stable/9/sys/netinet/sctp_usrreq.c Sun Jul 7 13:15:56 2013 (r252948) @@ -971,7 +971,8 @@ sctp_shutdown(struct socket *so) } SCTP_INP_RLOCK(inp); /* For UDP model this is a invalid call */ - if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { + if (!((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { /* Restore the flags that the soshutdown took away. */ SOCKBUF_LOCK(&so->so_rcv); so->so_rcv.sb_state &= ~SBS_CANTRCVMORE; From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 13:18:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8ECF227F; Sun, 7 Jul 2013 13:18:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 811451493; Sun, 7 Jul 2013 13:18:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67DIJkb096112; Sun, 7 Jul 2013 13:18:19 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67DIJbf096111; Sun, 7 Jul 2013 13:18:19 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071318.r67DIJbf096111@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 13:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252949 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 13:18:19 -0000 Author: tuexen Date: Sun Jul 7 13:18:19 2013 New Revision: 252949 URL: http://svnweb.freebsd.org/changeset/base/252949 Log: MFC r243564: Find the endpoint for an incoming packet also if the endpoint comes from sctp_peeloff(). Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 13:15:56 2013 (r252948) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 13:18:19 2013 (r252949) @@ -1226,7 +1226,8 @@ sctp_findassociation_ep_addr(struct sctp SCTP_TCB_UNLOCK(locked_tcb); } SCTP_INP_INFO_RLOCK(); - if (inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || + (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { /*- * Now either this guy is our listener or it's the * connector. If it is the one that issued the connect, then From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 13:20:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 45FF941D; Sun, 7 Jul 2013 13:20:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 38D2C15CA; Sun, 7 Jul 2013 13:20:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67DKapb097887; Sun, 7 Jul 2013 13:20:36 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67DKac5097886; Sun, 7 Jul 2013 13:20:36 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071320.r67DKac5097886@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 13:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252950 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 13:20:36 -0000 Author: tuexen Date: Sun Jul 7 13:20:35 2013 New Revision: 252950 URL: http://svnweb.freebsd.org/changeset/base/252950 Log: MFC r243565: Add support for sctp_peeloff() also in the front states of the association. Modified: stable/9/sys/netinet/sctp_peeloff.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_peeloff.c ============================================================================== --- stable/9/sys/netinet/sctp_peeloff.c Sun Jul 7 13:18:19 2013 (r252949) +++ stable/9/sys/netinet/sctp_peeloff.c Sun Jul 7 13:20:35 2013 (r252950) @@ -74,9 +74,7 @@ sctp_can_peel_off(struct socket *head, s } state = SCTP_GET_STATE((&stcb->asoc)); if ((state == SCTP_STATE_EMPTY) || - (state == SCTP_STATE_INUSE) || - (state == SCTP_STATE_COOKIE_WAIT) || - (state == SCTP_STATE_COOKIE_ECHOED)) { + (state == SCTP_STATE_INUSE)) { SCTP_TCB_UNLOCK(stcb); SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_PEELOFF, ENOTCONN); return (ENOTCONN); @@ -105,9 +103,7 @@ sctp_do_peeloff(struct socket *head, str } state = SCTP_GET_STATE((&stcb->asoc)); if ((state == SCTP_STATE_EMPTY) || - (state == SCTP_STATE_INUSE) || - (state == SCTP_STATE_COOKIE_WAIT) || - (state == SCTP_STATE_COOKIE_ECHOED)) { + (state == SCTP_STATE_INUSE)) { SCTP_TCB_UNLOCK(stcb); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PEELOFF, ENOTCONN); return (ENOTCONN); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 14:14:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 583C5A63; Sun, 7 Jul 2013 14:14:46 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 454011700; Sun, 7 Jul 2013 14:14:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67EEjuU013297; Sun, 7 Jul 2013 14:14:45 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67EEjh1013292; Sun, 7 Jul 2013 14:14:45 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307071414.r67EEjh1013292@svn.freebsd.org> From: Lawrence Stewart Date: Sun, 7 Jul 2013 14:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252951 - in stable/9: share/man/man4 sys/modules/cc sys/modules/cc/cc_cdg sys/netinet/cc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 14:14:46 -0000 Author: lstewart Date: Sun Jul 7 14:14:44 2013 New Revision: 252951 URL: http://svnweb.freebsd.org/changeset/base/252951 Log: MFC r252504: Import an implementation of the CAIA Delay-Gradient (CDG) congestion control algorithm, which is based on the 2011 v0.1 patch release and described in the paper "Revisiting TCP Congestion Control using Delay Gradients" by David Hayes and Grenville Armitage. It is implemented as a kernel module compatible with the modular congestion control framework. CDG is a hybrid congestion control algorithm which reacts to both packet loss and inferred queuing delay. It attempts to operate as a delay-based algorithm where possible, but utilises heuristics to detect loss-based TCP cross traffic and will compete effectively as required. CDG is therefore incrementally deployable and suitable for use on shared networks. In collaboration with: David Hayes and Grenville Armitage Sponsored by: Cisco University Research Program and FreeBSD Foundation Added: stable/9/share/man/man4/cc_cdg.4 - copied unchanged from r252504, head/share/man/man4/cc_cdg.4 stable/9/sys/modules/cc/cc_cdg/ - copied from r252504, head/sys/modules/cc/cc_cdg/ stable/9/sys/netinet/cc/cc_cdg.c - copied unchanged from r252504, head/sys/netinet/cc/cc_cdg.c Modified: stable/9/share/man/man4/Makefile stable/9/sys/modules/cc/Makefile Directory Properties: stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Sun Jul 7 13:20:35 2013 (r252950) +++ stable/9/share/man/man4/Makefile Sun Jul 7 14:14:44 2013 (r252951) @@ -76,6 +76,7 @@ MAN= aac.4 \ cardbus.4 \ carp.4 \ cas.4 \ + cc_cdg.4 \ cc_chd.4 \ cc_cubic.4 \ cc_hd.4 \ Copied: stable/9/share/man/man4/cc_cdg.4 (from r252504, head/share/man/man4/cc_cdg.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man4/cc_cdg.4 Sun Jul 7 14:14:44 2013 (r252951, copy of r252504, head/share/man/man4/cc_cdg.4) @@ -0,0 +1,155 @@ +.\" +.\" Copyright (c) 2013 Swinburne University of Technology, Melbourne, Australia +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 2, 2013 +.Dt CC_CDG 4 +.Os +.Sh NAME +.Nm cc_cdg +.Nd CDG Congestion Control Algorithm +.Sh DESCRIPTION +CAIA-Delay Gradient (CDG) is a hybrid congestion control algorithm which reacts +to both packet loss and inferred queuing delay. +It attempts to operate as a delay-based algorithm where possible, but utilises +heuristics to detect loss-based TCP cross traffic and will compete effectively +as required. +CDG is therefore incrementally deployable and suitable for use on shared +networks. +.Pp +During delay-based operation, CDG uses a delay-gradient based probabilistic +backoff mechanism, and will also try to infer non congestion related +packet losses and avoid backing off when they occur. +During loss-based operation, CDG essentially reverts to +.Xr cc_newreno 4 Ns - Ns like +behaviour. +.Pp +CDG switches to loss-based operation when it detects that a configurable number +of consecutive delay-based backoffs have had no measurable effect. +It periodically attempts to return to delay-based operation, but will keep +switching back to loss-based operation as required. +.Sh MIB Variables +The algorithm exposes the following variables in the +.Va net.inet.tcp.cc.cdg +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va exp_backoff_scale" +.It Va version +Current algorithm/implementation version number. +.It Va beta_delay +Delay-based window decrease factor as a percentage (on delay-based backoff, w = +w * beta_delay / 100). +Default is 70. +.It Va beta_loss +Loss-based window decrease factor as a percentage (on loss-based backoff, w = +w * beta_loss / 100). +Default is 50. +.It Va exp_backoff_scale +Scaling parameter for the probabilistic exponential backoff. +Default is 2. +.It Va smoothing_factor +Number of samples used for moving average smoothing (0 means no smoothing). +Default is 8. +.It Va loss_compete_consec_cong +Number of consecutive delay-gradient based congestion episodes which will +trigger loss-based CC compatibility. +Default is 5. +.It Va loss_compete_hold_backoff +Number of consecutive delay-gradient based congestion episodes to hold the +window backoff for loss-based CC compatibility. +Default is 5. +.It Va alpha_inc +If non-zero, this enables an experimental mode where CDG's window increase +factor (alpha) is increased by 1 MSS every +.Va alpha_inc +RTTs during congestion avoidance mode. +(Setting +.Va alpha_inc +to 1 results in the most aggressive growth of the window increase factor over +time. +Use higher +.Va alpha_inc +values for slower growth.) +Default is 0. +.El +.Sh SEE ALSO +.Xr cc_chd 4 , +.Xr cc_cubic 4 , +.Xr cc_hd 4 , +.Xr cc_htcp 4 , +.Xr cc_newreno 4 , +.Xr cc_vegas 4 , +.Xr h_ertt 4 , +.Xr mod_cc 4 , +.Xr tcp 4 , +.Xr khelp 9 , +.Xr mod_cc 9 +.Rs +.%A "D. A. Hayes" +.%A "G. Armitage" +.%T "Revisiting TCP Congestion Control using Delay Gradients" +.%J "Networking 2011 Proceedings, Part II" +.%D "May 2011" +.%P "328-341" +.Re +.Rs +.%A "N. Khademi" +.%A "G. Armitage" +.%T "Minimising RTT across homogeneous 802.11 WLANs with CAIA Delay-Gradient TCP (v0.1)" +.%R "CAIA Technical Report 121113A" +.%D "November 2012" +.%U "http://caia.swin.edu.au/reports/121113A/CAIA-TR-121113A.pdf" +.Re +.Sh ACKNOWLEDGEMENTS +Development and testing of this software were made possible in part by grants +from the FreeBSD Foundation and The Cisco University Research Program Fund, a +corporate advised fund of Silicon Valley Community Foundation. +.Sh HISTORY +The +.Nm +congestion control module first appeared in +.Fx 9.2 . +.Pp +The module was first released in 2011 by David Hayes whilst working on the +NewTCP research project at Swinburne University of Technology's Centre for +Advanced Internet Architectures, Melbourne, Australia. +More details are available at: +.Pp +http://caia.swin.edu.au/urp/newtcp/ +.Sh AUTHORS +.An -nosplit +The +.Nm +congestion control module was written by +.An David Hayes Aq david.hayes@ieee.org . +This manual page was written by +.An Lawrence Stewart Aq lstewart@FreeBSD.org +and +.An Grenville Armitage Aq garmitage@swin.edu.au . +.Sh BUGS +The underlying algorithm and parameter values are still a work in progress and +may not be optimal for some network scenarios. Modified: stable/9/sys/modules/cc/Makefile ============================================================================== --- stable/9/sys/modules/cc/Makefile Sun Jul 7 13:20:35 2013 (r252950) +++ stable/9/sys/modules/cc/Makefile Sun Jul 7 14:14:44 2013 (r252951) @@ -1,6 +1,7 @@ # $FreeBSD$ -SUBDIR= cc_chd \ +SUBDIR= cc_cdg \ + cc_chd \ cc_cubic \ cc_hd \ cc_htcp \ Copied: stable/9/sys/netinet/cc/cc_cdg.c (from r252504, head/sys/netinet/cc/cc_cdg.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/netinet/cc/cc_cdg.c Sun Jul 7 14:14:44 2013 (r252951, copy of r252504, head/sys/netinet/cc/cc_cdg.c) @@ -0,0 +1,695 @@ +/*- + * Copyright (c) 2009-2013 + * Swinburne University of Technology, Melbourne, Australia + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University of Technology, by David Hayes, made + * possible in part by a gift from The Cisco University Research Program Fund, + * a corporate advised fund of Silicon Valley Community Foundation. Development + * and testing were further assisted by a grant 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. + */ + +/* + * CAIA Delay-Gradient (CDG) congestion control algorithm + * + * An implemention of the delay-gradient congestion control algorithm proposed + * in the following paper: + * + * D. A. Hayes and G. Armitage, "Revisiting TCP Congestion Control using Delay + * Gradients", in IFIP Networking, Valencia, Spain, 9-13 May 2011. + * + * Developed as part of the NewTCP research project at Swinburne University of + * Technology's Centre for Advanced Internet Architectures, Melbourne, + * Australia. More details are available at: + * http://caia.swin.edu.au/urp/newtcp/ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +#define CDG_VERSION "0.1" + +#define CAST_PTR_INT(X) (*((int*)(X))) + +#ifndef VIMAGE +#define vnet_sysctl_handle_uint(oidp, arg1, arg2, req) \ + sysctl_handle_int(oidp, arg1, arg2, req) +#endif + +/* Private delay-gradient induced congestion control signal. */ +#define CC_CDG_DELAY 0x01000000 + +/* NewReno window deflation factor on loss (as a percentage). */ +#define RENO_BETA 50 + +/* Queue states. */ +#define CDG_Q_EMPTY 1 +#define CDG_Q_RISING 2 +#define CDG_Q_FALLING 3 +#define CDG_Q_FULL 4 +#define CDG_Q_UNKNOWN 9999 + +/* Number of bit shifts used in probexp lookup table. */ +#define EXP_PREC 15 + +/* Largest gradient represented in probexp lookup table. */ +#define MAXGRAD 5 + +/* + * Delay Precision Enhance - number of bit shifts used for qtrend related + * integer arithmetic precision. + */ +#define D_P_E 7 + +struct qdiff_sample { + long qdiff; + STAILQ_ENTRY(qdiff_sample) qdiff_lnk; +}; + +struct cdg { + long max_qtrend; + long min_qtrend; + STAILQ_HEAD(minrtts_head, qdiff_sample) qdiffmin_q; + STAILQ_HEAD(maxrtts_head, qdiff_sample) qdiffmax_q; + long window_incr; + /* rttcount for window increase when in congestion avoidance */ + long rtt_count; + /* maximum measured rtt within an rtt period */ + int maxrtt_in_rtt; + /* maximum measured rtt within prev rtt period */ + int maxrtt_in_prevrtt; + /* minimum measured rtt within an rtt period */ + int minrtt_in_rtt; + /* minimum measured rtt within prev rtt period */ + int minrtt_in_prevrtt; + /* consecutive congestion episode counter */ + uint32_t consec_cong_cnt; + /* when tracking a new reno type loss window */ + uint32_t shadow_w; + /* maximum number of samples in the moving average queue */ + int sample_q_size; + /* number of samples in the moving average queue */ + int num_samples; + /* estimate of the queue state of the path */ + int queue_state; +}; + +/* + * Lookup table for: + * (1 - exp(-x)) << EXP_PREC, where x = [0,MAXGRAD] in 2^-7 increments + * + * Note: probexp[0] is set to 10 (not 0) as a safety for very low increase + * gradients. + */ +static const int probexp[641] = { + 10,255,508,759,1008,1255,1501,1744,1985,2225,2463,2698,2932,3165,3395,3624, + 3850,4075,4299,4520,4740,4958,5175,5389,5602,5814,6024,6232,6438,6643,6846, + 7048,7248,7447,7644,7839,8033,8226,8417,8606,8794,8981,9166,9350,9532,9713, + 9892,10070,10247,10422,10596,10769,10940,11110,11278,11445,11611,11776,11939, + 12101,12262,12422,12580,12737,12893,13048,13201,13354,13505,13655,13803,13951, + 14097,14243,14387,14530,14672,14813,14952,15091,15229,15365,15500,15635,15768, + 15900,16032,16162,16291,16419,16547,16673,16798,16922,17046,17168,17289,17410, + 17529,17648,17766,17882,17998,18113,18227,18340,18453,18564,18675,18784,18893, + 19001,19108,19215,19320,19425,19529,19632,19734,19835,19936,20036,20135,20233, + 20331,20427,20523,20619,20713,20807,20900,20993,21084,21175,21265,21355,21444, + 21532,21619,21706,21792,21878,21962,22046,22130,22213,22295,22376,22457,22537, + 22617,22696,22774,22852,22929,23006,23082,23157,23232,23306,23380,23453,23525, + 23597,23669,23739,23810,23879,23949,24017,24085,24153,24220,24286,24352,24418, + 24483,24547,24611,24675,24738,24800,24862,24924,24985,25045,25106,25165,25224, + 25283,25341,25399,25456,25513,25570,25626,25681,25737,25791,25846,25899,25953, + 26006,26059,26111,26163,26214,26265,26316,26366,26416,26465,26514,26563,26611, + 26659,26707,26754,26801,26847,26893,26939,26984,27029,27074,27118,27162,27206, + 27249,27292,27335,27377,27419,27460,27502,27543,27583,27624,27664,27703,27743, + 27782,27821,27859,27897,27935,27973,28010,28047,28084,28121,28157,28193,28228, + 28263,28299,28333,28368,28402,28436,28470,28503,28536,28569,28602,28634,28667, + 28699,28730,28762,28793,28824,28854,28885,28915,28945,28975,29004,29034,29063, + 29092,29120,29149,29177,29205,29232,29260,29287,29314,29341,29368,29394,29421, + 29447,29472,29498,29524,29549,29574,29599,29623,29648,29672,29696,29720,29744, + 29767,29791,29814,29837,29860,29882,29905,29927,29949,29971,29993,30014,30036, + 30057,30078,30099,30120,30141,30161,30181,30201,30221,30241,30261,30280,30300, + 30319,30338,30357,30376,30394,30413,30431,30449,30467,30485,30503,30521,30538, + 30555,30573,30590,30607,30624,30640,30657,30673,30690,30706,30722,30738,30753, + 30769,30785,30800,30815,30831,30846,30861,30876,30890,30905,30919,30934,30948, + 30962,30976,30990,31004,31018,31031,31045,31058,31072,31085,31098,31111,31124, + 31137,31149,31162,31174,31187,31199,31211,31223,31235,31247,31259,31271,31283, + 31294,31306,31317,31328,31339,31351,31362,31373,31383,31394,31405,31416,31426, + 31436,31447,31457,31467,31477,31487,31497,31507,31517,31527,31537,31546,31556, + 31565,31574,31584,31593,31602,31611,31620,31629,31638,31647,31655,31664,31673, + 31681,31690,31698,31706,31715,31723,31731,31739,31747,31755,31763,31771,31778, + 31786,31794,31801,31809,31816,31824,31831,31838,31846,31853,31860,31867,31874, + 31881,31888,31895,31902,31908,31915,31922,31928,31935,31941,31948,31954,31960, + 31967,31973,31979,31985,31991,31997,32003,32009,32015,32021,32027,32033,32038, + 32044,32050,32055,32061,32066,32072,32077,32083,32088,32093,32098,32104,32109, + 32114,32119,32124,32129,32134,32139,32144,32149,32154,32158,32163,32168,32173, + 32177,32182,32186,32191,32195,32200,32204,32209,32213,32217,32222,32226,32230, + 32234,32238,32242,32247,32251,32255,32259,32263,32267,32270,32274,32278,32282, + 32286,32290,32293,32297,32301,32304,32308,32311,32315,32318,32322,32325,32329, + 32332,32336,32339,32342,32346,32349,32352,32356,32359,32362,32365,32368,32371, + 32374,32377,32381,32384,32387,32389,32392,32395,32398,32401,32404,32407,32410, + 32412,32415,32418,32421,32423,32426,32429,32431,32434,32437,32439,32442,32444, + 32447,32449,32452,32454,32457,32459,32461,32464,32466,32469,32471,32473,32476, + 32478,32480,32482,32485,32487,32489,32491,32493,32495,32497,32500,32502,32504, + 32506,32508,32510,32512,32514,32516,32518,32520,32522,32524,32526,32527,32529, + 32531,32533,32535,32537,32538,32540,32542,32544,32545,32547}; + +static uma_zone_t qdiffsample_zone; + +static MALLOC_DEFINE(M_CDG, "cdg data", + "Per connection data required for the CDG congestion control algorithm"); + +static int ertt_id; + +static VNET_DEFINE(uint32_t, cdg_alpha_inc); +static VNET_DEFINE(uint32_t, cdg_beta_delay); +static VNET_DEFINE(uint32_t, cdg_beta_loss); +static VNET_DEFINE(uint32_t, cdg_smoothing_factor); +static VNET_DEFINE(uint32_t, cdg_exp_backoff_scale); +static VNET_DEFINE(uint32_t, cdg_consec_cong); +static VNET_DEFINE(uint32_t, cdg_hold_backoff); +#define V_cdg_alpha_inc VNET(cdg_alpha_inc) +#define V_cdg_beta_delay VNET(cdg_beta_delay) +#define V_cdg_beta_loss VNET(cdg_beta_loss) +#define V_cdg_smoothing_factor VNET(cdg_smoothing_factor) +#define V_cdg_exp_backoff_scale VNET(cdg_exp_backoff_scale) +#define V_cdg_consec_cong VNET(cdg_consec_cong) +#define V_cdg_hold_backoff VNET(cdg_hold_backoff) + +/* Function prototypes. */ +static int cdg_mod_init(void); +static void cdg_conn_init(struct cc_var *ccv); +static int cdg_cb_init(struct cc_var *ccv); +static void cdg_cb_destroy(struct cc_var *ccv); +static void cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type); +static void cdg_ack_received(struct cc_var *ccv, uint16_t ack_type); + +struct cc_algo cdg_cc_algo = { + .name = "cdg", + .mod_init = cdg_mod_init, + .ack_received = cdg_ack_received, + .cb_destroy = cdg_cb_destroy, + .cb_init = cdg_cb_init, + .conn_init = cdg_conn_init, + .cong_signal = cdg_cong_signal +}; + +/* Vnet created and being initialised. */ +static void +cdg_init_vnet(const void *unused __unused) +{ + + V_cdg_alpha_inc = 0; + V_cdg_beta_delay = 70; + V_cdg_beta_loss = 50; + V_cdg_smoothing_factor = 8; + V_cdg_exp_backoff_scale = 3; + V_cdg_consec_cong = 5; + V_cdg_hold_backoff = 5; +} + +static int +cdg_mod_init(void) +{ + VNET_ITERATOR_DECL(v); + + ertt_id = khelp_get_id("ertt"); + if (ertt_id <= 0) + return (EINVAL); + + qdiffsample_zone = uma_zcreate("cdg_qdiffsample", + sizeof(struct qdiff_sample), NULL, NULL, NULL, NULL, 0, 0); + + VNET_LIST_RLOCK(); + VNET_FOREACH(v) { + CURVNET_SET(v); + cdg_init_vnet(NULL); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); + + cdg_cc_algo.post_recovery = newreno_cc_algo.post_recovery; + cdg_cc_algo.after_idle = newreno_cc_algo.after_idle; + + return (0); +} + +static int +cdg_cb_init(struct cc_var *ccv) +{ + struct cdg *cdg_data; + + cdg_data = malloc(sizeof(struct cdg), M_CDG, M_NOWAIT); + if (cdg_data == NULL) + return (ENOMEM); + + cdg_data->shadow_w = 0; + cdg_data->max_qtrend = 0; + cdg_data->min_qtrend = 0; + cdg_data->queue_state = CDG_Q_UNKNOWN; + cdg_data->maxrtt_in_rtt = 0; + cdg_data->maxrtt_in_prevrtt = 0; + cdg_data->minrtt_in_rtt = INT_MAX; + cdg_data->minrtt_in_prevrtt = 0; + cdg_data->window_incr = 0; + cdg_data->rtt_count = 0; + cdg_data->consec_cong_cnt = 0; + cdg_data->sample_q_size = V_cdg_smoothing_factor; + cdg_data->num_samples = 0; + STAILQ_INIT(&cdg_data->qdiffmin_q); + STAILQ_INIT(&cdg_data->qdiffmax_q); + + ccv->cc_data = cdg_data; + + return (0); +} + +static void +cdg_conn_init(struct cc_var *ccv) +{ + struct cdg *cdg_data = ccv->cc_data; + + /* + * Initialise the shadow_cwnd in case we are competing with loss based + * flows from the start + */ + cdg_data->shadow_w = CCV(ccv, snd_cwnd); +} + +static void +cdg_cb_destroy(struct cc_var *ccv) +{ + struct cdg *cdg_data; + struct qdiff_sample *qds, *qds_n; + + cdg_data = ccv->cc_data; + + qds = STAILQ_FIRST(&cdg_data->qdiffmin_q); + while (qds != NULL) { + qds_n = STAILQ_NEXT(qds, qdiff_lnk); + uma_zfree(qdiffsample_zone,qds); + qds = qds_n; + } + + qds = STAILQ_FIRST(&cdg_data->qdiffmax_q); + while (qds != NULL) { + qds_n = STAILQ_NEXT(qds, qdiff_lnk); + uma_zfree(qdiffsample_zone,qds); + qds = qds_n; + } + + free(ccv->cc_data, M_CDG); +} + +static int +cdg_beta_handler(SYSCTL_HANDLER_ARGS) +{ + + if (req->newptr != NULL && + (CAST_PTR_INT(req->newptr) == 0 || CAST_PTR_INT(req->newptr) > 100)) + return (EINVAL); + + return (vnet_sysctl_handle_uint(oidp, arg1, arg2, req)); +} + +static int +cdg_exp_backoff_scale_handler(SYSCTL_HANDLER_ARGS) +{ + + if (req->newptr != NULL && CAST_PTR_INT(req->newptr) < 1) + return (EINVAL); + + return (vnet_sysctl_handle_uint(oidp, arg1, arg2, req)); +} + +static inline unsigned long +cdg_window_decrease(struct cc_var *ccv, unsigned long owin, unsigned int beta) +{ + + return ((ulmin(CCV(ccv, snd_wnd), owin) * beta) / 100); +} + +/* + * Window increase function + * This window increase function is independent of the initial window size + * to ensure small window flows are not discriminated against (i.e. fairness). + * It increases at 1pkt/rtt like Reno for alpha_inc rtts, and then 2pkts/rtt for + * the next alpha_inc rtts, etc. + */ +static void +cdg_window_increase(struct cc_var *ccv, int new_measurement) +{ + struct cdg *cdg_data; + int incr, s_w_incr; + + cdg_data = ccv->cc_data; + incr = s_w_incr = 0; + + if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh)) { + /* Slow start. */ + incr = CCV(ccv, t_maxseg); + s_w_incr = incr; + cdg_data->window_incr = cdg_data->rtt_count = 0; + } else { + /* Congestion avoidance. */ + if (new_measurement) { + s_w_incr = CCV(ccv, t_maxseg); + if (V_cdg_alpha_inc == 0) { + incr = CCV(ccv, t_maxseg); + } else { + if (++cdg_data->rtt_count >= V_cdg_alpha_inc) { + cdg_data->window_incr++; + cdg_data->rtt_count = 0; + } + incr = CCV(ccv, t_maxseg) * + cdg_data->window_incr; + } + } + } + + if (cdg_data->shadow_w > 0) + cdg_data->shadow_w = ulmin(cdg_data->shadow_w + s_w_incr, + TCP_MAXWIN << CCV(ccv, snd_scale)); + + CCV(ccv, snd_cwnd) = ulmin(CCV(ccv, snd_cwnd) + incr, + TCP_MAXWIN << CCV(ccv, snd_scale)); +} + +static void +cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type) +{ + struct cdg *cdg_data = ccv->cc_data; + + switch(signal_type) { + case CC_CDG_DELAY: + CCV(ccv, snd_ssthresh) = cdg_window_decrease(ccv, + CCV(ccv, snd_cwnd), V_cdg_beta_delay); + CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); + CCV(ccv, snd_recover) = CCV(ccv, snd_max); + cdg_data->window_incr = cdg_data->rtt_count = 0; + ENTER_CONGRECOVERY(CCV(ccv, t_flags)); + break; + case CC_NDUPACK: + /* + * If already responding to congestion OR we have guessed no + * queue in the path is full. + */ + if (IN_CONGRECOVERY(CCV(ccv, t_flags)) || + cdg_data->queue_state < CDG_Q_FULL) { + CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd); + CCV(ccv, snd_recover) = CCV(ccv, snd_max); + } else { + /* + * Loss is likely to be congestion related. We have + * inferred a queue full state, so have shadow window + * react to loss as NewReno would. + */ + if (cdg_data->shadow_w > 0) + cdg_data->shadow_w = cdg_window_decrease(ccv, + cdg_data->shadow_w, RENO_BETA); + + CCV(ccv, snd_ssthresh) = ulmax(cdg_data->shadow_w, + cdg_window_decrease(ccv, CCV(ccv, snd_cwnd), + V_cdg_beta_loss)); + + cdg_data->window_incr = cdg_data->rtt_count = 0; + } + ENTER_RECOVERY(CCV(ccv, t_flags)); + break; + default: + newreno_cc_algo.cong_signal(ccv, signal_type); + break; + } +} + +/* + * Using a negative exponential probabilistic backoff so that sources with + * varying RTTs which share the same link will, on average, have the same + * probability of backoff over time. + * + * Prob_backoff = 1 - exp(-qtrend / V_cdg_exp_backoff_scale), where + * V_cdg_exp_backoff_scale is the average qtrend for the exponential backoff. + */ +static inline int +prob_backoff(long qtrend) +{ + int backoff, idx, p; + + backoff = (qtrend > ((MAXGRAD * V_cdg_exp_backoff_scale) << D_P_E)); + + if (!backoff) { + if (V_cdg_exp_backoff_scale > 1) + idx = (qtrend + V_cdg_exp_backoff_scale / 2) / + V_cdg_exp_backoff_scale; + else + idx = qtrend; + + /* Backoff probability proportional to rate of queue growth. */ + p = (INT_MAX / (1 << EXP_PREC)) * probexp[idx]; + backoff = (random() < p); + } + + return (backoff); +} + +static inline void +calc_moving_average(struct cdg *cdg_data, long qdiff_max, long qdiff_min) +{ + struct qdiff_sample *qds; + + ++cdg_data->num_samples; + if (cdg_data->num_samples > cdg_data->sample_q_size) { + /* Minimum RTT. */ + qds = STAILQ_FIRST(&cdg_data->qdiffmin_q); + cdg_data->min_qtrend = cdg_data->min_qtrend + + (qdiff_min - qds->qdiff) / cdg_data->sample_q_size; + STAILQ_REMOVE_HEAD(&cdg_data->qdiffmin_q, qdiff_lnk); + qds->qdiff = qdiff_min; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmin_q, qds, qdiff_lnk); + + /* Maximum RTT. */ + qds = STAILQ_FIRST(&cdg_data->qdiffmax_q); + cdg_data->max_qtrend = cdg_data->max_qtrend + + (qdiff_max - qds->qdiff) / cdg_data->sample_q_size; + STAILQ_REMOVE_HEAD(&cdg_data->qdiffmax_q, qdiff_lnk); + qds->qdiff = qdiff_max; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmax_q, qds, qdiff_lnk); + --cdg_data->num_samples; + } else { + qds = uma_zalloc(qdiffsample_zone, M_NOWAIT); + if (qds != NULL) { + cdg_data->min_qtrend = cdg_data->min_qtrend + + qdiff_min / cdg_data->sample_q_size; + qds->qdiff = qdiff_min; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmin_q, qds, + qdiff_lnk); + } + + qds = uma_zalloc(qdiffsample_zone, M_NOWAIT); + if (qds) { + cdg_data->max_qtrend = cdg_data->max_qtrend + + qdiff_max / cdg_data->sample_q_size; + qds->qdiff = qdiff_max; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmax_q, qds, + qdiff_lnk); + } + } +} + +static void +cdg_ack_received(struct cc_var *ccv, uint16_t ack_type) +{ + struct cdg *cdg_data; + struct ertt *e_t; + long qdiff_max, qdiff_min; + int congestion, new_measurement, slowstart; + + cdg_data = ccv->cc_data; + e_t = (struct ertt *)khelp_get_osd(CCV(ccv, osd), ertt_id); + new_measurement = e_t->flags & ERTT_NEW_MEASUREMENT; + congestion = 0; + cdg_data->maxrtt_in_rtt = imax(e_t->rtt, cdg_data->maxrtt_in_rtt); + cdg_data->minrtt_in_rtt = imin(e_t->rtt, cdg_data->minrtt_in_rtt); + + if (new_measurement) { + slowstart = (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh)); + /* + * Update smoothed gradient measurements. Since we are only + * using one measurement per RTT, use max or min rtt_in_rtt. + * This is also less noisy than a sample RTT measurement. Max + * RTT measurements can have trouble due to OS issues. + */ + if (cdg_data->maxrtt_in_prevrtt) { + qdiff_max = ((long)(cdg_data->maxrtt_in_rtt - + cdg_data->maxrtt_in_prevrtt) << D_P_E ); + qdiff_min = ((long)(cdg_data->minrtt_in_rtt - + cdg_data->minrtt_in_prevrtt) << D_P_E ); + + calc_moving_average(cdg_data, qdiff_max, qdiff_min); + + /* Probabilistic backoff with respect to gradient. */ + if (slowstart && qdiff_min > 0) + congestion = prob_backoff(qdiff_min); + else if (cdg_data->min_qtrend > 0) + congestion = prob_backoff(cdg_data->min_qtrend); + else if (slowstart && qdiff_max > 0) + congestion = prob_backoff(qdiff_max); + else if (cdg_data->max_qtrend > 0) + congestion = prob_backoff(cdg_data->max_qtrend); + + /* Update estimate of queue state. */ + if (cdg_data->min_qtrend > 0 && + cdg_data->max_qtrend <= 0) { + cdg_data->queue_state = CDG_Q_FULL; + } else if (cdg_data->min_qtrend >= 0 && + cdg_data->max_qtrend < 0) { + cdg_data->queue_state = CDG_Q_EMPTY; + cdg_data->shadow_w = 0; + } else if (cdg_data->min_qtrend > 0 && + cdg_data->max_qtrend > 0) { + cdg_data->queue_state = CDG_Q_RISING; + } else if (cdg_data->min_qtrend < 0 && + cdg_data->max_qtrend < 0) { + cdg_data->queue_state = CDG_Q_FALLING; + } + + if (cdg_data->min_qtrend < 0 || + cdg_data->max_qtrend < 0) + cdg_data->consec_cong_cnt = 0; + } + + cdg_data->minrtt_in_prevrtt = cdg_data->minrtt_in_rtt; + cdg_data->minrtt_in_rtt = INT_MAX; + cdg_data->maxrtt_in_prevrtt = cdg_data->maxrtt_in_rtt; + cdg_data->maxrtt_in_rtt = 0; + e_t->flags &= ~ERTT_NEW_MEASUREMENT; + } + + if (congestion) { + cdg_data->consec_cong_cnt++; + if (!IN_RECOVERY(CCV(ccv, t_flags))) { + if (cdg_data->consec_cong_cnt <= V_cdg_consec_cong) + cdg_cong_signal(ccv, CC_CDG_DELAY); + else + /* + * We have been backing off but the queue is not + * falling. Assume we are competing with + * loss-based flows and don't back off for the + * next V_cdg_hold_backoff RTT periods. + */ + if (cdg_data->consec_cong_cnt >= + V_cdg_consec_cong + V_cdg_hold_backoff) + cdg_data->consec_cong_cnt = 0; + + /* Won't see effect until 2nd RTT. */ + cdg_data->maxrtt_in_prevrtt = 0; + /* + * Resync shadow window in case we are competing with a + * loss based flow + */ + cdg_data->shadow_w = ulmax(CCV(ccv, snd_cwnd), + cdg_data->shadow_w); + } + } else if (ack_type == CC_ACK) + cdg_window_increase(ccv, new_measurement); +} + +/* When a vnet is created and being initialised, init the per-stack CDG vars. */ +VNET_SYSINIT(cdg_init_vnet, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, + cdg_init_vnet, NULL); + +SYSCTL_DECL(_net_inet_tcp_cc_cdg); +SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, cdg, CTLFLAG_RW, NULL, + "CAIA delay-gradient congestion control related settings"); + +SYSCTL_STRING(_net_inet_tcp_cc_cdg, OID_AUTO, version, + CTLFLAG_RD, CDG_VERSION, sizeof(CDG_VERSION) - 1, + "Current algorithm/implementation version number"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, alpha_inc, + CTLFLAG_RW, &VNET_NAME(cdg_alpha_inc), 0, + "Increment the window increase factor alpha by 1 MSS segment every " + "alpha_inc RTTs during congestion avoidance mode."); + +SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_delay, + CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_beta_delay), 70, + &cdg_beta_handler, "IU", + "Delay-based window decrease factor as a percentage " + "(on delay-based backoff, w = w * beta_delay / 100)"); + +SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_loss, + CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_beta_loss), 50, + &cdg_beta_handler, "IU", + "Loss-based window decrease factor as a percentage " + "(on loss-based backoff, w = w * beta_loss / 100)"); + +SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, exp_backoff_scale, + CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_exp_backoff_scale), 2, + &cdg_exp_backoff_scale_handler, "IU", + "Scaling parameter for the probabilistic exponential backoff"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, smoothing_factor, + CTLFLAG_RW, &VNET_NAME(cdg_smoothing_factor), 8, + "Number of samples used for moving average smoothing (0 = no smoothing)"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_consec_cong, + CTLFLAG_RW, &VNET_NAME(cdg_consec_cong), 5, + "Number of consecutive delay-gradient based congestion episodes which will " + "trigger loss based CC compatibility"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_hold_backoff, + CTLFLAG_RW, &VNET_NAME(cdg_hold_backoff), 5, + "Number of consecutive delay-gradient based congestion episodes to hold " + "the window backoff for loss based CC compatibility"); + +DECLARE_CC_MODULE(cdg, &cdg_cc_algo); + +MODULE_DEPEND(cdg, ertt, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 14:20:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DE828BD1; Sun, 7 Jul 2013 14:20:01 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEE721720; Sun, 7 Jul 2013 14:20:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67EK1Yd013986; Sun, 7 Jul 2013 14:20:01 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67EK1HX013981; Sun, 7 Jul 2013 14:20:01 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307071420.r67EK1HX013981@svn.freebsd.org> From: Lawrence Stewart Date: Sun, 7 Jul 2013 14:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252952 - in stable/8: share/man/man4 sys/modules/cc sys/modules/cc/cc_cdg sys/netinet/cc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 14:20:02 -0000 Author: lstewart Date: Sun Jul 7 14:20:00 2013 New Revision: 252952 URL: http://svnweb.freebsd.org/changeset/base/252952 Log: MFC r252504: Import an implementation of the CAIA Delay-Gradient (CDG) congestion control algorithm, which is based on the 2011 v0.1 patch release and described in the paper "Revisiting TCP Congestion Control using Delay Gradients" by David Hayes and Grenville Armitage. It is implemented as a kernel module compatible with the modular congestion control framework. CDG is a hybrid congestion control algorithm which reacts to both packet loss and inferred queuing delay. It attempts to operate as a delay-based algorithm where possible, but utilises heuristics to detect loss-based TCP cross traffic and will compete effectively as required. CDG is therefore incrementally deployable and suitable for use on shared networks. In collaboration with: David Hayes and Grenville Armitage Sponsored by: Cisco University Research Program and FreeBSD Foundation Added: stable/8/share/man/man4/cc_cdg.4 - copied unchanged from r252504, head/share/man/man4/cc_cdg.4 stable/8/sys/modules/cc/cc_cdg/ - copied from r252504, head/sys/modules/cc/cc_cdg/ stable/8/sys/netinet/cc/cc_cdg.c - copied unchanged from r252504, head/sys/netinet/cc/cc_cdg.c Modified: stable/8/share/man/man4/Makefile stable/8/sys/modules/cc/Makefile Directory Properties: stable/8/share/man/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/modules/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Sun Jul 7 14:14:44 2013 (r252951) +++ stable/8/share/man/man4/Makefile Sun Jul 7 14:20:00 2013 (r252952) @@ -67,6 +67,7 @@ MAN= aac.4 \ cardbus.4 \ carp.4 \ cas.4 \ + cc_cdg.4 \ cc_chd.4 \ cc_cubic.4 \ cc_hd.4 \ Copied: stable/8/share/man/man4/cc_cdg.4 (from r252504, head/share/man/man4/cc_cdg.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/cc_cdg.4 Sun Jul 7 14:20:00 2013 (r252952, copy of r252504, head/share/man/man4/cc_cdg.4) @@ -0,0 +1,155 @@ +.\" +.\" Copyright (c) 2013 Swinburne University of Technology, Melbourne, Australia +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +.\" ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 2, 2013 +.Dt CC_CDG 4 +.Os +.Sh NAME +.Nm cc_cdg +.Nd CDG Congestion Control Algorithm +.Sh DESCRIPTION +CAIA-Delay Gradient (CDG) is a hybrid congestion control algorithm which reacts +to both packet loss and inferred queuing delay. +It attempts to operate as a delay-based algorithm where possible, but utilises +heuristics to detect loss-based TCP cross traffic and will compete effectively +as required. +CDG is therefore incrementally deployable and suitable for use on shared +networks. +.Pp +During delay-based operation, CDG uses a delay-gradient based probabilistic +backoff mechanism, and will also try to infer non congestion related +packet losses and avoid backing off when they occur. +During loss-based operation, CDG essentially reverts to +.Xr cc_newreno 4 Ns - Ns like +behaviour. +.Pp +CDG switches to loss-based operation when it detects that a configurable number +of consecutive delay-based backoffs have had no measurable effect. +It periodically attempts to return to delay-based operation, but will keep +switching back to loss-based operation as required. +.Sh MIB Variables +The algorithm exposes the following variables in the +.Va net.inet.tcp.cc.cdg +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va exp_backoff_scale" +.It Va version +Current algorithm/implementation version number. +.It Va beta_delay +Delay-based window decrease factor as a percentage (on delay-based backoff, w = +w * beta_delay / 100). +Default is 70. +.It Va beta_loss +Loss-based window decrease factor as a percentage (on loss-based backoff, w = +w * beta_loss / 100). +Default is 50. +.It Va exp_backoff_scale +Scaling parameter for the probabilistic exponential backoff. +Default is 2. +.It Va smoothing_factor +Number of samples used for moving average smoothing (0 means no smoothing). +Default is 8. +.It Va loss_compete_consec_cong +Number of consecutive delay-gradient based congestion episodes which will +trigger loss-based CC compatibility. +Default is 5. +.It Va loss_compete_hold_backoff +Number of consecutive delay-gradient based congestion episodes to hold the +window backoff for loss-based CC compatibility. +Default is 5. +.It Va alpha_inc +If non-zero, this enables an experimental mode where CDG's window increase +factor (alpha) is increased by 1 MSS every +.Va alpha_inc +RTTs during congestion avoidance mode. +(Setting +.Va alpha_inc +to 1 results in the most aggressive growth of the window increase factor over +time. +Use higher +.Va alpha_inc +values for slower growth.) +Default is 0. +.El +.Sh SEE ALSO +.Xr cc_chd 4 , +.Xr cc_cubic 4 , +.Xr cc_hd 4 , +.Xr cc_htcp 4 , +.Xr cc_newreno 4 , +.Xr cc_vegas 4 , +.Xr h_ertt 4 , +.Xr mod_cc 4 , +.Xr tcp 4 , +.Xr khelp 9 , +.Xr mod_cc 9 +.Rs +.%A "D. A. Hayes" +.%A "G. Armitage" +.%T "Revisiting TCP Congestion Control using Delay Gradients" +.%J "Networking 2011 Proceedings, Part II" +.%D "May 2011" +.%P "328-341" +.Re +.Rs +.%A "N. Khademi" +.%A "G. Armitage" +.%T "Minimising RTT across homogeneous 802.11 WLANs with CAIA Delay-Gradient TCP (v0.1)" +.%R "CAIA Technical Report 121113A" +.%D "November 2012" +.%U "http://caia.swin.edu.au/reports/121113A/CAIA-TR-121113A.pdf" +.Re +.Sh ACKNOWLEDGEMENTS +Development and testing of this software were made possible in part by grants +from the FreeBSD Foundation and The Cisco University Research Program Fund, a +corporate advised fund of Silicon Valley Community Foundation. +.Sh HISTORY +The +.Nm +congestion control module first appeared in +.Fx 9.2 . +.Pp +The module was first released in 2011 by David Hayes whilst working on the +NewTCP research project at Swinburne University of Technology's Centre for +Advanced Internet Architectures, Melbourne, Australia. +More details are available at: +.Pp +http://caia.swin.edu.au/urp/newtcp/ +.Sh AUTHORS +.An -nosplit +The +.Nm +congestion control module was written by +.An David Hayes Aq david.hayes@ieee.org . +This manual page was written by +.An Lawrence Stewart Aq lstewart@FreeBSD.org +and +.An Grenville Armitage Aq garmitage@swin.edu.au . +.Sh BUGS +The underlying algorithm and parameter values are still a work in progress and +may not be optimal for some network scenarios. Modified: stable/8/sys/modules/cc/Makefile ============================================================================== --- stable/8/sys/modules/cc/Makefile Sun Jul 7 14:14:44 2013 (r252951) +++ stable/8/sys/modules/cc/Makefile Sun Jul 7 14:20:00 2013 (r252952) @@ -1,6 +1,7 @@ # $FreeBSD$ -SUBDIR= cc_chd \ +SUBDIR= cc_cdg \ + cc_chd \ cc_cubic \ cc_hd \ cc_htcp \ Copied: stable/8/sys/netinet/cc/cc_cdg.c (from r252504, head/sys/netinet/cc/cc_cdg.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/netinet/cc/cc_cdg.c Sun Jul 7 14:20:00 2013 (r252952, copy of r252504, head/sys/netinet/cc/cc_cdg.c) @@ -0,0 +1,695 @@ +/*- + * Copyright (c) 2009-2013 + * Swinburne University of Technology, Melbourne, Australia + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University of Technology, by David Hayes, made + * possible in part by a gift from The Cisco University Research Program Fund, + * a corporate advised fund of Silicon Valley Community Foundation. Development + * and testing were further assisted by a grant 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. + */ + +/* + * CAIA Delay-Gradient (CDG) congestion control algorithm + * + * An implemention of the delay-gradient congestion control algorithm proposed + * in the following paper: + * + * D. A. Hayes and G. Armitage, "Revisiting TCP Congestion Control using Delay + * Gradients", in IFIP Networking, Valencia, Spain, 9-13 May 2011. + * + * Developed as part of the NewTCP research project at Swinburne University of + * Technology's Centre for Advanced Internet Architectures, Melbourne, + * Australia. More details are available at: + * http://caia.swin.edu.au/urp/newtcp/ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +#define CDG_VERSION "0.1" + +#define CAST_PTR_INT(X) (*((int*)(X))) + +#ifndef VIMAGE +#define vnet_sysctl_handle_uint(oidp, arg1, arg2, req) \ + sysctl_handle_int(oidp, arg1, arg2, req) +#endif + +/* Private delay-gradient induced congestion control signal. */ +#define CC_CDG_DELAY 0x01000000 + +/* NewReno window deflation factor on loss (as a percentage). */ +#define RENO_BETA 50 + +/* Queue states. */ +#define CDG_Q_EMPTY 1 +#define CDG_Q_RISING 2 +#define CDG_Q_FALLING 3 +#define CDG_Q_FULL 4 +#define CDG_Q_UNKNOWN 9999 + +/* Number of bit shifts used in probexp lookup table. */ +#define EXP_PREC 15 + +/* Largest gradient represented in probexp lookup table. */ +#define MAXGRAD 5 + +/* + * Delay Precision Enhance - number of bit shifts used for qtrend related + * integer arithmetic precision. + */ +#define D_P_E 7 + +struct qdiff_sample { + long qdiff; + STAILQ_ENTRY(qdiff_sample) qdiff_lnk; +}; + +struct cdg { + long max_qtrend; + long min_qtrend; + STAILQ_HEAD(minrtts_head, qdiff_sample) qdiffmin_q; + STAILQ_HEAD(maxrtts_head, qdiff_sample) qdiffmax_q; + long window_incr; + /* rttcount for window increase when in congestion avoidance */ + long rtt_count; + /* maximum measured rtt within an rtt period */ + int maxrtt_in_rtt; + /* maximum measured rtt within prev rtt period */ + int maxrtt_in_prevrtt; + /* minimum measured rtt within an rtt period */ + int minrtt_in_rtt; + /* minimum measured rtt within prev rtt period */ + int minrtt_in_prevrtt; + /* consecutive congestion episode counter */ + uint32_t consec_cong_cnt; + /* when tracking a new reno type loss window */ + uint32_t shadow_w; + /* maximum number of samples in the moving average queue */ + int sample_q_size; + /* number of samples in the moving average queue */ + int num_samples; + /* estimate of the queue state of the path */ + int queue_state; +}; + +/* + * Lookup table for: + * (1 - exp(-x)) << EXP_PREC, where x = [0,MAXGRAD] in 2^-7 increments + * + * Note: probexp[0] is set to 10 (not 0) as a safety for very low increase + * gradients. + */ +static const int probexp[641] = { + 10,255,508,759,1008,1255,1501,1744,1985,2225,2463,2698,2932,3165,3395,3624, + 3850,4075,4299,4520,4740,4958,5175,5389,5602,5814,6024,6232,6438,6643,6846, + 7048,7248,7447,7644,7839,8033,8226,8417,8606,8794,8981,9166,9350,9532,9713, + 9892,10070,10247,10422,10596,10769,10940,11110,11278,11445,11611,11776,11939, + 12101,12262,12422,12580,12737,12893,13048,13201,13354,13505,13655,13803,13951, + 14097,14243,14387,14530,14672,14813,14952,15091,15229,15365,15500,15635,15768, + 15900,16032,16162,16291,16419,16547,16673,16798,16922,17046,17168,17289,17410, + 17529,17648,17766,17882,17998,18113,18227,18340,18453,18564,18675,18784,18893, + 19001,19108,19215,19320,19425,19529,19632,19734,19835,19936,20036,20135,20233, + 20331,20427,20523,20619,20713,20807,20900,20993,21084,21175,21265,21355,21444, + 21532,21619,21706,21792,21878,21962,22046,22130,22213,22295,22376,22457,22537, + 22617,22696,22774,22852,22929,23006,23082,23157,23232,23306,23380,23453,23525, + 23597,23669,23739,23810,23879,23949,24017,24085,24153,24220,24286,24352,24418, + 24483,24547,24611,24675,24738,24800,24862,24924,24985,25045,25106,25165,25224, + 25283,25341,25399,25456,25513,25570,25626,25681,25737,25791,25846,25899,25953, + 26006,26059,26111,26163,26214,26265,26316,26366,26416,26465,26514,26563,26611, + 26659,26707,26754,26801,26847,26893,26939,26984,27029,27074,27118,27162,27206, + 27249,27292,27335,27377,27419,27460,27502,27543,27583,27624,27664,27703,27743, + 27782,27821,27859,27897,27935,27973,28010,28047,28084,28121,28157,28193,28228, + 28263,28299,28333,28368,28402,28436,28470,28503,28536,28569,28602,28634,28667, + 28699,28730,28762,28793,28824,28854,28885,28915,28945,28975,29004,29034,29063, + 29092,29120,29149,29177,29205,29232,29260,29287,29314,29341,29368,29394,29421, + 29447,29472,29498,29524,29549,29574,29599,29623,29648,29672,29696,29720,29744, + 29767,29791,29814,29837,29860,29882,29905,29927,29949,29971,29993,30014,30036, + 30057,30078,30099,30120,30141,30161,30181,30201,30221,30241,30261,30280,30300, + 30319,30338,30357,30376,30394,30413,30431,30449,30467,30485,30503,30521,30538, + 30555,30573,30590,30607,30624,30640,30657,30673,30690,30706,30722,30738,30753, + 30769,30785,30800,30815,30831,30846,30861,30876,30890,30905,30919,30934,30948, + 30962,30976,30990,31004,31018,31031,31045,31058,31072,31085,31098,31111,31124, + 31137,31149,31162,31174,31187,31199,31211,31223,31235,31247,31259,31271,31283, + 31294,31306,31317,31328,31339,31351,31362,31373,31383,31394,31405,31416,31426, + 31436,31447,31457,31467,31477,31487,31497,31507,31517,31527,31537,31546,31556, + 31565,31574,31584,31593,31602,31611,31620,31629,31638,31647,31655,31664,31673, + 31681,31690,31698,31706,31715,31723,31731,31739,31747,31755,31763,31771,31778, + 31786,31794,31801,31809,31816,31824,31831,31838,31846,31853,31860,31867,31874, + 31881,31888,31895,31902,31908,31915,31922,31928,31935,31941,31948,31954,31960, + 31967,31973,31979,31985,31991,31997,32003,32009,32015,32021,32027,32033,32038, + 32044,32050,32055,32061,32066,32072,32077,32083,32088,32093,32098,32104,32109, + 32114,32119,32124,32129,32134,32139,32144,32149,32154,32158,32163,32168,32173, + 32177,32182,32186,32191,32195,32200,32204,32209,32213,32217,32222,32226,32230, + 32234,32238,32242,32247,32251,32255,32259,32263,32267,32270,32274,32278,32282, + 32286,32290,32293,32297,32301,32304,32308,32311,32315,32318,32322,32325,32329, + 32332,32336,32339,32342,32346,32349,32352,32356,32359,32362,32365,32368,32371, + 32374,32377,32381,32384,32387,32389,32392,32395,32398,32401,32404,32407,32410, + 32412,32415,32418,32421,32423,32426,32429,32431,32434,32437,32439,32442,32444, + 32447,32449,32452,32454,32457,32459,32461,32464,32466,32469,32471,32473,32476, + 32478,32480,32482,32485,32487,32489,32491,32493,32495,32497,32500,32502,32504, + 32506,32508,32510,32512,32514,32516,32518,32520,32522,32524,32526,32527,32529, + 32531,32533,32535,32537,32538,32540,32542,32544,32545,32547}; + +static uma_zone_t qdiffsample_zone; + +static MALLOC_DEFINE(M_CDG, "cdg data", + "Per connection data required for the CDG congestion control algorithm"); + +static int ertt_id; + +static VNET_DEFINE(uint32_t, cdg_alpha_inc); +static VNET_DEFINE(uint32_t, cdg_beta_delay); +static VNET_DEFINE(uint32_t, cdg_beta_loss); +static VNET_DEFINE(uint32_t, cdg_smoothing_factor); +static VNET_DEFINE(uint32_t, cdg_exp_backoff_scale); +static VNET_DEFINE(uint32_t, cdg_consec_cong); +static VNET_DEFINE(uint32_t, cdg_hold_backoff); +#define V_cdg_alpha_inc VNET(cdg_alpha_inc) +#define V_cdg_beta_delay VNET(cdg_beta_delay) +#define V_cdg_beta_loss VNET(cdg_beta_loss) +#define V_cdg_smoothing_factor VNET(cdg_smoothing_factor) +#define V_cdg_exp_backoff_scale VNET(cdg_exp_backoff_scale) +#define V_cdg_consec_cong VNET(cdg_consec_cong) +#define V_cdg_hold_backoff VNET(cdg_hold_backoff) + +/* Function prototypes. */ +static int cdg_mod_init(void); +static void cdg_conn_init(struct cc_var *ccv); +static int cdg_cb_init(struct cc_var *ccv); +static void cdg_cb_destroy(struct cc_var *ccv); +static void cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type); +static void cdg_ack_received(struct cc_var *ccv, uint16_t ack_type); + +struct cc_algo cdg_cc_algo = { + .name = "cdg", + .mod_init = cdg_mod_init, + .ack_received = cdg_ack_received, + .cb_destroy = cdg_cb_destroy, + .cb_init = cdg_cb_init, + .conn_init = cdg_conn_init, + .cong_signal = cdg_cong_signal +}; + +/* Vnet created and being initialised. */ +static void +cdg_init_vnet(const void *unused __unused) +{ + + V_cdg_alpha_inc = 0; + V_cdg_beta_delay = 70; + V_cdg_beta_loss = 50; + V_cdg_smoothing_factor = 8; + V_cdg_exp_backoff_scale = 3; + V_cdg_consec_cong = 5; + V_cdg_hold_backoff = 5; +} + +static int +cdg_mod_init(void) +{ + VNET_ITERATOR_DECL(v); + + ertt_id = khelp_get_id("ertt"); + if (ertt_id <= 0) + return (EINVAL); + + qdiffsample_zone = uma_zcreate("cdg_qdiffsample", + sizeof(struct qdiff_sample), NULL, NULL, NULL, NULL, 0, 0); + + VNET_LIST_RLOCK(); + VNET_FOREACH(v) { + CURVNET_SET(v); + cdg_init_vnet(NULL); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); + + cdg_cc_algo.post_recovery = newreno_cc_algo.post_recovery; + cdg_cc_algo.after_idle = newreno_cc_algo.after_idle; + + return (0); +} + +static int +cdg_cb_init(struct cc_var *ccv) +{ + struct cdg *cdg_data; + + cdg_data = malloc(sizeof(struct cdg), M_CDG, M_NOWAIT); + if (cdg_data == NULL) + return (ENOMEM); + + cdg_data->shadow_w = 0; + cdg_data->max_qtrend = 0; + cdg_data->min_qtrend = 0; + cdg_data->queue_state = CDG_Q_UNKNOWN; + cdg_data->maxrtt_in_rtt = 0; + cdg_data->maxrtt_in_prevrtt = 0; + cdg_data->minrtt_in_rtt = INT_MAX; + cdg_data->minrtt_in_prevrtt = 0; + cdg_data->window_incr = 0; + cdg_data->rtt_count = 0; + cdg_data->consec_cong_cnt = 0; + cdg_data->sample_q_size = V_cdg_smoothing_factor; + cdg_data->num_samples = 0; + STAILQ_INIT(&cdg_data->qdiffmin_q); + STAILQ_INIT(&cdg_data->qdiffmax_q); + + ccv->cc_data = cdg_data; + + return (0); +} + +static void +cdg_conn_init(struct cc_var *ccv) +{ + struct cdg *cdg_data = ccv->cc_data; + + /* + * Initialise the shadow_cwnd in case we are competing with loss based + * flows from the start + */ + cdg_data->shadow_w = CCV(ccv, snd_cwnd); +} + +static void +cdg_cb_destroy(struct cc_var *ccv) +{ + struct cdg *cdg_data; + struct qdiff_sample *qds, *qds_n; + + cdg_data = ccv->cc_data; + + qds = STAILQ_FIRST(&cdg_data->qdiffmin_q); + while (qds != NULL) { + qds_n = STAILQ_NEXT(qds, qdiff_lnk); + uma_zfree(qdiffsample_zone,qds); + qds = qds_n; + } + + qds = STAILQ_FIRST(&cdg_data->qdiffmax_q); + while (qds != NULL) { + qds_n = STAILQ_NEXT(qds, qdiff_lnk); + uma_zfree(qdiffsample_zone,qds); + qds = qds_n; + } + + free(ccv->cc_data, M_CDG); +} + +static int +cdg_beta_handler(SYSCTL_HANDLER_ARGS) +{ + + if (req->newptr != NULL && + (CAST_PTR_INT(req->newptr) == 0 || CAST_PTR_INT(req->newptr) > 100)) + return (EINVAL); + + return (vnet_sysctl_handle_uint(oidp, arg1, arg2, req)); +} + +static int +cdg_exp_backoff_scale_handler(SYSCTL_HANDLER_ARGS) +{ + + if (req->newptr != NULL && CAST_PTR_INT(req->newptr) < 1) + return (EINVAL); + + return (vnet_sysctl_handle_uint(oidp, arg1, arg2, req)); +} + +static inline unsigned long +cdg_window_decrease(struct cc_var *ccv, unsigned long owin, unsigned int beta) +{ + + return ((ulmin(CCV(ccv, snd_wnd), owin) * beta) / 100); +} + +/* + * Window increase function + * This window increase function is independent of the initial window size + * to ensure small window flows are not discriminated against (i.e. fairness). + * It increases at 1pkt/rtt like Reno for alpha_inc rtts, and then 2pkts/rtt for + * the next alpha_inc rtts, etc. + */ +static void +cdg_window_increase(struct cc_var *ccv, int new_measurement) +{ + struct cdg *cdg_data; + int incr, s_w_incr; + + cdg_data = ccv->cc_data; + incr = s_w_incr = 0; + + if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh)) { + /* Slow start. */ + incr = CCV(ccv, t_maxseg); + s_w_incr = incr; + cdg_data->window_incr = cdg_data->rtt_count = 0; + } else { + /* Congestion avoidance. */ + if (new_measurement) { + s_w_incr = CCV(ccv, t_maxseg); + if (V_cdg_alpha_inc == 0) { + incr = CCV(ccv, t_maxseg); + } else { + if (++cdg_data->rtt_count >= V_cdg_alpha_inc) { + cdg_data->window_incr++; + cdg_data->rtt_count = 0; + } + incr = CCV(ccv, t_maxseg) * + cdg_data->window_incr; + } + } + } + + if (cdg_data->shadow_w > 0) + cdg_data->shadow_w = ulmin(cdg_data->shadow_w + s_w_incr, + TCP_MAXWIN << CCV(ccv, snd_scale)); + + CCV(ccv, snd_cwnd) = ulmin(CCV(ccv, snd_cwnd) + incr, + TCP_MAXWIN << CCV(ccv, snd_scale)); +} + +static void +cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type) +{ + struct cdg *cdg_data = ccv->cc_data; + + switch(signal_type) { + case CC_CDG_DELAY: + CCV(ccv, snd_ssthresh) = cdg_window_decrease(ccv, + CCV(ccv, snd_cwnd), V_cdg_beta_delay); + CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); + CCV(ccv, snd_recover) = CCV(ccv, snd_max); + cdg_data->window_incr = cdg_data->rtt_count = 0; + ENTER_CONGRECOVERY(CCV(ccv, t_flags)); + break; + case CC_NDUPACK: + /* + * If already responding to congestion OR we have guessed no + * queue in the path is full. + */ + if (IN_CONGRECOVERY(CCV(ccv, t_flags)) || + cdg_data->queue_state < CDG_Q_FULL) { + CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd); + CCV(ccv, snd_recover) = CCV(ccv, snd_max); + } else { + /* + * Loss is likely to be congestion related. We have + * inferred a queue full state, so have shadow window + * react to loss as NewReno would. + */ + if (cdg_data->shadow_w > 0) + cdg_data->shadow_w = cdg_window_decrease(ccv, + cdg_data->shadow_w, RENO_BETA); + + CCV(ccv, snd_ssthresh) = ulmax(cdg_data->shadow_w, + cdg_window_decrease(ccv, CCV(ccv, snd_cwnd), + V_cdg_beta_loss)); + + cdg_data->window_incr = cdg_data->rtt_count = 0; + } + ENTER_RECOVERY(CCV(ccv, t_flags)); + break; + default: + newreno_cc_algo.cong_signal(ccv, signal_type); + break; + } +} + +/* + * Using a negative exponential probabilistic backoff so that sources with + * varying RTTs which share the same link will, on average, have the same + * probability of backoff over time. + * + * Prob_backoff = 1 - exp(-qtrend / V_cdg_exp_backoff_scale), where + * V_cdg_exp_backoff_scale is the average qtrend for the exponential backoff. + */ +static inline int +prob_backoff(long qtrend) +{ + int backoff, idx, p; + + backoff = (qtrend > ((MAXGRAD * V_cdg_exp_backoff_scale) << D_P_E)); + + if (!backoff) { + if (V_cdg_exp_backoff_scale > 1) + idx = (qtrend + V_cdg_exp_backoff_scale / 2) / + V_cdg_exp_backoff_scale; + else + idx = qtrend; + + /* Backoff probability proportional to rate of queue growth. */ + p = (INT_MAX / (1 << EXP_PREC)) * probexp[idx]; + backoff = (random() < p); + } + + return (backoff); +} + +static inline void +calc_moving_average(struct cdg *cdg_data, long qdiff_max, long qdiff_min) +{ + struct qdiff_sample *qds; + + ++cdg_data->num_samples; + if (cdg_data->num_samples > cdg_data->sample_q_size) { + /* Minimum RTT. */ + qds = STAILQ_FIRST(&cdg_data->qdiffmin_q); + cdg_data->min_qtrend = cdg_data->min_qtrend + + (qdiff_min - qds->qdiff) / cdg_data->sample_q_size; + STAILQ_REMOVE_HEAD(&cdg_data->qdiffmin_q, qdiff_lnk); + qds->qdiff = qdiff_min; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmin_q, qds, qdiff_lnk); + + /* Maximum RTT. */ + qds = STAILQ_FIRST(&cdg_data->qdiffmax_q); + cdg_data->max_qtrend = cdg_data->max_qtrend + + (qdiff_max - qds->qdiff) / cdg_data->sample_q_size; + STAILQ_REMOVE_HEAD(&cdg_data->qdiffmax_q, qdiff_lnk); + qds->qdiff = qdiff_max; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmax_q, qds, qdiff_lnk); + --cdg_data->num_samples; + } else { + qds = uma_zalloc(qdiffsample_zone, M_NOWAIT); + if (qds != NULL) { + cdg_data->min_qtrend = cdg_data->min_qtrend + + qdiff_min / cdg_data->sample_q_size; + qds->qdiff = qdiff_min; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmin_q, qds, + qdiff_lnk); + } + + qds = uma_zalloc(qdiffsample_zone, M_NOWAIT); + if (qds) { + cdg_data->max_qtrend = cdg_data->max_qtrend + + qdiff_max / cdg_data->sample_q_size; + qds->qdiff = qdiff_max; + STAILQ_INSERT_TAIL(&cdg_data->qdiffmax_q, qds, + qdiff_lnk); + } + } +} + +static void +cdg_ack_received(struct cc_var *ccv, uint16_t ack_type) +{ + struct cdg *cdg_data; + struct ertt *e_t; + long qdiff_max, qdiff_min; + int congestion, new_measurement, slowstart; + + cdg_data = ccv->cc_data; + e_t = (struct ertt *)khelp_get_osd(CCV(ccv, osd), ertt_id); + new_measurement = e_t->flags & ERTT_NEW_MEASUREMENT; + congestion = 0; + cdg_data->maxrtt_in_rtt = imax(e_t->rtt, cdg_data->maxrtt_in_rtt); + cdg_data->minrtt_in_rtt = imin(e_t->rtt, cdg_data->minrtt_in_rtt); + + if (new_measurement) { + slowstart = (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh)); + /* + * Update smoothed gradient measurements. Since we are only + * using one measurement per RTT, use max or min rtt_in_rtt. + * This is also less noisy than a sample RTT measurement. Max + * RTT measurements can have trouble due to OS issues. + */ + if (cdg_data->maxrtt_in_prevrtt) { + qdiff_max = ((long)(cdg_data->maxrtt_in_rtt - + cdg_data->maxrtt_in_prevrtt) << D_P_E ); + qdiff_min = ((long)(cdg_data->minrtt_in_rtt - + cdg_data->minrtt_in_prevrtt) << D_P_E ); + + calc_moving_average(cdg_data, qdiff_max, qdiff_min); + + /* Probabilistic backoff with respect to gradient. */ + if (slowstart && qdiff_min > 0) + congestion = prob_backoff(qdiff_min); + else if (cdg_data->min_qtrend > 0) + congestion = prob_backoff(cdg_data->min_qtrend); + else if (slowstart && qdiff_max > 0) + congestion = prob_backoff(qdiff_max); + else if (cdg_data->max_qtrend > 0) + congestion = prob_backoff(cdg_data->max_qtrend); + + /* Update estimate of queue state. */ + if (cdg_data->min_qtrend > 0 && + cdg_data->max_qtrend <= 0) { + cdg_data->queue_state = CDG_Q_FULL; + } else if (cdg_data->min_qtrend >= 0 && + cdg_data->max_qtrend < 0) { + cdg_data->queue_state = CDG_Q_EMPTY; + cdg_data->shadow_w = 0; + } else if (cdg_data->min_qtrend > 0 && + cdg_data->max_qtrend > 0) { + cdg_data->queue_state = CDG_Q_RISING; + } else if (cdg_data->min_qtrend < 0 && + cdg_data->max_qtrend < 0) { + cdg_data->queue_state = CDG_Q_FALLING; + } + + if (cdg_data->min_qtrend < 0 || + cdg_data->max_qtrend < 0) + cdg_data->consec_cong_cnt = 0; + } + + cdg_data->minrtt_in_prevrtt = cdg_data->minrtt_in_rtt; + cdg_data->minrtt_in_rtt = INT_MAX; + cdg_data->maxrtt_in_prevrtt = cdg_data->maxrtt_in_rtt; + cdg_data->maxrtt_in_rtt = 0; + e_t->flags &= ~ERTT_NEW_MEASUREMENT; + } + + if (congestion) { + cdg_data->consec_cong_cnt++; + if (!IN_RECOVERY(CCV(ccv, t_flags))) { + if (cdg_data->consec_cong_cnt <= V_cdg_consec_cong) + cdg_cong_signal(ccv, CC_CDG_DELAY); + else + /* + * We have been backing off but the queue is not + * falling. Assume we are competing with + * loss-based flows and don't back off for the + * next V_cdg_hold_backoff RTT periods. + */ + if (cdg_data->consec_cong_cnt >= + V_cdg_consec_cong + V_cdg_hold_backoff) + cdg_data->consec_cong_cnt = 0; + + /* Won't see effect until 2nd RTT. */ + cdg_data->maxrtt_in_prevrtt = 0; + /* + * Resync shadow window in case we are competing with a + * loss based flow + */ + cdg_data->shadow_w = ulmax(CCV(ccv, snd_cwnd), + cdg_data->shadow_w); + } + } else if (ack_type == CC_ACK) + cdg_window_increase(ccv, new_measurement); +} + +/* When a vnet is created and being initialised, init the per-stack CDG vars. */ +VNET_SYSINIT(cdg_init_vnet, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, + cdg_init_vnet, NULL); + +SYSCTL_DECL(_net_inet_tcp_cc_cdg); +SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, cdg, CTLFLAG_RW, NULL, + "CAIA delay-gradient congestion control related settings"); + +SYSCTL_STRING(_net_inet_tcp_cc_cdg, OID_AUTO, version, + CTLFLAG_RD, CDG_VERSION, sizeof(CDG_VERSION) - 1, + "Current algorithm/implementation version number"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, alpha_inc, + CTLFLAG_RW, &VNET_NAME(cdg_alpha_inc), 0, + "Increment the window increase factor alpha by 1 MSS segment every " + "alpha_inc RTTs during congestion avoidance mode."); + +SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_delay, + CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_beta_delay), 70, + &cdg_beta_handler, "IU", + "Delay-based window decrease factor as a percentage " + "(on delay-based backoff, w = w * beta_delay / 100)"); + +SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_loss, + CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_beta_loss), 50, + &cdg_beta_handler, "IU", + "Loss-based window decrease factor as a percentage " + "(on loss-based backoff, w = w * beta_loss / 100)"); + +SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, exp_backoff_scale, + CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_exp_backoff_scale), 2, + &cdg_exp_backoff_scale_handler, "IU", + "Scaling parameter for the probabilistic exponential backoff"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, smoothing_factor, + CTLFLAG_RW, &VNET_NAME(cdg_smoothing_factor), 8, + "Number of samples used for moving average smoothing (0 = no smoothing)"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_consec_cong, + CTLFLAG_RW, &VNET_NAME(cdg_consec_cong), 5, + "Number of consecutive delay-gradient based congestion episodes which will " + "trigger loss based CC compatibility"); + +SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_hold_backoff, + CTLFLAG_RW, &VNET_NAME(cdg_hold_backoff), 5, + "Number of consecutive delay-gradient based congestion episodes to hold " + "the window backoff for loss based CC compatibility"); + +DECLARE_CC_MODULE(cdg, &cdg_cc_algo); + +MODULE_DEPEND(cdg, ertt, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 15:18:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 19E80519; Sun, 7 Jul 2013 15:18:11 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F092B1855; Sun, 7 Jul 2013 15:18:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67FIAuT031442; Sun, 7 Jul 2013 15:18:10 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67FIA8o031440; Sun, 7 Jul 2013 15:18:10 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071518.r67FIA8o031440@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 15:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252953 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 15:18:11 -0000 Author: tuexen Date: Sun Jul 7 15:18:09 2013 New Revision: 252953 URL: http://svnweb.freebsd.org/changeset/base/252953 Log: MFC r244021: Ensure that the padding of the last parameter of an INIT chunk is not included in the chunk length as required by RFC 4960. While there, cleanup sctp_send_initiate(). Modified: stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_output.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 14:20:00 2013 (r252952) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 15:18:09 2013 (r252953) @@ -1940,27 +1940,27 @@ sctp_is_address_in_scope(struct sctp_ifa } static struct mbuf * -sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa *ifa) +sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa *ifa, uint16_t * len) { struct sctp_paramhdr *parmh; struct mbuf *mret; - int len; + uint16_t plen; switch (ifa->address.sa.sa_family) { #ifdef INET case AF_INET: - len = sizeof(struct sctp_ipv4addr_param); + plen = (uint16_t) sizeof(struct sctp_ipv4addr_param); break; #endif #ifdef INET6 case AF_INET6: - len = sizeof(struct sctp_ipv6addr_param); + plen = (uint16_t) sizeof(struct sctp_ipv6addr_param); break; #endif default: return (m); } - if (M_TRAILINGSPACE(m) >= len) { + if (M_TRAILINGSPACE(m) >= plen) { /* easy side we just drop it on the end */ parmh = (struct sctp_paramhdr *)(SCTP_BUF_AT(m, SCTP_BUF_LEN(m))); mret = m; @@ -1970,7 +1970,7 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st while (SCTP_BUF_NEXT(mret) != NULL) { mret = SCTP_BUF_NEXT(mret); } - SCTP_BUF_NEXT(mret) = sctp_get_mbuf_for_msg(len, 0, M_DONTWAIT, 1, MT_DATA); + SCTP_BUF_NEXT(mret) = sctp_get_mbuf_for_msg(plen, 0, M_DONTWAIT, 1, MT_DATA); if (SCTP_BUF_NEXT(mret) == NULL) { /* We are hosed, can't add more addresses */ return (m); @@ -1989,9 +1989,9 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st sin = (struct sockaddr_in *)&ifa->address.sin; ipv4p = (struct sctp_ipv4addr_param *)parmh; parmh->param_type = htons(SCTP_IPV4_ADDRESS); - parmh->param_length = htons(len); + parmh->param_length = htons(plen); ipv4p->addr = sin->sin_addr.s_addr; - SCTP_BUF_LEN(mret) += len; + SCTP_BUF_LEN(mret) += plen; break; } #endif @@ -2004,18 +2004,21 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st sin6 = (struct sockaddr_in6 *)&ifa->address.sin6; ipv6p = (struct sctp_ipv6addr_param *)parmh; parmh->param_type = htons(SCTP_IPV6_ADDRESS); - parmh->param_length = htons(len); + parmh->param_length = htons(plen); memcpy(ipv6p->addr, &sin6->sin6_addr, sizeof(ipv6p->addr)); /* clear embedded scope in the address */ in6_clearscope((struct in6_addr *)ipv6p->addr); - SCTP_BUF_LEN(mret) += len; + SCTP_BUF_LEN(mret) += plen; break; } #endif default: return (m); } + if (len != NULL) { + *len += plen; + } return (mret); } @@ -2023,7 +2026,8 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st struct mbuf * sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_scoping *scope, - struct mbuf *m_at, int cnt_inits_to) + struct mbuf *m_at, int cnt_inits_to, + uint16_t * padding_len, uint16_t * chunk_len) { struct sctp_vrf *vrf = NULL; int cnt, limit_out = 0, total_count; @@ -2103,7 +2107,15 @@ skip_count: scope->site_scope, 0) == 0) { continue; } - m_at = sctp_add_addr_to_mbuf(m_at, sctp_ifap); + if ((chunk_len != NULL) && + (padding_len != NULL) && + (*padding_len > 0)) { + memset(mtod(m_at, caddr_t)+*chunk_len, 0, *padding_len); + SCTP_BUF_LEN(m_at) += *padding_len; + *chunk_len += *padding_len; + *padding_len = 0; + } + m_at = sctp_add_addr_to_mbuf(m_at, sctp_ifap, chunk_len); if (limit_out) { cnt++; total_count++; @@ -2178,7 +2190,15 @@ skip_count: scope->site_scope, 0) == 0) { continue; } - m_at = sctp_add_addr_to_mbuf(m_at, laddr->ifa); + if ((chunk_len != NULL) && + (padding_len != NULL) && + (*padding_len > 0)) { + memset(mtod(m_at, caddr_t)+*chunk_len, 0, *padding_len); + SCTP_BUF_LEN(m_at) += *padding_len; + *chunk_len += *padding_len; + *padding_len = 0; + } + m_at = sctp_add_addr_to_mbuf(m_at, laddr->ifa, chunk_len); cnt++; if (cnt >= SCTP_ADDRESS_LIMIT) { break; @@ -4575,21 +4595,19 @@ sctp_send_initiate(struct sctp_inpcb *in #endif ) { - struct mbuf *m, *m_at, *mp_last; + struct sctp_scoping scp; + struct mbuf *m; struct sctp_nets *net; struct sctp_init_chunk *init; struct sctp_supported_addr_param *sup_addr; struct sctp_adaptation_layer_indication *ali; - struct sctp_ecn_supported_param *ecn; - struct sctp_prsctp_supported_param *prsctp; struct sctp_supported_chunk_types_param *pr_supported; + struct sctp_paramhdr *ph; int cnt_inits_to = 0; - int padval, ret; - int num_ext; - int p_len; + int ret; + uint16_t num_ext, chunk_len, padding_len, parameter_len; /* INIT's always go to the primary (and usually ONLY address) */ - mp_last = NULL; net = stcb->asoc.primary_destination; if (net == NULL) { net = TAILQ_FIRST(&stcb->asoc.nets); @@ -4606,15 +4624,12 @@ sctp_send_initiate(struct sctp_inpcb *in } SCTPDBG(SCTP_DEBUG_OUTPUT4, "Sending INIT\n"); #ifdef INET6 - if (((struct sockaddr *)&(net->ro._l_addr))->sa_family == AF_INET6) { + if (net->ro._l_addr.sa.sa_family == AF_INET6) { /* * special hook, if we are sending to link local it will not * show up in our private address count. */ - struct sockaddr_in6 *sin6l; - - sin6l = &net->ro._l_addr.sin6; - if (IN6_IS_ADDR_LINKLOCAL(&sin6l->sin6_addr)) + if (IN6_IS_ADDR_LINKLOCAL(&net->ro._l_addr.sin6.sin6_addr)) cnt_inits_to = 1; } #endif @@ -4632,14 +4647,15 @@ sctp_send_initiate(struct sctp_inpcb *in SCTPDBG(SCTP_DEBUG_OUTPUT4, "Sending INIT - mbuf?\n"); return; } - SCTP_BUF_LEN(m) = sizeof(struct sctp_init_chunk); + chunk_len = (uint16_t) sizeof(struct sctp_init_chunk); + padding_len = 0; /* * assume peer supports asconf in order to be able to queue local * address changes while an INIT is in flight and before the assoc * is established. */ stcb->asoc.peer_supports_asconf = 1; - /* Now lets put the SCTP header in place */ + /* Now lets put the chunk header in place */ init = mtod(m, struct sctp_init_chunk *); /* now the chunk header */ init->ch.chunk_type = SCTP_INITIATION; @@ -4651,84 +4667,112 @@ sctp_send_initiate(struct sctp_inpcb *in /* set up some of the credits. */ init->init.a_rwnd = htonl(max(inp->sctp_socket ? SCTP_SB_LIMIT_RCV(inp->sctp_socket) : 0, SCTP_MINIMAL_RWND)); - init->init.num_outbound_streams = htons(stcb->asoc.pre_open_streams); init->init.num_inbound_streams = htons(stcb->asoc.max_inbound_streams); init->init.initial_tsn = htonl(stcb->asoc.init_seq_number); + +#if defined(INET) || defined(INET6) /* now the address restriction */ /* XXX Should we take the address family of the socket into account? */ - sup_addr = (struct sctp_supported_addr_param *)((caddr_t)init + - sizeof(*init)); + sup_addr = (struct sctp_supported_addr_param *)(mtod(m, caddr_t)+chunk_len); sup_addr->ph.param_type = htons(SCTP_SUPPORTED_ADDRTYPE); #ifdef INET6 #ifdef INET /* we support 2 types: IPv4/IPv6 */ - sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + 2 * sizeof(uint16_t)); + parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + 2 * sizeof(uint16_t)); + sup_addr->ph.param_length = htons(parameter_len); sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); sup_addr->addr_type[1] = htons(SCTP_IPV6_ADDRESS); + padding_len = 0; #else /* we support 1 type: IPv6 */ - sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); + parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); + sup_addr->ph.param_length = htons(parameter_len); sup_addr->addr_type[0] = htons(SCTP_IPV6_ADDRESS); sup_addr->addr_type[1] = htons(0); /* this is the padding */ + padding_len = (uint16_t) sizeof(uint16_t); #endif #else /* we support 1 type: IPv4 */ - sup_addr->ph.param_length = htons(sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); + parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); + sup_addr->ph.param_length = htons(parameter_len); sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); sup_addr->addr_type[1] = htons(0); /* this is the padding */ + padding_len = (uint16_t) sizeof(uint16_t); #endif - SCTP_BUF_LEN(m) += sizeof(struct sctp_supported_addr_param); - /* adaptation layer indication parameter */ - ali = (struct sctp_adaptation_layer_indication *)((caddr_t)sup_addr + sizeof(struct sctp_supported_addr_param)); + chunk_len += parameter_len; +#endif + /* Adaptation layer indication parameter */ + /* XXX: Should we include this always? */ + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + parameter_len = (uint16_t) sizeof(struct sctp_adaptation_layer_indication); + ali = (struct sctp_adaptation_layer_indication *)(mtod(m, caddr_t)+chunk_len); ali->ph.param_type = htons(SCTP_ULP_ADAPTATION); - ali->ph.param_length = htons(sizeof(*ali)); + ali->ph.param_length = htons(parameter_len); ali->indication = ntohl(inp->sctp_ep.adaptation_layer_indicator); - SCTP_BUF_LEN(m) += sizeof(*ali); - ecn = (struct sctp_ecn_supported_param *)((caddr_t)ali + sizeof(*ali)); + chunk_len += parameter_len; if (SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly)) { - /* Add NAT friendly parameter */ - struct sctp_paramhdr *ph; - - ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+SCTP_BUF_LEN(m)); + /* Add NAT friendly parameter. */ + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + parameter_len = (uint16_t) sizeof(struct sctp_paramhdr); + ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len); ph->param_type = htons(SCTP_HAS_NAT_SUPPORT); - ph->param_length = htons(sizeof(struct sctp_paramhdr)); - SCTP_BUF_LEN(m) += sizeof(struct sctp_paramhdr); - ecn = (struct sctp_ecn_supported_param *)((caddr_t)ph + sizeof(*ph)); + ph->param_length = htons(parameter_len); + chunk_len += parameter_len; } /* now any cookie time extensions */ if (stcb->asoc.cookie_preserve_req) { struct sctp_cookie_perserve_param *cookie_preserve; - cookie_preserve = (struct sctp_cookie_perserve_param *)(ecn); + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + parameter_len = (uint16_t) sizeof(struct sctp_cookie_perserve_param); + cookie_preserve = (struct sctp_cookie_perserve_param *)(mtod(m, caddr_t)+chunk_len); cookie_preserve->ph.param_type = htons(SCTP_COOKIE_PRESERVE); - cookie_preserve->ph.param_length = htons( - sizeof(*cookie_preserve)); + cookie_preserve->ph.param_length = htons(parameter_len); cookie_preserve->time = htonl(stcb->asoc.cookie_preserve_req); - SCTP_BUF_LEN(m) += sizeof(*cookie_preserve); - ecn = (struct sctp_ecn_supported_param *)( - (caddr_t)cookie_preserve + sizeof(*cookie_preserve)); stcb->asoc.cookie_preserve_req = 0; + chunk_len += parameter_len; } /* ECN parameter */ if (stcb->asoc.ecn_allowed == 1) { - ecn->ph.param_type = htons(SCTP_ECN_CAPABLE); - ecn->ph.param_length = htons(sizeof(*ecn)); - SCTP_BUF_LEN(m) += sizeof(*ecn); - prsctp = (struct sctp_prsctp_supported_param *)((caddr_t)ecn + - sizeof(*ecn)); - } else { - prsctp = (struct sctp_prsctp_supported_param *)((caddr_t)ecn); + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + parameter_len = (uint16_t) sizeof(struct sctp_paramhdr); + ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len); + ph->param_type = htons(SCTP_ECN_CAPABLE); + ph->param_length = htons(parameter_len); + chunk_len += parameter_len; + } + /* And now tell the peer we do support PR-SCTP. */ + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; } - /* And now tell the peer we do pr-sctp */ - prsctp->ph.param_type = htons(SCTP_PRSCTP_SUPPORTED); - prsctp->ph.param_length = htons(sizeof(*prsctp)); - SCTP_BUF_LEN(m) += sizeof(*prsctp); + parameter_len = (uint16_t) sizeof(struct sctp_paramhdr); + ph = (struct sctp_paramhdr *)(mtod(m, caddr_t)+chunk_len); + ph->param_type = htons(SCTP_PRSCTP_SUPPORTED); + ph->param_length = htons(parameter_len); + chunk_len += parameter_len; /* And now tell the peer we do all the extensions */ - pr_supported = (struct sctp_supported_chunk_types_param *) - ((caddr_t)prsctp + sizeof(*prsctp)); + pr_supported = (struct sctp_supported_chunk_types_param *)(mtod(m, caddr_t)+chunk_len); pr_supported->ph.param_type = htons(SCTP_SUPPORTED_CHUNK_EXT); num_ext = 0; pr_supported->chunk_types[num_ext++] = SCTP_ASCONF; @@ -4742,99 +4786,94 @@ sctp_send_initiate(struct sctp_inpcb *in if (stcb->asoc.sctp_nr_sack_on_off == 1) { pr_supported->chunk_types[num_ext++] = SCTP_NR_SELECTIVE_ACK; } - p_len = sizeof(*pr_supported) + num_ext; - pr_supported->ph.param_length = htons(p_len); - bzero((caddr_t)pr_supported + p_len, SCTP_SIZE32(p_len) - p_len); - SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); - + parameter_len = (uint16_t) sizeof(struct sctp_supported_chunk_types_param) + num_ext; + pr_supported->ph.param_length = htons(parameter_len); + padding_len = SCTP_SIZE32(parameter_len) - parameter_len; + chunk_len += parameter_len; /* add authentication parameters */ if (!SCTP_BASE_SYSCTL(sctp_auth_disable)) { - struct sctp_auth_random *randp; - struct sctp_auth_hmac_algo *hmacs; - struct sctp_auth_chunk_list *chunks; - /* attach RANDOM parameter, if available */ if (stcb->asoc.authinfo.random != NULL) { - randp = (struct sctp_auth_random *)(mtod(m, caddr_t)+SCTP_BUF_LEN(m)); - p_len = sizeof(*randp) + stcb->asoc.authinfo.random_len; + struct sctp_auth_random *randp; + + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + randp = (struct sctp_auth_random *)(mtod(m, caddr_t)+chunk_len); + parameter_len = (uint16_t) sizeof(struct sctp_auth_random) + stcb->asoc.authinfo.random_len; /* random key already contains the header */ - bcopy(stcb->asoc.authinfo.random->key, randp, p_len); - /* zero out any padding required */ - bzero((caddr_t)randp + p_len, SCTP_SIZE32(p_len) - p_len); - SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); + memcpy(randp, stcb->asoc.authinfo.random->key, parameter_len); + padding_len = SCTP_SIZE32(parameter_len) - parameter_len; + chunk_len += parameter_len; } /* add HMAC_ALGO parameter */ - hmacs = (struct sctp_auth_hmac_algo *)(mtod(m, caddr_t)+SCTP_BUF_LEN(m)); - p_len = sctp_serialize_hmaclist(stcb->asoc.local_hmacs, - (uint8_t *) hmacs->hmac_ids); - if (p_len > 0) { - p_len += sizeof(*hmacs); + if ((stcb->asoc.local_hmacs != NULL) && + (stcb->asoc.local_hmacs->num_algo > 0)) { + struct sctp_auth_hmac_algo *hmacs; + + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + hmacs = (struct sctp_auth_hmac_algo *)(mtod(m, caddr_t)+chunk_len); + parameter_len = (uint16_t) (sizeof(struct sctp_auth_hmac_algo) + + stcb->asoc.local_hmacs->num_algo * sizeof(uint16_t)); hmacs->ph.param_type = htons(SCTP_HMAC_LIST); - hmacs->ph.param_length = htons(p_len); - /* zero out any padding required */ - bzero((caddr_t)hmacs + p_len, SCTP_SIZE32(p_len) - p_len); - SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); + hmacs->ph.param_length = htons(parameter_len); + sctp_serialize_hmaclist(stcb->asoc.local_hmacs, (uint8_t *) hmacs->hmac_ids); + padding_len = SCTP_SIZE32(parameter_len) - parameter_len; + chunk_len += parameter_len; } /* add CHUNKS parameter */ - chunks = (struct sctp_auth_chunk_list *)(mtod(m, caddr_t)+SCTP_BUF_LEN(m)); - p_len = sctp_serialize_auth_chunks(stcb->asoc.local_auth_chunks, - chunks->chunk_types); - if (p_len > 0) { - p_len += sizeof(*chunks); + if (sctp_auth_get_chklist_size(stcb->asoc.local_auth_chunks) > 0) { + struct sctp_auth_chunk_list *chunks; + + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + chunks = (struct sctp_auth_chunk_list *)(mtod(m, caddr_t)+chunk_len); + parameter_len = (uint16_t) (sizeof(struct sctp_auth_chunk_list) + + sctp_auth_get_chklist_size(stcb->asoc.local_auth_chunks)); chunks->ph.param_type = htons(SCTP_CHUNK_LIST); - chunks->ph.param_length = htons(p_len); - /* zero out any padding required */ - bzero((caddr_t)chunks + p_len, SCTP_SIZE32(p_len) - p_len); - SCTP_BUF_LEN(m) += SCTP_SIZE32(p_len); + chunks->ph.param_length = htons(parameter_len); + sctp_serialize_auth_chunks(stcb->asoc.local_auth_chunks, chunks->chunk_types); + padding_len = SCTP_SIZE32(parameter_len) - parameter_len; + chunk_len += parameter_len; } } - /* now the addresses */ - { - struct sctp_scoping scp; - - /* - * To optimize this we could put the scoping stuff into a - * structure and remove the individual uint8's from the - * assoc structure. Then we could just sifa in the address - * within the stcb. But for now this is a quick hack to get - * the address stuff teased apart. - */ - - scp.ipv4_addr_legal = stcb->asoc.ipv4_addr_legal; - scp.ipv6_addr_legal = stcb->asoc.ipv6_addr_legal; - scp.loopback_scope = stcb->asoc.loopback_scope; - scp.ipv4_local_scope = stcb->asoc.ipv4_local_scope; - scp.local_scope = stcb->asoc.local_scope; - scp.site_scope = stcb->asoc.site_scope; - - sctp_add_addresses_to_i_ia(inp, stcb, &scp, m, cnt_inits_to); - } + SCTP_BUF_LEN(m) = chunk_len; - /* calulate the size and update pkt header and chunk header */ - p_len = 0; - for (m_at = m; m_at; m_at = SCTP_BUF_NEXT(m_at)) { - if (SCTP_BUF_NEXT(m_at) == NULL) - mp_last = m_at; - p_len += SCTP_BUF_LEN(m_at); - } - init->ch.chunk_length = htons(p_len); + /* now the addresses */ /* - * We sifa 0 here to NOT set IP_DF if its IPv4, we ignore the return - * here since the timer will drive a retranmission. - */ + * To optimize this we could put the scoping stuff into a structure + * and remove the individual uint8's from the assoc structure. Then + * we could just sifa in the address within the stcb. But for now + * this is a quick hack to get the address stuff teased apart. + */ + scp.ipv4_addr_legal = stcb->asoc.ipv4_addr_legal; + scp.ipv6_addr_legal = stcb->asoc.ipv6_addr_legal; + scp.loopback_scope = stcb->asoc.loopback_scope; + scp.ipv4_local_scope = stcb->asoc.ipv4_local_scope; + scp.local_scope = stcb->asoc.local_scope; + scp.site_scope = stcb->asoc.site_scope; + sctp_add_addresses_to_i_ia(inp, stcb, &scp, m, cnt_inits_to, &padding_len, &chunk_len); + + init->ch.chunk_length = htons(chunk_len); + if (padding_len > 0) { + struct mbuf *m_at, *mp_last; - /* I don't expect this to execute but we will be safe here */ - padval = p_len % 4; - if ((padval) && (mp_last)) { - /* - * The compiler worries that mp_last may not be set even - * though I think it is impossible :-> however we add - * mp_last here just in case. - */ - ret = sctp_add_pad_tombuf(mp_last, (4 - padval)); - if (ret) { - /* Houston we have a problem, no space */ + mp_last = NULL; + for (m_at = m; m_at; m_at = SCTP_BUF_NEXT(m_at)) { + if (SCTP_BUF_NEXT(m_at) == NULL) + mp_last = m_at; + } + if ((mp_last == NULL) || sctp_add_pad_tombuf(mp_last, padding_len)) { sctp_m_freem(m); return; } @@ -5753,7 +5792,7 @@ do_a_abort: /* I can have what I want :> */ initack->init.num_outbound_streams = htons(i_want); } - /* tell him his limt. */ + /* tell him his limit. */ initack->init.num_inbound_streams = htons(inp->sctp_ep.max_open_streams_intome); @@ -5869,7 +5908,7 @@ do_a_abort: scp.ipv4_local_scope = stc.ipv4_scope; scp.local_scope = stc.local_scope; scp.site_scope = stc.site_scope; - m_at = sctp_add_addresses_to_i_ia(inp, stcb, &scp, m_at, cnt_inits_to); + m_at = sctp_add_addresses_to_i_ia(inp, stcb, &scp, m_at, cnt_inits_to, NULL, NULL); } /* tack on the operational error if present */ Modified: stable/9/sys/netinet/sctp_output.h ============================================================================== --- stable/9/sys/netinet/sctp_output.h Sun Jul 7 14:20:00 2013 (r252952) +++ stable/9/sys/netinet/sctp_output.h Sun Jul 7 15:18:09 2013 (r252953) @@ -46,7 +46,8 @@ sctp_add_addresses_to_i_ia(struct sctp_i struct sctp_tcb *stcb, struct sctp_scoping *scope, struct mbuf *m_at, - int cnt_inits_to); + int cnt_inits_to, + uint16_t * padding_len, uint16_t * chunk_len); int sctp_is_addr_restricted(struct sctp_tcb *, struct sctp_ifa *); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 15:47:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1D8AEB6A; Sun, 7 Jul 2013 15:47:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F3BDC1914; Sun, 7 Jul 2013 15:47:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67FlidZ039997; Sun, 7 Jul 2013 15:47:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67FlicC039996; Sun, 7 Jul 2013 15:47:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071547.r67FlicC039996@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 15:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252954 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 15:47:45 -0000 Author: tuexen Date: Sun Jul 7 15:47:44 2013 New Revision: 252954 URL: http://svnweb.freebsd.org/changeset/base/252954 Log: MFC r244026: Use correct padding of the ABORT chunk in case of an user initiated abort cause is used. Modified: stable/9/sys/netinet/sctp_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 15:18:09 2013 (r252953) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 15:47:44 2013 (r252954) @@ -10733,45 +10733,50 @@ sctp_send_abort_tcb(struct sctp_tcb *stc #endif ) { - struct mbuf *m_abort; - struct mbuf *m_out = NULL, *m_end = NULL; - struct sctp_abort_chunk *abort = NULL; - int sz; - uint32_t auth_offset = 0; + struct mbuf *m_abort, *m, *m_last; + struct mbuf *m_out, *m_end = NULL; + struct sctp_abort_chunk *abort; struct sctp_auth_chunk *auth = NULL; struct sctp_nets *net; + uint32_t auth_offset = 0; + uint16_t cause_len, chunk_len, padding_len; + SCTP_TCB_LOCK_ASSERT(stcb); /*- * Add an AUTH chunk, if chunk requires it and save the offset into * the chain for AUTH */ if (sctp_auth_is_required_chunk(SCTP_ABORT_ASSOCIATION, stcb->asoc.peer_auth_chunks)) { - m_out = sctp_add_auth_chunk(m_out, &m_end, &auth, &auth_offset, + m_out = sctp_add_auth_chunk(NULL, &m_end, &auth, &auth_offset, stcb, SCTP_ABORT_ASSOCIATION); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); + } else { + m_out = NULL; } - SCTP_TCB_LOCK_ASSERT(stcb); m_abort = sctp_get_mbuf_for_msg(sizeof(struct sctp_abort_chunk), 0, M_DONTWAIT, 1, MT_HEADER); if (m_abort == NULL) { - /* no mbuf's */ - if (m_out) + if (m_out) { sctp_m_freem(m_out); + } + if (operr) { + sctp_m_freem(operr); + } return; } /* link in any error */ SCTP_BUF_NEXT(m_abort) = operr; - sz = 0; - if (operr) { - struct mbuf *n; - - n = operr; - while (n) { - sz += SCTP_BUF_LEN(n); - n = SCTP_BUF_NEXT(n); + cause_len = 0; + m_last = NULL; + for (m = operr; m; m = SCTP_BUF_NEXT(m)) { + cause_len += (uint16_t) SCTP_BUF_LEN(m); + if (SCTP_BUF_NEXT(m) == NULL) { + m_last = m; } } - SCTP_BUF_LEN(m_abort) = sizeof(*abort); + SCTP_BUF_LEN(m_abort) = sizeof(struct sctp_abort_chunk); + chunk_len = (uint16_t) sizeof(struct sctp_abort_chunk) + cause_len; + padding_len = SCTP_SIZE32(chunk_len) - chunk_len; if (m_out == NULL) { /* NO Auth chunk prepended, so reserve space in front */ SCTP_BUF_RESV_UF(m_abort, SCTP_MIN_OVERHEAD); @@ -10785,12 +10790,18 @@ sctp_send_abort_tcb(struct sctp_tcb *stc } else { net = stcb->asoc.primary_destination; } - /* fill in the ABORT chunk */ + /* Fill in the ABORT chunk header. */ abort = mtod(m_abort, struct sctp_abort_chunk *); abort->ch.chunk_type = SCTP_ABORT_ASSOCIATION; abort->ch.chunk_flags = 0; - abort->ch.chunk_length = htons(sizeof(*abort) + sz); - + abort->ch.chunk_length = htons(chunk_len); + /* Add padding, if necessary. */ + if (padding_len > 0) { + if ((m_last == NULL) || sctp_add_pad_tombuf(m_last, padding_len)) { + sctp_m_freem(m_out); + return; + } + } (void)sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, (struct sockaddr *)&net->ro._l_addr, m_out, auth_offset, auth, stcb->asoc.authinfo.active_keyid, 1, 0, 0, From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 15:50:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 91FF8DA1; Sun, 7 Jul 2013 15:50:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8497E1925; Sun, 7 Jul 2013 15:50:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67Fo1So040469; Sun, 7 Jul 2013 15:50:01 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67Fo1J1040468; Sun, 7 Jul 2013 15:50:01 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071550.r67Fo1J1040468@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 15:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252955 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 15:50:01 -0000 Author: tuexen Date: Sun Jul 7 15:50:01 2013 New Revision: 252955 URL: http://svnweb.freebsd.org/changeset/base/252955 Log: MFC r244033: Get it compiling without INET and INET6 support (mainly userland stack). Modified: stable/9/sys/netinet/sctp_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 15:47:44 2013 (r252954) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 15:50:01 2013 (r252955) @@ -4599,7 +4599,11 @@ sctp_send_initiate(struct sctp_inpcb *in struct mbuf *m; struct sctp_nets *net; struct sctp_init_chunk *init; + +#if defined(INET) || defined(INET6) struct sctp_supported_addr_param *sup_addr; + +#endif struct sctp_adaptation_layer_indication *ali; struct sctp_supported_chunk_types_param *pr_supported; struct sctp_paramhdr *ph; From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 15:51:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 58120F22; Sun, 7 Jul 2013 15:51:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4ACF3193A; Sun, 7 Jul 2013 15:51:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67FpTZd042267; Sun, 7 Jul 2013 15:51:29 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67FpTBu042266; Sun, 7 Jul 2013 15:51:29 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307071551.r67FpTBu042266@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 7 Jul 2013 15:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252956 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 15:51:29 -0000 Author: pfg Date: Sun Jul 7 15:51:28 2013 New Revision: 252956 URL: http://svnweb.freebsd.org/changeset/base/252956 Log: Implement SEEK_HOLE/SEEK_DATA for ext2fs. Merged from r236044 on UFS. MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Sun Jul 7 15:50:01 2013 (r252955) +++ head/sys/fs/ext2fs/ext2_vnops.c Sun Jul 7 15:51:28 2013 (r252956) @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -92,6 +93,7 @@ static vop_close_t ext2_close; static vop_create_t ext2_create; static vop_fsync_t ext2_fsync; static vop_getattr_t ext2_getattr; +static vop_ioctl_t ext2_ioctl; static vop_link_t ext2_link; static vop_mkdir_t ext2_mkdir; static vop_mknod_t ext2_mknod; @@ -122,6 +124,7 @@ struct vop_vector ext2_vnodeops = { .vop_fsync = ext2_fsync, .vop_getattr = ext2_getattr, .vop_inactive = ext2_inactive, + .vop_ioctl = ext2_ioctl, .vop_link = ext2_link, .vop_lookup = vfs_cache_lookup, .vop_mkdir = ext2_mkdir, @@ -1427,6 +1430,9 @@ ext2_pathconf(struct vop_pathconf_args * case _PC_NO_TRUNC: *ap->a_retval = 1; return (0); + case _PC_MIN_HOLE_SIZE: + *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; + return(0); default: return (EINVAL); } @@ -1702,6 +1708,20 @@ ext2_read(struct vop_read_args *ap) return (error); } +static int +ext2_ioctl(struct vop_ioctl_args *ap) +{ + + switch (ap->a_command) { + case FIOSEEKDATA: + case FIOSEEKHOLE: + return (vn_bmap_seekhole(ap->a_vp, ap->a_command, + (off_t *)ap->a_data, ap->a_cred)); + default: + return (ENOTTY); + } +} + /* * Vnode op for writing. */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 15:52:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AB916FA; Sun, 7 Jul 2013 15:52:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9DBC1194A; Sun, 7 Jul 2013 15:52:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67Fqbpb042538; Sun, 7 Jul 2013 15:52:37 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67FqbTw042536; Sun, 7 Jul 2013 15:52:37 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071552.r67FqbTw042536@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 15:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252957 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 15:52:37 -0000 Author: tuexen Date: Sun Jul 7 15:52:37 2013 New Revision: 252957 URL: http://svnweb.freebsd.org/changeset/base/252957 Log: MFC r244728: Fix a copy and paste error. Modified: stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Jul 7 15:51:28 2013 (r252956) +++ stable/9/sys/netinet/sctputil.c Sun Jul 7 15:52:37 2013 (r252957) @@ -4955,7 +4955,7 @@ sctp_get_ifa_hash_val(struct sockaddr *a } #endif #ifdef INET6 - case INET6: + case AF_INET6: { struct sockaddr_in6 *sin6; uint32_t hash_of_addr; From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 15:55:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D98F531A; Sun, 7 Jul 2013 15:55:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC558195F; Sun, 7 Jul 2013 15:55:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67Ft1HR043047; Sun, 7 Jul 2013 15:55:01 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67Ft1mD043046; Sun, 7 Jul 2013 15:55:01 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071555.r67Ft1mD043046@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 15:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252958 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 15:55:01 -0000 Author: tuexen Date: Sun Jul 7 15:55:01 2013 New Revision: 252958 URL: http://svnweb.freebsd.org/changeset/base/252958 Log: MFC r244729: Minor cleanups of debug messages. Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 15:52:37 2013 (r252957) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 15:55:01 2013 (r252958) @@ -2694,9 +2694,9 @@ sctp_inpcb_bind(struct socket *so, struc ip_inp = (struct inpcb *)so->so_pcb; #ifdef SCTP_DEBUG if (addr) { - SCTPDBG(SCTP_DEBUG_PCB1, "Bind called port:%d\n", + SCTPDBG(SCTP_DEBUG_PCB1, "Bind called port: %d\n", ntohs(((struct sockaddr_in *)addr)->sin_port)); - SCTPDBG(SCTP_DEBUG_PCB1, "Addr :"); + SCTPDBG(SCTP_DEBUG_PCB1, "Addr: "); SCTPDBG_ADDR(SCTP_DEBUG_PCB1, addr); } #endif From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 15:57:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D4FA94F7; Sun, 7 Jul 2013 15:57:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C7597196C; Sun, 7 Jul 2013 15:57:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67FvCuo043378; Sun, 7 Jul 2013 15:57:12 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67FvCZM043377; Sun, 7 Jul 2013 15:57:12 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071557.r67FvCZM043377@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 15:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252959 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 15:57:12 -0000 Author: tuexen Date: Sun Jul 7 15:57:12 2013 New Revision: 252959 URL: http://svnweb.freebsd.org/changeset/base/252959 Log: MFC r244730: Some cleanups. Modified: stable/9/sys/netinet/sctp_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Sun Jul 7 15:55:01 2013 (r252958) +++ stable/9/sys/netinet/sctp_usrreq.c Sun Jul 7 15:57:12 2013 (r252959) @@ -547,27 +547,21 @@ try_again: static int sctp_bind(struct socket *so, struct sockaddr *addr, struct thread *p) { - struct sctp_inpcb *inp = NULL; - int error; + struct sctp_inpcb *inp; -#ifdef INET - if (addr && addr->sa_family != AF_INET) { - /* must be a v4 address! */ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - return (EINVAL); - } -#endif /* INET6 */ - if (addr && (addr->sa_len != sizeof(struct sockaddr_in))) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - return (EINVAL); - } inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } - error = sctp_inpcb_bind(so, addr, NULL, p); - return (error); + if (addr != NULL) { + if ((addr->sa_family != AF_INET) || + (addr->sa_len != sizeof(struct sockaddr_in))) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + return (EINVAL); + } + } + return (sctp_inpcb_bind(so, addr, NULL, p)); } #endif From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:01:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 50B2B7B1; Sun, 7 Jul 2013 16:01:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3341719AA; Sun, 7 Jul 2013 16:01:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67G12q7045721; Sun, 7 Jul 2013 16:01:02 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67G10kl045701; Sun, 7 Jul 2013 16:01:00 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071601.r67G10kl045701@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 16:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252960 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:01:02 -0000 Author: tuexen Date: Sun Jul 7 16:01:00 2013 New Revision: 252960 URL: http://svnweb.freebsd.org/changeset/base/252960 Log: MFC r246588: Fix a bug where HEARTBEATs were still sent in SHUTDOWN_SENT or SHUTDOWN_ACK_SENT state. While there, make the corresponding code consistent. Modified: stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_timer.c stable/9/sys/netinet/sctp_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sun Jul 7 15:57:12 2013 (r252959) +++ stable/9/sys/netinet/sctp_indata.c Sun Jul 7 16:01:00 2013 (r252960) @@ -4262,19 +4262,19 @@ again: (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; - if (asoc->alternate) { - netp = asoc->alternate; - } else { - netp = asoc->primary_destination; - } if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { goto abort_out_now; } SCTP_STAT_DECR_GAUGE32(sctps_currestab); SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_send_shutdown_ack(stcb, netp); sctp_stop_timers_for_shutdown(stcb); + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } + sctp_send_shutdown_ack(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, netp); } @@ -4973,11 +4973,6 @@ sctp_handle_sack(struct mbuf *m, int off } else { struct sctp_nets *netp; - if (asoc->alternate) { - netp = asoc->alternate; - } else { - netp = asoc->primary_destination; - } if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); @@ -4985,6 +4980,11 @@ sctp_handle_sack(struct mbuf *m, int off SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); @@ -4996,19 +4996,19 @@ sctp_handle_sack(struct mbuf *m, int off (asoc->stream_queue_cnt == 0)) { struct sctp_nets *netp; - if (asoc->alternate) { - netp = asoc->alternate; - } else { - netp = asoc->primary_destination; - } if (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT) { goto abort_out_now; } SCTP_STAT_DECR_GAUGE32(sctps_currestab); SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); - sctp_send_shutdown_ack(stcb, netp); sctp_stop_timers_for_shutdown(stcb); + if (asoc->alternate) { + netp = asoc->alternate; + } else { + netp = asoc->primary_destination; + } + sctp_send_shutdown_ack(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, netp); return; Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Jul 7 15:57:12 2013 (r252959) +++ stable/9/sys/netinet/sctp_input.c Sun Jul 7 16:01:00 2013 (r252960) @@ -956,7 +956,6 @@ sctp_handle_shutdown(struct sctp_shutdow } else { /* no outstanding data to send, so move on... */ /* send SHUTDOWN-ACK */ - sctp_send_shutdown_ack(stcb, net); /* move to SHUTDOWN-ACK-SENT state */ if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { @@ -965,6 +964,7 @@ sctp_handle_shutdown(struct sctp_shutdow SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_ACK_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); sctp_stop_timers_for_shutdown(stcb); + sctp_send_shutdown_ack(stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, net); } Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 15:57:12 2013 (r252959) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 16:01:00 2013 (r252960) @@ -6574,12 +6574,13 @@ sctp_sendall_iterator(struct sctp_inpcb * only send SHUTDOWN the first time * through */ - sctp_send_shutdown(stcb, net); if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + sctp_send_shutdown(stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, @@ -13092,18 +13093,19 @@ dataless_eof: (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { struct sctp_nets *netp; - if (stcb->asoc.alternate) { - netp = stcb->asoc.alternate; - } else { - netp = stcb->asoc.primary_destination; - } /* only send SHUTDOWN the first time through */ - sctp_send_shutdown(stcb, netp); if (SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (stcb->asoc.alternate) { + netp = stcb->asoc.alternate; + } else { + netp = stcb->asoc.primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 15:57:12 2013 (r252959) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 16:01:00 2013 (r252960) @@ -3332,22 +3332,23 @@ sctp_inpcb_free(struct sctp_inpcb *inp, (SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { struct sctp_nets *netp; - if (asoc->asoc.alternate) { - netp = asoc->asoc.alternate; - } else { - netp = asoc->asoc.primary_destination; - } /* * there is nothing queued to send, * so I send shutdown */ - sctp_send_shutdown(asoc, netp); if ((SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(&asoc->asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(&asoc->asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(asoc); + if (asoc->asoc.alternate) { + netp = asoc->asoc.alternate; + } else { + netp = asoc->asoc.primary_destination; + } + sctp_send_shutdown(asoc, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, asoc->sctp_ep, asoc, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, asoc->sctp_ep, asoc, Modified: stable/9/sys/netinet/sctp_timer.c ============================================================================== --- stable/9/sys/netinet/sctp_timer.c Sun Jul 7 15:57:12 2013 (r252959) +++ stable/9/sys/netinet/sctp_timer.c Sun Jul 7 16:01:00 2013 (r252960) @@ -1560,18 +1560,19 @@ sctp_autoclose_timer(struct sctp_inpcb * /* only send SHUTDOWN 1st time thru */ struct sctp_nets *netp; - if (stcb->asoc.alternate) { - netp = stcb->asoc.alternate; - } else { - netp = stcb->asoc.primary_destination; - } - sctp_send_shutdown(stcb, netp); if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (stcb->asoc.alternate) { + netp = stcb->asoc.alternate; + } else { + netp = stcb->asoc.primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Sun Jul 7 15:57:12 2013 (r252959) +++ stable/9/sys/netinet/sctp_usrreq.c Sun Jul 7 16:01:00 2013 (r252960) @@ -794,25 +794,24 @@ sctp_disconnect(struct socket *so) /* only send SHUTDOWN 1st time thru */ struct sctp_nets *netp; - if (stcb->asoc.alternate) { - netp = stcb->asoc.alternate; - } else { - netp = stcb->asoc.primary_destination; - } - sctp_stop_timers_for_shutdown(stcb); - sctp_send_shutdown(stcb, netp); - sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_LOCKED); if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (stcb->asoc.alternate) { + netp = stcb->asoc.alternate; + } else { + netp = stcb->asoc.primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, netp); - + sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_LOCKED); } } else { /* @@ -1014,24 +1013,24 @@ sctp_shutdown(struct socket *so) /* only send SHUTDOWN the first time through */ struct sctp_nets *netp; - if (stcb->asoc.alternate) { - netp = stcb->asoc.alternate; - } else { - netp = stcb->asoc.primary_destination; - } - sctp_stop_timers_for_shutdown(stcb); - sctp_send_shutdown(stcb, netp); - sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_LOCKED); if ((SCTP_GET_STATE(asoc) == SCTP_STATE_OPEN) || (SCTP_GET_STATE(asoc) == SCTP_STATE_SHUTDOWN_RECEIVED)) { SCTP_STAT_DECR_GAUGE32(sctps_currestab); } SCTP_SET_STATE(asoc, SCTP_STATE_SHUTDOWN_SENT); SCTP_CLEAR_SUBSTATE(asoc, SCTP_STATE_SHUTDOWN_PENDING); + sctp_stop_timers_for_shutdown(stcb); + if (stcb->asoc.alternate) { + netp = stcb->asoc.alternate; + } else { + netp = stcb->asoc.primary_destination; + } + sctp_send_shutdown(stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, netp); sctp_timer_start(SCTP_TIMER_TYPE_SHUTDOWNGUARD, stcb->sctp_ep, stcb, netp); + sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_T3, SCTP_SO_LOCKED); } } else { /* From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:04:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C7D969ED; Sun, 7 Jul 2013 16:04:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B907C19CF; Sun, 7 Jul 2013 16:04:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67G40XG046290; Sun, 7 Jul 2013 16:04:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67G3wSR046267; Sun, 7 Jul 2013 16:03:58 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071603.r67G3wSR046267@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 16:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252961 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:04:00 -0000 Author: tuexen Date: Sun Jul 7 16:03:58 2013 New Revision: 252961 URL: http://svnweb.freebsd.org/changeset/base/252961 Log: MFC r246595: Cleanup the handling of address scopes. Announce in the INIT/INIT-ACK only the supported address types. While there, do some whitespace cleanups. Modified: stable/9/sys/netinet/sctp.h stable/9/sys/netinet/sctp_asconf.c stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_output.h stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_structs.h stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp.h ============================================================================== --- stable/9/sys/netinet/sctp.h Sun Jul 7 16:01:00 2013 (r252960) +++ stable/9/sys/netinet/sctp.h Sun Jul 7 16:03:58 2013 (r252961) @@ -500,12 +500,12 @@ struct sctp_error_unrecognized_chunk { #define SCTP_PCB_FLAGS_SOCKET_GONE 0x10000000 #define SCTP_PCB_FLAGS_SOCKET_ALLGONE 0x20000000 #define SCTP_PCB_FLAGS_SOCKET_CANT_READ 0x40000000 + /* flags to copy to new PCB */ #define SCTP_PCB_COPY_FLAGS (SCTP_PCB_FLAGS_BOUNDALL|\ SCTP_PCB_FLAGS_WAKEINPUT|\ SCTP_PCB_FLAGS_BOUND_V6) - /* * PCB Features (in sctp_features bitmask) */ Modified: stable/9/sys/netinet/sctp_asconf.c ============================================================================== --- stable/9/sys/netinet/sctp_asconf.c Sun Jul 7 16:01:00 2013 (r252960) +++ stable/9/sys/netinet/sctp_asconf.c Sun Jul 7 16:03:58 2013 (r252961) @@ -1916,7 +1916,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * return; } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { - if (stcb->asoc.local_scope == 0) { + if (stcb->asoc.scope.local_scope == 0) { return; } /* is it the right link local scope? */ @@ -1924,7 +1924,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * return; } } - if (stcb->asoc.site_scope == 0 && + if (stcb->asoc.scope.site_scope == 0 && IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) { return; } @@ -1948,7 +1948,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb * /* we skip unspecifed addresses */ return; } - if (stcb->asoc.ipv4_local_scope == 0 && + if (stcb->asoc.scope.ipv4_local_scope == 0 && IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { return; } @@ -2106,7 +2106,7 @@ sctp_asconf_iterator_stcb(struct sctp_in continue; } if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { - if (stcb->asoc.local_scope == 0) { + if (stcb->asoc.scope.local_scope == 0) { continue; } /* is it the right link local scope? */ @@ -2135,7 +2135,7 @@ sctp_asconf_iterator_stcb(struct sctp_in /* we skip unspecifed addresses */ continue; } - if (stcb->asoc.ipv4_local_scope == 0 && + if (stcb->asoc.scope.ipv4_local_scope == 0 && IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { continue; } @@ -2198,13 +2198,7 @@ sctp_asconf_iterator_stcb(struct sctp_in } } else { /* Need to check scopes for this guy */ - if (sctp_is_address_in_scope(ifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(ifa, &stcb->asoc.scope, 0) == 0) { continue; } } @@ -2437,7 +2431,7 @@ sctp_find_valid_localaddr(struct sctp_tc return (NULL); } LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { - if (stcb->asoc.loopback_scope == 0 && + if (stcb->asoc.scope.loopback_scope == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { /* Skip if loopback_scope not set */ continue; @@ -2446,7 +2440,7 @@ sctp_find_valid_localaddr(struct sctp_tc switch (sctp_ifa->address.sa.sa_family) { #ifdef INET case AF_INET: - if (stcb->asoc.ipv4_addr_legal) { + if (stcb->asoc.scope.ipv4_addr_legal) { struct sockaddr_in *sin; sin = (struct sockaddr_in *)&sctp_ifa->address.sa; @@ -2454,7 +2448,7 @@ sctp_find_valid_localaddr(struct sctp_tc /* skip unspecifed addresses */ continue; } - if (stcb->asoc.ipv4_local_scope == 0 && + if (stcb->asoc.scope.ipv4_local_scope == 0 && IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) continue; @@ -2473,7 +2467,7 @@ sctp_find_valid_localaddr(struct sctp_tc #endif #ifdef INET6 case AF_INET6: - if (stcb->asoc.ipv6_addr_legal) { + if (stcb->asoc.scope.ipv6_addr_legal) { struct sockaddr_in6 *sin6; if (sctp_ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) { @@ -2487,10 +2481,10 @@ sctp_find_valid_localaddr(struct sctp_tc */ continue; } - if (stcb->asoc.local_scope == 0 && + if (stcb->asoc.scope.local_scope == 0 && IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) continue; - if (stcb->asoc.site_scope == 0 && + if (stcb->asoc.scope.site_scope == 0 && IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) continue; Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Jul 7 16:01:00 2013 (r252960) +++ stable/9/sys/netinet/sctp_input.c Sun Jul 7 16:03:58 2013 (r252961) @@ -2130,13 +2130,13 @@ sctp_process_cookie_new(struct mbuf *m, asoc = &stcb->asoc; /* get scope variables out of cookie */ - asoc->ipv4_local_scope = cookie->ipv4_scope; - asoc->site_scope = cookie->site_scope; - asoc->local_scope = cookie->local_scope; - asoc->loopback_scope = cookie->loopback_scope; + asoc->scope.ipv4_local_scope = cookie->ipv4_scope; + asoc->scope.site_scope = cookie->site_scope; + asoc->scope.local_scope = cookie->local_scope; + asoc->scope.loopback_scope = cookie->loopback_scope; - if ((asoc->ipv4_addr_legal != cookie->ipv4_addr_legal) || - (asoc->ipv6_addr_legal != cookie->ipv6_addr_legal)) { + if ((asoc->scope.ipv4_addr_legal != cookie->ipv4_addr_legal) || + (asoc->scope.ipv6_addr_legal != cookie->ipv6_addr_legal)) { struct mbuf *op_err; /* Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 16:01:00 2013 (r252960) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 16:03:58 2013 (r252961) @@ -1863,15 +1863,10 @@ struct sack_track sack_array[256] = { int sctp_is_address_in_scope(struct sctp_ifa *ifa, - int ipv4_addr_legal, - int ipv6_addr_legal, - int loopback_scope, - int ipv4_local_scope, - int local_scope SCTP_UNUSED,/* XXX */ - int site_scope, + struct sctp_scoping *scope, int do_update) { - if ((loopback_scope == 0) && + if ((scope->loopback_scope == 0) && (ifa->ifn_p) && SCTP_IFN_IS_IFT_LOOP(ifa->ifn_p)) { /* * skip loopback if not in scope * @@ -1881,7 +1876,7 @@ sctp_is_address_in_scope(struct sctp_ifa switch (ifa->address.sa.sa_family) { #ifdef INET case AF_INET: - if (ipv4_addr_legal) { + if (scope->ipv4_addr_legal) { struct sockaddr_in *sin; sin = (struct sockaddr_in *)&ifa->address.sin; @@ -1889,7 +1884,7 @@ sctp_is_address_in_scope(struct sctp_ifa /* not in scope , unspecified */ return (0); } - if ((ipv4_local_scope == 0) && + if ((scope->ipv4_local_scope == 0) && (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))) { /* private address not in scope */ return (0); @@ -1901,7 +1896,7 @@ sctp_is_address_in_scope(struct sctp_ifa #endif #ifdef INET6 case AF_INET6: - if (ipv6_addr_legal) { + if (scope->ipv6_addr_legal) { struct sockaddr_in6 *sin6; /* @@ -1924,7 +1919,7 @@ sctp_is_address_in_scope(struct sctp_ifa (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))) { return (0); } - if ((site_scope == 0) && + if ((scope->site_scope == 0) && (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { return (0); } @@ -2063,13 +2058,7 @@ sctp_add_addresses_to_i_ia(struct sctp_i if (sctp_is_addr_restricted(stcb, sctp_ifap)) { continue; } - if (sctp_is_address_in_scope(sctp_ifap, - scope->ipv4_addr_legal, - scope->ipv6_addr_legal, - scope->loopback_scope, - scope->ipv4_local_scope, - scope->local_scope, - scope->site_scope, 1) == 0) { + if (sctp_is_address_in_scope(sctp_ifap, scope, 1) == 0) { continue; } cnt++; @@ -2099,12 +2088,7 @@ skip_count: continue; } if (sctp_is_address_in_scope(sctp_ifap, - scope->ipv4_addr_legal, - scope->ipv6_addr_legal, - scope->loopback_scope, - scope->ipv4_local_scope, - scope->local_scope, - scope->site_scope, 0) == 0) { + scope, 0) == 0) { continue; } if ((chunk_len != NULL) && @@ -2157,12 +2141,7 @@ skip_count: continue; } if (sctp_is_address_in_scope(laddr->ifa, - scope->ipv4_addr_legal, - scope->ipv6_addr_legal, - scope->loopback_scope, - scope->ipv4_local_scope, - scope->local_scope, - scope->site_scope, 1) == 0) { + scope, 1) == 0) { continue; } cnt++; @@ -2182,12 +2161,7 @@ skip_count: continue; } if (sctp_is_address_in_scope(laddr->ifa, - scope->ipv4_addr_legal, - scope->ipv6_addr_legal, - scope->loopback_scope, - scope->ipv4_local_scope, - scope->local_scope, - scope->site_scope, 0) == 0) { + scope, 0) == 0) { continue; } if ((chunk_len != NULL) && @@ -2801,13 +2775,7 @@ sctp_select_nth_preferred_addr_from_ifn_ } #endif if (stcb) { - if (sctp_is_address_in_scope(ifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(ifa, &stcb->asoc.scope, 0) == 0) { continue; } if (((non_asoc_addr_ok == 0) && @@ -2853,13 +2821,7 @@ sctp_count_num_preferred_boundall(struct continue; } if (stcb) { - if (sctp_is_address_in_scope(ifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(ifa, &stcb->asoc.scope, 0) == 0) { continue; } if (((non_asoc_addr_ok == 0) && @@ -3055,13 +3017,7 @@ again_with_private_addresses_allowed: continue; } if (stcb) { - if (sctp_is_address_in_scope(sifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(sifa, &stcb->asoc.scope, 0) == 0) { SCTPDBG(SCTP_DEBUG_OUTPUT2, "NOT in scope\n"); sifa = NULL; continue; @@ -3108,13 +3064,7 @@ plan_d: if (sifa == NULL) continue; if (stcb) { - if (sctp_is_address_in_scope(sifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + if (sctp_is_address_in_scope(sifa, &stcb->asoc.scope, 0) == 0) { sifa = NULL; continue; } @@ -3135,12 +3085,12 @@ plan_d: } } #ifdef INET - if ((retried == 0) && (stcb->asoc.ipv4_local_scope == 0)) { - stcb->asoc.ipv4_local_scope = 1; + if ((retried == 0) && (stcb->asoc.scope.ipv4_local_scope == 0)) { + stcb->asoc.scope.ipv4_local_scope = 1; retried = 1; goto again_with_private_addresses_allowed; } else if (retried == 1) { - stcb->asoc.ipv4_local_scope = 0; + stcb->asoc.scope.ipv4_local_scope = 0; } #endif out: @@ -3169,12 +3119,7 @@ out: } if (stcb) { if (sctp_is_address_in_scope(tmp_sifa, - stcb->asoc.ipv4_addr_legal, - stcb->asoc.ipv6_addr_legal, - stcb->asoc.loopback_scope, - stcb->asoc.ipv4_local_scope, - stcb->asoc.local_scope, - stcb->asoc.site_scope, 0) == 0) { + &stcb->asoc.scope, 0) == 0) { continue; } if (((non_asoc_addr_ok == 0) && @@ -4595,7 +4540,6 @@ sctp_send_initiate(struct sctp_inpcb *in #endif ) { - struct sctp_scoping scp; struct mbuf *m; struct sctp_nets *net; struct sctp_init_chunk *init; @@ -4675,37 +4619,29 @@ sctp_send_initiate(struct sctp_inpcb *in init->init.num_inbound_streams = htons(stcb->asoc.max_inbound_streams); init->init.initial_tsn = htonl(stcb->asoc.init_seq_number); -#if defined(INET) || defined(INET6) - /* now the address restriction */ - /* XXX Should we take the address family of the socket into account? */ - sup_addr = (struct sctp_supported_addr_param *)(mtod(m, caddr_t)+chunk_len); - sup_addr->ph.param_type = htons(SCTP_SUPPORTED_ADDRTYPE); -#ifdef INET6 -#ifdef INET - /* we support 2 types: IPv4/IPv6 */ - parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + 2 * sizeof(uint16_t)); - sup_addr->ph.param_length = htons(parameter_len); - sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); - sup_addr->addr_type[1] = htons(SCTP_IPV6_ADDRESS); - padding_len = 0; -#else - /* we support 1 type: IPv6 */ - parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); - sup_addr->ph.param_length = htons(parameter_len); - sup_addr->addr_type[0] = htons(SCTP_IPV6_ADDRESS); - sup_addr->addr_type[1] = htons(0); /* this is the padding */ - padding_len = (uint16_t) sizeof(uint16_t); -#endif -#else - /* we support 1 type: IPv4 */ - parameter_len = (uint16_t) (sizeof(struct sctp_paramhdr) + sizeof(uint16_t)); - sup_addr->ph.param_length = htons(parameter_len); - sup_addr->addr_type[0] = htons(SCTP_IPV4_ADDRESS); - sup_addr->addr_type[1] = htons(0); /* this is the padding */ - padding_len = (uint16_t) sizeof(uint16_t); -#endif - chunk_len += parameter_len; -#endif + if (stcb->asoc.scope.ipv4_addr_legal || stcb->asoc.scope.ipv6_addr_legal) { + uint8_t i; + + parameter_len = (uint16_t) sizeof(struct sctp_paramhdr); + if (stcb->asoc.scope.ipv4_addr_legal) { + parameter_len += (uint16_t) sizeof(uint16_t); + } + if (stcb->asoc.scope.ipv6_addr_legal) { + parameter_len += (uint16_t) sizeof(uint16_t); + } + sup_addr = (struct sctp_supported_addr_param *)(mtod(m, caddr_t)+chunk_len); + sup_addr->ph.param_type = htons(SCTP_SUPPORTED_ADDRTYPE); + sup_addr->ph.param_length = htons(parameter_len); + i = 0; + if (stcb->asoc.scope.ipv4_addr_legal) { + sup_addr->addr_type[i++] = htons(SCTP_IPV4_ADDRESS); + } + if (stcb->asoc.scope.ipv6_addr_legal) { + sup_addr->addr_type[i++] = htons(SCTP_IPV6_ADDRESS); + } + padding_len = 4 - 2 * i; + chunk_len += parameter_len; + } /* Adaptation layer indication parameter */ /* XXX: Should we include this always? */ if (padding_len > 0) { @@ -4860,13 +4796,7 @@ sctp_send_initiate(struct sctp_inpcb *in * we could just sifa in the address within the stcb. But for now * this is a quick hack to get the address stuff teased apart. */ - scp.ipv4_addr_legal = stcb->asoc.ipv4_addr_legal; - scp.ipv6_addr_legal = stcb->asoc.ipv6_addr_legal; - scp.loopback_scope = stcb->asoc.loopback_scope; - scp.ipv4_local_scope = stcb->asoc.ipv4_local_scope; - scp.local_scope = stcb->asoc.local_scope; - scp.site_scope = stcb->asoc.site_scope; - sctp_add_addresses_to_i_ia(inp, stcb, &scp, m, cnt_inits_to, &padding_len, &chunk_len); + sctp_add_addresses_to_i_ia(inp, stcb, &stcb->asoc.scope, m, cnt_inits_to, &padding_len, &chunk_len); init->ch.chunk_length = htons(chunk_len); if (padding_len > 0) { @@ -5507,24 +5437,16 @@ do_a_abort: */ stc.site_scope = stc.local_scope = stc.loopback_scope = 0; if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - struct inpcb *in_inp; - - /* Its a V6 socket */ - in_inp = (struct inpcb *)inp; stc.ipv6_addr_legal = 1; - /* Now look at the binding flag to see if V4 will be legal */ - if (SCTP_IPV6_V6ONLY(in_inp) == 0) { - stc.ipv4_addr_legal = 1; - } else { - /* V4 addresses are NOT legal on the association */ + if (SCTP_IPV6_V6ONLY(inp)) { stc.ipv4_addr_legal = 0; + } else { + stc.ipv4_addr_legal = 1; } } else { - /* Its a V4 socket, no - V6 */ - stc.ipv4_addr_legal = 1; stc.ipv6_addr_legal = 0; + stc.ipv4_addr_legal = 1; } - #ifdef SCTP_DONT_DO_PRIVADDR_SCOPE stc.ipv4_scope = 1; #else @@ -5629,10 +5551,10 @@ do_a_abort: #endif - stc.loopback_scope = asoc->loopback_scope; - stc.ipv4_scope = asoc->ipv4_local_scope; - stc.site_scope = asoc->site_scope; - stc.local_scope = asoc->local_scope; + stc.loopback_scope = asoc->scope.loopback_scope; + stc.ipv4_scope = asoc->scope.ipv4_local_scope; + stc.site_scope = asoc->scope.site_scope; + stc.local_scope = asoc->scope.local_scope; #ifdef INET6 /* Why do we not consider IPv4 LL addresses? */ TAILQ_FOREACH(lnet, &asoc->nets, sctp_next) { Modified: stable/9/sys/netinet/sctp_output.h ============================================================================== --- stable/9/sys/netinet/sctp_output.h Sun Jul 7 16:01:00 2013 (r252960) +++ stable/9/sys/netinet/sctp_output.h Sun Jul 7 16:03:58 2013 (r252961) @@ -55,13 +55,9 @@ int sctp_is_addr_restricted(struct sctp_ int sctp_is_address_in_scope(struct sctp_ifa *ifa, - int ipv4_addr_legal, - int ipv6_addr_legal, - int loopback_scope, - int ipv4_local_scope, - int local_scope, - int site_scope, + struct sctp_scoping *scope, int do_update); + int sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa); Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 16:01:00 2013 (r252960) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 16:03:58 2013 (r252961) @@ -94,11 +94,10 @@ sctp_fill_pcbinfo(struct sctp_pcbinfo *s spcb->readq_count = SCTP_BASE_INFO(ipi_count_readq); spcb->stream_oque = SCTP_BASE_INFO(ipi_count_strmoq); spcb->free_chunks = SCTP_BASE_INFO(ipi_free_chunks); - SCTP_INP_INFO_RUNLOCK(); } -/* +/*- * Addresses are added to VRF's (Virtual Router's). For BSD we * have only the default VRF 0. We maintain a hash list of * VRF's. Each VRF has its own list of sctp_ifn's. Each of @@ -214,7 +213,6 @@ sctp_find_ifn(void *ifn, uint32_t ifn_in } - struct sctp_vrf * sctp_find_vrf(uint32_t vrf_id) { @@ -230,6 +228,7 @@ sctp_find_vrf(uint32_t vrf_id) return (NULL); } + void sctp_free_vrf(struct sctp_vrf *vrf) { @@ -245,6 +244,7 @@ sctp_free_vrf(struct sctp_vrf *vrf) } } + void sctp_free_ifn(struct sctp_ifn *sctp_ifnp) { @@ -258,6 +258,7 @@ sctp_free_ifn(struct sctp_ifn *sctp_ifnp } } + void sctp_update_ifn_mtu(uint32_t ifn_index, uint32_t mtu) { @@ -283,6 +284,7 @@ sctp_free_ifa(struct sctp_ifa *sctp_ifap } } + static void sctp_delete_ifn(struct sctp_ifn *sctp_ifnp, int hold_addr_lock) { @@ -305,12 +307,13 @@ sctp_delete_ifn(struct sctp_ifn *sctp_if sctp_free_ifn(sctp_ifnp); } + void sctp_mark_ifa_addr_down(uint32_t vrf_id, struct sockaddr *addr, const char *if_name, uint32_t ifn_index) { struct sctp_vrf *vrf; - struct sctp_ifa *sctp_ifap = NULL; + struct sctp_ifa *sctp_ifap; SCTP_IPI_ADDR_RLOCK(); vrf = sctp_find_vrf(vrf_id); @@ -348,12 +351,13 @@ out: SCTP_IPI_ADDR_RUNLOCK(); } + void sctp_mark_ifa_addr_up(uint32_t vrf_id, struct sockaddr *addr, const char *if_name, uint32_t ifn_index) { struct sctp_vrf *vrf; - struct sctp_ifa *sctp_ifap = NULL; + struct sctp_ifa *sctp_ifap; SCTP_IPI_ADDR_RLOCK(); vrf = sctp_find_vrf(vrf_id); @@ -391,6 +395,7 @@ out: SCTP_IPI_ADDR_RUNLOCK(); } + /*- * Add an ifa to an ifn. * Register the interface as necessary. @@ -428,6 +433,7 @@ sctp_add_ifa_to_ifn(struct sctp_ifn *sct } } + /*- * Remove an ifa from its ifn. * If no more addresses exist, remove the ifn too. Otherwise, re-register @@ -479,6 +485,7 @@ sctp_remove_ifa_from_ifn(struct sctp_ifa } } + struct sctp_ifa * sctp_add_addr_to_vrf(uint32_t vrf_id, void *ifn, uint32_t ifn_index, uint32_t ifn_type, const char *if_name, void *ifa, @@ -1027,6 +1034,7 @@ sctp_tcb_special_locate(struct sctp_inpc return (NULL); } + static int sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to) { @@ -1036,19 +1044,12 @@ sctp_does_stcb_own_this_addr(struct sctp struct sctp_ifn *sctp_ifn; struct sctp_ifa *sctp_ifa; - loopback_scope = stcb->asoc.loopback_scope; - ipv4_local_scope = stcb->asoc.ipv4_local_scope; - local_scope = stcb->asoc.local_scope; - site_scope = stcb->asoc.site_scope; - ipv4_addr_legal = ipv6_addr_legal = 0; - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - ipv6_addr_legal = 1; - if (SCTP_IPV6_V6ONLY(stcb->sctp_ep) == 0) { - ipv4_addr_legal = 1; - } - } else { - ipv4_addr_legal = 1; - } + loopback_scope = stcb->asoc.scope.loopback_scope; + ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + local_scope = stcb->asoc.scope.local_scope; + site_scope = stcb->asoc.scope.site_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; + ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; SCTP_IPI_ADDR_RLOCK(); vrf = sctp_find_vrf(stcb->asoc.vrf_id); @@ -1183,6 +1184,7 @@ sctp_does_stcb_own_this_addr(struct sctp return (0); } + /* * rules for use * @@ -1471,11 +1473,11 @@ null_return: return (NULL); } + /* * Find an association for a specific endpoint using the association id given * out in the COMM_UP notification */ - struct sctp_tcb * sctp_findasoc_ep_asocid_locked(struct sctp_inpcb *inp, sctp_assoc_t asoc_id, int want_lock) { @@ -1536,6 +1538,9 @@ sctp_findassociation_ep_asocid(struct sc } +/* + * Endpoint probe expects that the INP_INFO is locked. + */ static struct sctp_inpcb * sctp_endpoint_probe(struct sockaddr *nam, struct sctppcbhead *head, uint16_t lport, uint32_t vrf_id) @@ -1552,12 +1557,8 @@ sctp_endpoint_probe(struct sockaddr *nam struct sockaddr_in6 *intf_addr6; #endif - int fnd; - /* - * Endpoint probe expects that the INP_INFO is locked. - */ #ifdef INET sin = NULL; #endif @@ -1893,6 +1894,7 @@ sctp_pcb_findep(struct sockaddr *nam, in return (inp); } + /* * Find an association for an endpoint with the pointer to whom you want to * send to and the endpoint pointer. The address can be IPv4 or IPv6. We may @@ -2144,6 +2146,7 @@ sctp_findassoc_by_vtag(struct sockaddr * return (NULL); } + /* * Find an association with the pointer to the inbound IP packet. This can be * a IPv4 or IPv6 packet. @@ -3743,13 +3746,13 @@ sctp_add_remote_addr(struct sctp_tcb *st stcb->ipv4_local_scope = 1; #else if (IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { - stcb->asoc.ipv4_local_scope = 1; + stcb->asoc.scope.ipv4_local_scope = 1; } #endif /* SCTP_DONT_DO_PRIVADDR_SCOPE */ } else { /* Validate the address is in scope */ if ((IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) && - (stcb->asoc.ipv4_local_scope == 0)) { + (stcb->asoc.scope.ipv4_local_scope == 0)) { addr_inscope = 0; } } @@ -3770,10 +3773,10 @@ sctp_add_remote_addr(struct sctp_tcb *st sin6->sin6_len = sizeof(struct sockaddr_in6); if (set_scope) { if (sctp_is_address_on_local_host(newaddr, stcb->asoc.vrf_id)) { - stcb->asoc.loopback_scope = 1; - stcb->asoc.local_scope = 0; - stcb->asoc.ipv4_local_scope = 1; - stcb->asoc.site_scope = 1; + stcb->asoc.scope.loopback_scope = 1; + stcb->asoc.scope.local_scope = 0; + stcb->asoc.scope.ipv4_local_scope = 1; + stcb->asoc.scope.site_scope = 1; } else if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { /* * If the new destination is a @@ -3785,26 +3788,26 @@ sctp_add_remote_addr(struct sctp_tcb *st * also be on our private network * for v4 too. */ - stcb->asoc.ipv4_local_scope = 1; - stcb->asoc.site_scope = 1; + stcb->asoc.scope.ipv4_local_scope = 1; + stcb->asoc.scope.site_scope = 1; } else if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) { /* * If the new destination is * SITE_LOCAL then we must have site * scope in common. */ - stcb->asoc.site_scope = 1; + stcb->asoc.scope.site_scope = 1; } } else { /* Validate the address is in scope */ if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr) && - (stcb->asoc.loopback_scope == 0)) { + (stcb->asoc.scope.loopback_scope == 0)) { addr_inscope = 0; } else if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) && - (stcb->asoc.local_scope == 0)) { + (stcb->asoc.scope.local_scope == 0)) { addr_inscope = 0; } else if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr) && - (stcb->asoc.site_scope == 0)) { + (stcb->asoc.scope.site_scope == 0)) { addr_inscope = 0; } } @@ -3839,10 +3842,10 @@ sctp_add_remote_addr(struct sctp_tcb *st } net->addr_is_local = sctp_is_address_on_local_host(newaddr, stcb->asoc.vrf_id); if (net->addr_is_local && ((set_scope || (from == SCTP_ADDR_IS_CONFIRMED)))) { - stcb->asoc.loopback_scope = 1; - stcb->asoc.ipv4_local_scope = 1; - stcb->asoc.local_scope = 0; - stcb->asoc.site_scope = 1; + stcb->asoc.scope.loopback_scope = 1; + stcb->asoc.scope.ipv4_local_scope = 1; + stcb->asoc.scope.local_scope = 0; + stcb->asoc.scope.site_scope = 1; addr_inscope = 1; } net->failure_threshold = stcb->asoc.def_net_failure; @@ -6071,7 +6074,7 @@ sctp_load_addresses_from_init(struct sct switch (sa->sa_family) { #ifdef INET case AF_INET: - if (stcb->asoc.ipv4_addr_legal) { + if (stcb->asoc.scope.ipv4_addr_legal) { if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_2)) { return (-1); } @@ -6080,7 +6083,7 @@ sctp_load_addresses_from_init(struct sct #endif #ifdef INET6 case AF_INET6: - if (stcb->asoc.ipv6_addr_legal) { + if (stcb->asoc.scope.ipv6_addr_legal) { if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_3)) { return (-2); } @@ -6127,7 +6130,7 @@ sctp_load_addresses_from_init(struct sct } #ifdef INET if (ptype == SCTP_IPV4_ADDRESS) { - if (stcb->asoc.ipv4_addr_legal) { + if (stcb->asoc.scope.ipv4_addr_legal) { struct sctp_ipv4addr_param *p4, p4_buf; /* ok get the v4 address and check/add */ @@ -6213,7 +6216,7 @@ sctp_load_addresses_from_init(struct sct #endif #ifdef INET6 if (ptype == SCTP_IPV6_ADDRESS) { - if (stcb->asoc.ipv6_addr_legal) { + if (stcb->asoc.scope.ipv6_addr_legal) { /* ok get the v6 address and check/add */ struct sctp_ipv6addr_param *p6, p6_buf; Modified: stable/9/sys/netinet/sctp_structs.h ============================================================================== --- stable/9/sys/netinet/sctp_structs.h Sun Jul 7 16:01:00 2013 (r252960) +++ stable/9/sys/netinet/sctp_structs.h Sun Jul 7 16:03:58 2013 (r252961) @@ -1177,17 +1177,7 @@ struct sctp_association { */ uint8_t peer_supports_pktdrop; - /* Do we allow V6/V4? */ - uint8_t ipv4_addr_legal; - uint8_t ipv6_addr_legal; - /* Address scoping flags */ - /* scope value for IPv4 */ - uint8_t ipv4_local_scope; - /* scope values for IPv6 */ - uint8_t local_scope; - uint8_t site_scope; - /* loopback scope */ - uint8_t loopback_scope; + struct sctp_scoping scope; /* flags to handle send alternate net tracking */ uint8_t used_alt_onsack; uint8_t used_alt_asconfack; Modified: stable/9/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.c Sun Jul 7 16:01:00 2013 (r252960) +++ stable/9/sys/netinet/sctp_sysctl.c Sun Jul 7 16:03:58 2013 (r252961) @@ -197,29 +197,29 @@ copy_out_local_addresses(struct sctp_inp /* Turn on all the appropriate scope */ if (stcb) { /* use association specific values */ - loopback_scope = stcb->asoc.loopback_scope; - ipv4_local_scope = stcb->asoc.ipv4_local_scope; - local_scope = stcb->asoc.local_scope; - site_scope = stcb->asoc.site_scope; + loopback_scope = stcb->asoc.scope.loopback_scope; + ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + local_scope = stcb->asoc.scope.local_scope; + site_scope = stcb->asoc.scope.site_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; + ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; } else { - /* use generic values for endpoints */ + /* Use generic values for endpoints. */ loopback_scope = 1; ipv4_local_scope = 1; local_scope = 1; site_scope = 1; - } - - /* use only address families of interest */ - if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - ipv6_addr_legal = 1; - if (SCTP_IPV6_V6ONLY(inp)) { - ipv4_addr_legal = 0; + if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { + ipv6_addr_legal = 1; + if (SCTP_IPV6_V6ONLY(inp)) { + ipv4_addr_legal = 0; + } else { + ipv4_addr_legal = 1; + } } else { + ipv6_addr_legal = 0; ipv4_addr_legal = 1; } - } else { - ipv4_addr_legal = 1; - ipv6_addr_legal = 0; } /* neither Mac OS X nor FreeBSD support mulitple routing functions */ Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Sun Jul 7 16:01:00 2013 (r252960) +++ stable/9/sys/netinet/sctp_usrreq.c Sun Jul 7 16:03:58 2013 (r252961) @@ -1143,23 +1143,29 @@ sctp_fill_up_addresses_vrf(struct sctp_i if (stcb) { /* Turn on all the appropriate scope */ - loopback_scope = stcb->asoc.loopback_scope; - ipv4_local_scope = stcb->asoc.ipv4_local_scope; - local_scope = stcb->asoc.local_scope; - site_scope = stcb->asoc.site_scope; + loopback_scope = stcb->asoc.scope.loopback_scope; + ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + local_scope = stcb->asoc.scope.local_scope; + site_scope = stcb->asoc.scope.site_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; + ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; } else { - /* Turn on ALL scope, since we look at the EP */ - loopback_scope = ipv4_local_scope = local_scope = - site_scope = 1; - } - ipv4_addr_legal = ipv6_addr_legal = 0; - if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { - ipv6_addr_legal = 1; - if (SCTP_IPV6_V6ONLY(inp) == 0) { + /* Use generic values for endpoints. */ + loopback_scope = 1; + ipv4_local_scope = 1; + local_scope = 1; + site_scope = 1; + if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { + ipv6_addr_legal = 1; + if (SCTP_IPV6_V6ONLY(inp)) { + ipv4_addr_legal = 0; + } else { + ipv4_addr_legal = 1; + } + } else { + ipv6_addr_legal = 0; ipv4_addr_legal = 1; } - } else { - ipv4_addr_legal = 1; } vrf = sctp_find_vrf(vrf_id); if (vrf == NULL) { @@ -1298,8 +1304,21 @@ sctp_fill_up_addresses_vrf(struct sctp_i } if (sctp_fill_user_address(sas, &laddr->ifa->address.sa)) continue; - - ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; + switch (laddr->ifa->address.sa.sa_family) { +#ifdef INET + case AF_INET: + ((struct sockaddr_in *)sas)->sin_port = inp->sctp_lport; + break; +#endif +#ifdef INET6 + case AF_INET6: + ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; + break; +#endif + default: + /* TSNH */ + break; + } sas = (struct sockaddr_storage *)((caddr_t)sas + laddr->ifa->address.sa.sa_len); actual += laddr->ifa->address.sa.sa_len; @@ -5948,7 +5967,7 @@ sctp_connect(struct socket *so, struct s error = EINVAL; goto out_now; } -#endif /* INET6 */ +#endif if ((inp->sctp_flags & SCTP_PCB_FLAGS_UNBOUND) == SCTP_PCB_FLAGS_UNBOUND) { /* Bind a ephemeral port */ @@ -6242,8 +6261,8 @@ sctp_accept(struct socket *so, struct so return (ENOMEM); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); - sin->sin_port = ((struct sockaddr_in *)&store)->sin_port; - sin->sin_addr = ((struct sockaddr_in *)&store)->sin_addr; + sin->sin_port = store.sin.sin_port; + sin->sin_addr = store.sin.sin_addr; *addr = (struct sockaddr *)sin; break; } @@ -6258,9 +6277,8 @@ sctp_accept(struct socket *so, struct so return (ENOMEM); sin6->sin6_family = AF_INET6; sin6->sin6_len = sizeof(*sin6); - sin6->sin6_port = ((struct sockaddr_in6 *)&store)->sin6_port; - - sin6->sin6_addr = ((struct sockaddr_in6 *)&store)->sin6_addr; + sin6->sin6_port = store.sin6.sin6_port; + sin6->sin6_addr = store.sin6.sin6_addr; if ((error = sa6_recoverscope(sin6)) != 0) { SCTP_FREE_SONAME(sin6); return (error); Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Jul 7 16:01:00 2013 (r252960) +++ stable/9/sys/netinet/sctputil.c Sun Jul 7 16:03:58 2013 (r252961) @@ -878,7 +878,7 @@ sctp_select_a_tag(struct sctp_inpcb *inp } int -sctp_init_asoc(struct sctp_inpcb *m, struct sctp_tcb *stcb, +sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint32_t override_tag, uint32_t vrf_id) { struct sctp_association *asoc; @@ -899,23 +899,23 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc = &stcb->asoc; /* init all variables to a known value. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:05:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6F28BB39; Sun, 7 Jul 2013 16:05:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4713119DF; Sun, 7 Jul 2013 16:05:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67G5a6C046617; Sun, 7 Jul 2013 16:05:36 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67G5acL046616; Sun, 7 Jul 2013 16:05:36 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071605.r67G5acL046616@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 16:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252962 - stable/9/lib/libc/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:05:36 -0000 Author: tuexen Date: Sun Jul 7 16:05:35 2013 New Revision: 252962 URL: http://svnweb.freebsd.org/changeset/base/252962 Log: MFC r246629: Improve code style. No functional change. Modified: stable/9/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/9/lib/libc/net/sctp_sys_calls.c Sun Jul 7 16:03:58 2013 (r252961) +++ stable/9/lib/libc/net/sctp_sys_calls.c Sun Jul 7 16:05:35 2013 (r252962) @@ -583,36 +583,36 @@ sctp_sendmsg(int s, if ((tolen > 0) && ((to == NULL) || (tolen < sizeof(struct sockaddr)))) { errno = EINVAL; - return -1; + return (-1); } if (to && (tolen > 0)) { if (to->sa_family == AF_INET) { if (tolen != sizeof(struct sockaddr_in)) { errno = EINVAL; - return -1; + return (-1); } if ((to->sa_len > 0) && (to->sa_len != sizeof(struct sockaddr_in))) { errno = EINVAL; - return -1; + return (-1); } memcpy(&addr, to, sizeof(struct sockaddr_in)); addr.in.sin_len = sizeof(struct sockaddr_in); } else if (to->sa_family == AF_INET6) { if (tolen != sizeof(struct sockaddr_in6)) { errno = EINVAL; - return -1; + return (-1); } if ((to->sa_len > 0) && (to->sa_len != sizeof(struct sockaddr_in6))) { errno = EINVAL; - return -1; + return (-1); } memcpy(&addr, to, sizeof(struct sockaddr_in6)); addr.in6.sin6_len = sizeof(struct sockaddr_in6); } else { errno = EAFNOSUPPORT; - return -1; + return (-1); } who = (struct sockaddr *)&addr; } @@ -836,7 +836,7 @@ sctp_sendmsgx(int sd, sinfo.sinfo_ssn = stream_no; sinfo.sinfo_timetolive = timetolive; sinfo.sinfo_context = context; - return sctp_sendx(sd, msg, len, addrs, addrcnt, &sinfo, 0); + return (sctp_sendx(sd, msg, len, addrs, addrcnt, &sinfo, 0)); } ssize_t From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:08:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 030F0D5F; Sun, 7 Jul 2013 16:08:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E632419F7; Sun, 7 Jul 2013 16:08:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67G8Yg2047189; Sun, 7 Jul 2013 16:08:34 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67G8YkF047188; Sun, 7 Jul 2013 16:08:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071608.r67G8YkF047188@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 16:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252963 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:08:35 -0000 Author: tuexen Date: Sun Jul 7 16:08:34 2013 New Revision: 252963 URL: http://svnweb.freebsd.org/changeset/base/252963 Log: MFC r246635: Make sure that received packets for removed addresses are handled consistently. While there, make variable names consistent. Modified: stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 16:05:35 2013 (r252962) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 16:08:34 2013 (r252963) @@ -824,6 +824,160 @@ out_now: } +static int +sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to) +{ + int loopback_scope, ipv4_local_scope, local_scope, site_scope; + int ipv4_addr_legal, ipv6_addr_legal; + struct sctp_vrf *vrf; + struct sctp_ifn *sctp_ifn; + struct sctp_ifa *sctp_ifa; + + loopback_scope = stcb->asoc.scope.loopback_scope; + ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; + local_scope = stcb->asoc.scope.local_scope; + site_scope = stcb->asoc.scope.site_scope; + ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; + ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; + + SCTP_IPI_ADDR_RLOCK(); + vrf = sctp_find_vrf(stcb->asoc.vrf_id); + if (vrf == NULL) { + /* no vrf, no addresses */ + SCTP_IPI_ADDR_RUNLOCK(); + return (0); + } + if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) { + LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { + if ((loopback_scope == 0) && + SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { + continue; + } + LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { + if (sctp_is_addr_restricted(stcb, sctp_ifa) && + (!sctp_is_addr_pending(stcb, sctp_ifa))) { + /* + * We allow pending addresses, where + * we have sent an asconf-add to be + * considered valid. + */ + continue; + } + switch (sctp_ifa->address.sa.sa_family) { +#ifdef INET + case AF_INET: + if (ipv4_addr_legal) { + struct sockaddr_in *sin, + *rsin; + + sin = &sctp_ifa->address.sin; + rsin = (struct sockaddr_in *)to; + if ((ipv4_local_scope == 0) && + IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { + continue; + } + if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) { + SCTP_IPI_ADDR_RUNLOCK(); + return (1); + } + } + break; +#endif +#ifdef INET6 + case AF_INET6: + if (ipv6_addr_legal) { + struct sockaddr_in6 *sin6, + *rsin6; + + sin6 = &sctp_ifa->address.sin6; + rsin6 = (struct sockaddr_in6 *)to; + if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { + if (local_scope == 0) + continue; + if (sin6->sin6_scope_id == 0) { + if (sa6_recoverscope(sin6) != 0) + continue; + } + } + if ((site_scope == 0) && + (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { + continue; + } + if (SCTP6_ARE_ADDR_EQUAL(sin6, rsin6)) { + SCTP_IPI_ADDR_RUNLOCK(); + return (1); + } + } + break; +#endif + default: + /* TSNH */ + break; + } + } + } + } else { + struct sctp_laddr *laddr; + + LIST_FOREACH(laddr, &stcb->sctp_ep->sctp_addr_list, sctp_nxt_addr) { + if (laddr->ifa->localifa_flags & SCTP_BEING_DELETED) { + SCTPDBG(SCTP_DEBUG_PCB1, "ifa being deleted\n"); + continue; + } + if (sctp_is_addr_restricted(stcb, laddr->ifa) && + (!sctp_is_addr_pending(stcb, laddr->ifa))) { + /* + * We allow pending addresses, where we have + * sent an asconf-add to be considered + * valid. + */ + continue; + } + if (laddr->ifa->address.sa.sa_family != to->sa_family) { + continue; + } + switch (to->sa_family) { +#ifdef INET + case AF_INET: + { + struct sockaddr_in *sin, *rsin; + + sin = (struct sockaddr_in *)&laddr->ifa->address.sin; + rsin = (struct sockaddr_in *)to; + if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) { + SCTP_IPI_ADDR_RUNLOCK(); + return (1); + } + break; + } +#endif +#ifdef INET6 + case AF_INET6: + { + struct sockaddr_in6 *sin6, *rsin6; + + sin6 = (struct sockaddr_in6 *)&laddr->ifa->address.sin6; + rsin6 = (struct sockaddr_in6 *)to; + if (SCTP6_ARE_ADDR_EQUAL(sin6, rsin6)) { + SCTP_IPI_ADDR_RUNLOCK(); + return (1); + } + break; + } + +#endif + default: + /* TSNH */ + break; + } + + } + } + SCTP_IPI_ADDR_RUNLOCK(); + return (0); +} + + static struct sctp_tcb * sctp_tcb_special_locate(struct sctp_inpcb **inp_p, struct sockaddr *from, struct sockaddr *to, struct sctp_nets **netp, uint32_t vrf_id) @@ -906,7 +1060,6 @@ sctp_tcb_special_locate(struct sctp_inpc if (laddr->ifa->address.sa.sa_family == to->sa_family) { /* see if it matches */ - #ifdef INET if (from->sa_family == AF_INET) { struct sockaddr_in *intf_addr, @@ -949,13 +1102,18 @@ sctp_tcb_special_locate(struct sctp_inpc * Ok if we hit here the ep has the address, does it hold * the tcb? */ - + /* XXX: Why don't we TAILQ_FOREACH through sctp_asoc_list? */ stcb = LIST_FIRST(&inp->sctp_asoc_list); if (stcb == NULL) { SCTP_INP_RUNLOCK(inp); continue; } SCTP_TCB_LOCK(stcb); + if (!sctp_does_stcb_own_this_addr(stcb, to)) { + SCTP_TCB_UNLOCK(stcb); + SCTP_INP_RUNLOCK(inp); + continue; + } if (stcb->rport != rport) { /* remote port does not match. */ SCTP_TCB_UNLOCK(stcb); @@ -967,6 +1125,11 @@ sctp_tcb_special_locate(struct sctp_inpc SCTP_INP_RUNLOCK(inp); continue; } + if (!sctp_does_stcb_own_this_addr(stcb, to)) { + SCTP_TCB_UNLOCK(stcb); + SCTP_INP_RUNLOCK(inp); + continue; + } /* Does this TCB have a matching address? */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { @@ -1035,156 +1198,6 @@ sctp_tcb_special_locate(struct sctp_inpc } -static int -sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to) -{ - int loopback_scope, ipv4_local_scope, local_scope, site_scope; - int ipv4_addr_legal, ipv6_addr_legal; - struct sctp_vrf *vrf; - struct sctp_ifn *sctp_ifn; - struct sctp_ifa *sctp_ifa; - - loopback_scope = stcb->asoc.scope.loopback_scope; - ipv4_local_scope = stcb->asoc.scope.ipv4_local_scope; - local_scope = stcb->asoc.scope.local_scope; - site_scope = stcb->asoc.scope.site_scope; - ipv4_addr_legal = stcb->asoc.scope.ipv4_addr_legal; - ipv6_addr_legal = stcb->asoc.scope.ipv6_addr_legal; - - SCTP_IPI_ADDR_RLOCK(); - vrf = sctp_find_vrf(stcb->asoc.vrf_id); - if (vrf == NULL) { - /* no vrf, no addresses */ - SCTP_IPI_ADDR_RUNLOCK(); - return (0); - } - if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) { - LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { - if ((loopback_scope == 0) && - SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { - continue; - } - LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { - if (sctp_is_addr_restricted(stcb, sctp_ifa) && - (!sctp_is_addr_pending(stcb, sctp_ifa))) { - /* - * We allow pending addresses, where - * we have sent an asconf-add to be - * considered valid. - */ - continue; - } - switch (sctp_ifa->address.sa.sa_family) { -#ifdef INET - case AF_INET: - if (ipv4_addr_legal) { - struct sockaddr_in *sin, - *rsin; - - sin = &sctp_ifa->address.sin; - rsin = (struct sockaddr_in *)to; - if ((ipv4_local_scope == 0) && - IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { - continue; - } - if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) { - SCTP_IPI_ADDR_RUNLOCK(); - return (1); - } - } - break; -#endif -#ifdef INET6 - case AF_INET6: - if (ipv6_addr_legal) { - struct sockaddr_in6 *sin6, - *rsin6; - - sin6 = &sctp_ifa->address.sin6; - rsin6 = (struct sockaddr_in6 *)to; - if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { - if (local_scope == 0) - continue; - if (sin6->sin6_scope_id == 0) { - if (sa6_recoverscope(sin6) != 0) - continue; - } - } - if ((site_scope == 0) && - (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { - continue; - } - if (SCTP6_ARE_ADDR_EQUAL(sin6, rsin6)) { - SCTP_IPI_ADDR_RUNLOCK(); - return (1); - } - } - break; -#endif - default: - /* TSNH */ - break; - } - } - } - } else { - struct sctp_laddr *laddr; - - LIST_FOREACH(laddr, &stcb->sctp_ep->sctp_addr_list, sctp_nxt_addr) { - if (sctp_is_addr_restricted(stcb, laddr->ifa) && - (!sctp_is_addr_pending(stcb, laddr->ifa))) { - /* - * We allow pending addresses, where we have - * sent an asconf-add to be considered - * valid. - */ - continue; - } - if (laddr->ifa->address.sa.sa_family != to->sa_family) { - continue; - } - switch (to->sa_family) { -#ifdef INET - case AF_INET: - { - struct sockaddr_in *sin, *rsin; - - sin = (struct sockaddr_in *)&laddr->ifa->address.sin; - rsin = (struct sockaddr_in *)to; - if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) { - SCTP_IPI_ADDR_RUNLOCK(); - return (1); - } - break; - } -#endif -#ifdef INET6 - case AF_INET6: - { - struct sockaddr_in6 *sin6, *rsin6; - - sin6 = (struct sockaddr_in6 *)&laddr->ifa->address.sin6; - rsin6 = (struct sockaddr_in6 *)to; - if (SCTP6_ARE_ADDR_EQUAL(sin6, rsin6)) { - SCTP_IPI_ADDR_RUNLOCK(); - return (1); - } - break; - } - -#endif - default: - /* TSNH */ - break; - } - - } - } - SCTP_IPI_ADDR_RUNLOCK(); - return (0); -} - - /* * rules for use * @@ -1906,20 +1919,20 @@ sctp_findassociation_addr_sa(struct sock uint32_t vrf_id) { struct sctp_inpcb *inp = NULL; - struct sctp_tcb *retval; + struct sctp_tcb *stcb; SCTP_INP_INFO_RLOCK(); if (find_tcp_pool) { if (inp_p != NULL) { - retval = sctp_tcb_special_locate(inp_p, from, to, netp, + stcb = sctp_tcb_special_locate(inp_p, from, to, netp, vrf_id); } else { - retval = sctp_tcb_special_locate(&inp, from, to, netp, + stcb = sctp_tcb_special_locate(&inp, from, to, netp, vrf_id); } - if (retval != NULL) { + if (stcb != NULL) { SCTP_INP_INFO_RUNLOCK(); - return (retval); + return (stcb); } } inp = sctp_pcb_findep(to, 0, 1, vrf_id); @@ -1927,7 +1940,6 @@ sctp_findassociation_addr_sa(struct sock *inp_p = inp; } SCTP_INP_INFO_RUNLOCK(); - if (inp == NULL) { return (NULL); } @@ -1938,13 +1950,13 @@ sctp_findassociation_addr_sa(struct sock * inbound packet side. */ if (inp_p != NULL) { - retval = sctp_findassociation_ep_addr(inp_p, from, netp, to, + stcb = sctp_findassociation_ep_addr(inp_p, from, netp, to, NULL); } else { - retval = sctp_findassociation_ep_addr(&inp, from, netp, to, + stcb = sctp_findassociation_ep_addr(&inp, from, netp, to, NULL); } - return retval; + return (stcb); } @@ -1959,7 +1971,7 @@ sctp_findassociation_special_addr(struct struct sockaddr *dst) { struct sctp_paramhdr *phdr, parm_buf; - struct sctp_tcb *retval; + struct sctp_tcb *stcb; uint32_t ptype, plen; #ifdef INET @@ -1984,7 +1996,7 @@ sctp_findassociation_special_addr(struct sin6.sin6_port = sh->src_port; #endif - retval = NULL; + stcb = NULL; offset += sizeof(struct sctp_init_chunk); phdr = sctp_get_next_param(m, offset, &parm_buf, sizeof(parm_buf)); @@ -2009,10 +2021,10 @@ sctp_findassociation_special_addr(struct p4 = (struct sctp_ipv4addr_param *)phdr; memcpy(&sin4.sin_addr, &p4->addr, sizeof(p4->addr)); /* look it up */ - retval = sctp_findassociation_ep_addr(inp_p, + stcb = sctp_findassociation_ep_addr(inp_p, (struct sockaddr *)&sin4, netp, dst, NULL); - if (retval != NULL) { - return (retval); + if (stcb != NULL) { + return (stcb); } } #endif @@ -2030,10 +2042,10 @@ sctp_findassociation_special_addr(struct p6 = (struct sctp_ipv6addr_param *)phdr; memcpy(&sin6.sin6_addr, &p6->addr, sizeof(p6->addr)); /* look it up */ - retval = sctp_findassociation_ep_addr(inp_p, + stcb = sctp_findassociation_ep_addr(inp_p, (struct sockaddr *)&sin6, netp, dst, NULL); - if (retval != NULL) { - return (retval); + if (stcb != NULL) { + return (stcb); } } #endif @@ -2158,15 +2170,15 @@ sctp_findassociation_addr(struct mbuf *m struct sctp_inpcb **inp_p, struct sctp_nets **netp, uint32_t vrf_id) { int find_tcp_pool; - struct sctp_tcb *retval; + struct sctp_tcb *stcb; struct sctp_inpcb *inp; if (sh->v_tag) { /* we only go down this path if vtag is non-zero */ - retval = sctp_findassoc_by_vtag(src, dst, ntohl(sh->v_tag), + stcb = sctp_findassoc_by_vtag(src, dst, ntohl(sh->v_tag), inp_p, netp, sh->src_port, sh->dest_port, 0, vrf_id, 0); - if (retval) { - return (retval); + if (stcb) { + return (stcb); } } find_tcp_pool = 0; @@ -2178,15 +2190,15 @@ sctp_findassociation_addr(struct mbuf *m find_tcp_pool = 1; } if (inp_p) { - retval = sctp_findassociation_addr_sa(src, dst, inp_p, netp, + stcb = sctp_findassociation_addr_sa(src, dst, inp_p, netp, find_tcp_pool, vrf_id); inp = *inp_p; } else { - retval = sctp_findassociation_addr_sa(src, dst, &inp, netp, + stcb = sctp_findassociation_addr_sa(src, dst, &inp, netp, find_tcp_pool, vrf_id); } - SCTPDBG(SCTP_DEBUG_PCB1, "retval:%p inp:%p\n", (void *)retval, (void *)inp); - if (retval == NULL && inp) { + SCTPDBG(SCTP_DEBUG_PCB1, "stcb:%p inp:%p\n", (void *)stcb, (void *)inp); + if (stcb == NULL && inp) { /* Found a EP but not this address */ if ((ch->chunk_type == SCTP_INITIATION) || (ch->chunk_type == SCTP_INITIATION_ACK)) { @@ -2204,15 +2216,15 @@ sctp_findassociation_addr(struct mbuf *m } return (NULL); } - retval = sctp_findassociation_special_addr(m, + stcb = sctp_findassociation_special_addr(m, offset, sh, &inp, netp, dst); if (inp_p != NULL) { *inp_p = inp; } } } - SCTPDBG(SCTP_DEBUG_PCB1, "retval is %p\n", (void *)retval); - return (retval); + SCTPDBG(SCTP_DEBUG_PCB1, "stcb is %p\n", (void *)stcb); + return (stcb); } /* From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:11:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 89701F25; Sun, 7 Jul 2013 16:11:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7B7511A19; Sun, 7 Jul 2013 16:11:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67GBEBN049391; Sun, 7 Jul 2013 16:11:14 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67GBDOY049386; Sun, 7 Jul 2013 16:11:13 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071611.r67GBDOY049386@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 16:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252964 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:11:14 -0000 Author: tuexen Date: Sun Jul 7 16:11:13 2013 New Revision: 252964 URL: http://svnweb.freebsd.org/changeset/base/252964 Log: MFC r246674: Don't send kernel provided information in the User Initiated ABORT cause, since the user can also provide this kind of information. So the receiver doesn't know who provided the information. While there: Fix a bug where the stack would send a malformed ABORT chunk when using a send() call with SCTP_ABORT|SCT_SENDALL flags. Modified: stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sun Jul 7 16:08:34 2013 (r252963) +++ stable/9/sys/netinet/sctp_indata.c Sun Jul 7 16:11:13 2013 (r252964) @@ -4221,19 +4221,15 @@ again: abort_out_now: *abort_now = 1; /* XXX */ - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), + oper = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; - uint32_t *ippp; - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + - sizeof(uint32_t); + SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr); ph = mtod(oper, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_24); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_24; sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); @@ -4953,19 +4949,15 @@ sctp_handle_sack(struct mbuf *m, int off abort_out_now: *abort_now = 1; /* XXX */ - oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), + oper = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; - uint32_t *ippp; - SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + - sizeof(uint32_t); + SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr); ph = mtod(oper, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(oper)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_INDATA + SCTP_LOC_31); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_31; sctp_abort_an_association(stcb->sctp_ep, stcb, oper, SCTP_SO_NOT_LOCKED); Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 16:08:34 2013 (r252963) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 16:11:13 2013 (r252964) @@ -6442,7 +6442,7 @@ sctp_sendall_iterator(struct sctp_inpcb if (m) { ph = mtod(m, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); - ph->param_length = htons(ca->sndlen); + ph->param_length = htons(sizeof(struct sctp_paramhdr) + ca->sndlen); } /* * We add one here to keep the assoc from @@ -12498,7 +12498,7 @@ sctp_lower_sosend(struct socket *so, /* now move forward the data pointer */ ph = mtod(mm, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); - ph->param_length = htons((sizeof(struct sctp_paramhdr) + tot_out)); + ph->param_length = htons(sizeof(struct sctp_paramhdr) + tot_out); ph++; SCTP_BUF_LEN(mm) = tot_out + sizeof(struct sctp_paramhdr); if (top == NULL) { Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 16:08:34 2013 (r252963) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 16:11:13 2013 (r252964) @@ -3308,22 +3308,16 @@ sctp_inpcb_free(struct sctp_inpcb *inp, /* Left with Data unread */ struct mbuf *op_err; - op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), + op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); if (op_err) { /* Fill in the user initiated abort */ struct sctp_paramhdr *ph; - uint32_t *ippp; - SCTP_BUF_LEN(op_err) = - sizeof(struct sctp_paramhdr) + sizeof(uint32_t); - ph = mtod(op_err, - struct sctp_paramhdr *); - ph->param_type = htons( - SCTP_CAUSE_USER_INITIATED_ABT); + SCTP_BUF_LEN(op_err) = sizeof(struct sctp_paramhdr); + ph = mtod(op_err, struct sctp_paramhdr *); + ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(op_err)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_PCB + SCTP_LOC_3); } asoc->sctp_ep->last_abort_code = SCTP_FROM_SCTP_PCB + SCTP_LOC_3; sctp_send_abort_tcb(asoc, op_err, SCTP_SO_LOCKED); @@ -3395,7 +3389,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, struct mbuf *op_err; abort_anyway: - op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), + op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); if (op_err) { /* @@ -3403,18 +3397,11 @@ sctp_inpcb_free(struct sctp_inpcb *inp, * initiated abort */ struct sctp_paramhdr *ph; - uint32_t *ippp; - SCTP_BUF_LEN(op_err) = - (sizeof(struct sctp_paramhdr) + - sizeof(uint32_t)); - ph = mtod(op_err, - struct sctp_paramhdr *); - ph->param_type = htons( - SCTP_CAUSE_USER_INITIATED_ABT); + SCTP_BUF_LEN(op_err) = sizeof(struct sctp_paramhdr); + ph = mtod(op_err, struct sctp_paramhdr *); + ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(op_err)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_PCB + SCTP_LOC_5); } asoc->sctp_ep->last_abort_code = SCTP_FROM_SCTP_PCB + SCTP_LOC_5; sctp_send_abort_tcb(asoc, op_err, SCTP_SO_LOCKED); @@ -3478,23 +3465,17 @@ sctp_inpcb_free(struct sctp_inpcb *inp, if ((SCTP_GET_STATE(&asoc->asoc) != SCTP_STATE_COOKIE_WAIT) && ((asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) == 0)) { struct mbuf *op_err; - uint32_t *ippp; - op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), + op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); if (op_err) { /* Fill in the user initiated abort */ struct sctp_paramhdr *ph; - SCTP_BUF_LEN(op_err) = (sizeof(struct sctp_paramhdr) + - sizeof(uint32_t)); + SCTP_BUF_LEN(op_err) = sizeof(struct sctp_paramhdr); ph = mtod(op_err, struct sctp_paramhdr *); - ph->param_type = htons( - SCTP_CAUSE_USER_INITIATED_ABT); + ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(op_err)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_PCB + SCTP_LOC_7); - } asoc->sctp_ep->last_abort_code = SCTP_FROM_SCTP_PCB + SCTP_LOC_7; sctp_send_abort_tcb(asoc, op_err, SCTP_SO_LOCKED); Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Sun Jul 7 16:08:34 2013 (r252963) +++ stable/9/sys/netinet/sctp_usrreq.c Sun Jul 7 16:11:13 2013 (r252964) @@ -854,7 +854,7 @@ sctp_disconnect(struct socket *so) struct mbuf *op_err; abort_anyway: - op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), + op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); if (op_err) { /* @@ -862,17 +862,11 @@ sctp_disconnect(struct socket *so) * initiated abort */ struct sctp_paramhdr *ph; - uint32_t *ippp; - SCTP_BUF_LEN(op_err) = - (sizeof(struct sctp_paramhdr) + sizeof(uint32_t)); - ph = mtod(op_err, - struct sctp_paramhdr *); - ph->param_type = htons( - SCTP_CAUSE_USER_INITIATED_ABT); + SCTP_BUF_LEN(op_err) = sizeof(struct sctp_paramhdr); + ph = mtod(op_err, struct sctp_paramhdr *); + ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(op_err)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_USRREQ + SCTP_LOC_4); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_USRREQ + SCTP_LOC_4; sctp_send_abort_tcb(stcb, op_err, SCTP_SO_LOCKED); @@ -1069,22 +1063,16 @@ sctp_shutdown(struct socket *so) struct mbuf *op_err; abort_anyway: - op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), + op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); if (op_err) { /* Fill in the user initiated abort */ struct sctp_paramhdr *ph; - uint32_t *ippp; - SCTP_BUF_LEN(op_err) = - sizeof(struct sctp_paramhdr) + sizeof(uint32_t); - ph = mtod(op_err, - struct sctp_paramhdr *); - ph->param_type = htons( - SCTP_CAUSE_USER_INITIATED_ABT); + SCTP_BUF_LEN(op_err) = sizeof(struct sctp_paramhdr); + ph = mtod(op_err, struct sctp_paramhdr *); + ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); ph->param_length = htons(SCTP_BUF_LEN(op_err)); - ippp = (uint32_t *) (ph + 1); - *ippp = htonl(SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6); } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_USRREQ + SCTP_LOC_6; sctp_abort_an_association(stcb->sctp_ep, stcb, From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:12:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D4830E9; Sun, 7 Jul 2013 16:12:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ACCB01A24; Sun, 7 Jul 2013 16:12:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67GCMsk049626; Sun, 7 Jul 2013 16:12:22 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67GCMhK049625; Sun, 7 Jul 2013 16:12:22 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201307071612.r67GCMhK049625@svn.freebsd.org> From: Warner Losh Date: Sun, 7 Jul 2013 16:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252965 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:12:22 -0000 Author: imp Date: Sun Jul 7 16:12:22 2013 New Revision: 252965 URL: http://svnweb.freebsd.org/changeset/base/252965 Log: Remove all the NOPs after SYNC. They aren't needed. They originated in the original Octeon port. They weren't present, as far as I can tell, on the projects/mips branch until after this point. They were in the original Octeon port in code picked up from the vendor, who I've been able to find out trolling old email put them there to get around an SMP problem that most likely was fixed in other ways. NetBSD and Linux don't have these, except for some specific uses of SYNC on the alchemy parts (which we don't support, but even if we did it is only a specific case and would be specifically coded anyway). This is true of the current Linux code, as well as one old version I polled. I looked back at the old R12000, R8000, R6000, R4000, R4400 errata that I have, and could find no mention of SYNC needing NOPs for silicon bugs (although plenty of other cases where NOPs and other contortions were needed). An Google search turned up no old mailing list discussions on this on Linux, NetBSD or FreeBSD (except the disussion that kicked off these studies). I've test booted this on my Octeon Plus eval board and survived a buildworld. Adrian Chadd reports that this patch has no ill effects on the Ahteros platforms he tested it on. I conclude it is safe to just remove the NOPs. But added __MIPS_PLATFORM_SYNC_NOPS as a failsafe in case we find some platform where these are, in fact, required. Reviewed by: adrian@ Modified: head/sys/mips/include/atomic.h Modified: head/sys/mips/include/atomic.h ============================================================================== --- head/sys/mips/include/atomic.h Sun Jul 7 16:11:13 2013 (r252964) +++ head/sys/mips/include/atomic.h Sun Jul 7 16:12:22 2013 (r252965) @@ -44,20 +44,16 @@ * do not have atomic operations defined for them, but generally shouldn't * need atomic operations. */ +#ifndef __MIPS_PLATFORM_SYNC_NOPS +#define __MIPS_PLATFORM_SYNC_NOPS "" +#endif static __inline void mips_sync(void) { - __asm __volatile (".set noreorder\n\t" - "sync\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" + __asm __volatile (".set noreorder\n" + "\tsync\n" + __MIPS_PLATFORM_SYNC_NOPS ".set reorder\n" : : : "memory"); } From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:13:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E91B8227; Sun, 7 Jul 2013 16:13:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB4591A2D; Sun, 7 Jul 2013 16:13:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67GDttt049909; Sun, 7 Jul 2013 16:13:55 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67GDtaj049903; Sun, 7 Jul 2013 16:13:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071613.r67GDtaj049903@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 16:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252966 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:13:56 -0000 Author: tuexen Date: Sun Jul 7 16:13:54 2013 New Revision: 252966 URL: http://svnweb.freebsd.org/changeset/base/252966 Log: MFC r246687: Send the adaptation layer indication only if set by the user. Modified: stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_pcb.h stable/9/sys/netinet/sctp_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 16:12:22 2013 (r252965) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 16:13:54 2013 (r252966) @@ -4643,19 +4643,19 @@ sctp_send_initiate(struct sctp_inpcb *in chunk_len += parameter_len; } /* Adaptation layer indication parameter */ - /* XXX: Should we include this always? */ - if (padding_len > 0) { - memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); - chunk_len += padding_len; - padding_len = 0; + if (inp->sctp_ep.adaptation_layer_indicator_provided) { + if (padding_len > 0) { + memset(mtod(m, caddr_t)+chunk_len, 0, padding_len); + chunk_len += padding_len; + padding_len = 0; + } + parameter_len = (uint16_t) sizeof(struct sctp_adaptation_layer_indication); + ali = (struct sctp_adaptation_layer_indication *)(mtod(m, caddr_t)+chunk_len); + ali->ph.param_type = htons(SCTP_ULP_ADAPTATION); + ali->ph.param_length = htons(parameter_len); + ali->indication = ntohl(inp->sctp_ep.adaptation_layer_indicator); + chunk_len += parameter_len; } - parameter_len = (uint16_t) sizeof(struct sctp_adaptation_layer_indication); - ali = (struct sctp_adaptation_layer_indication *)(mtod(m, caddr_t)+chunk_len); - ali->ph.param_type = htons(SCTP_ULP_ADAPTATION); - ali->ph.param_length = htons(parameter_len); - ali->indication = ntohl(inp->sctp_ep.adaptation_layer_indicator); - chunk_len += parameter_len; - if (SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly)) { /* Add NAT friendly parameter. */ if (padding_len > 0) { @@ -5723,12 +5723,16 @@ do_a_abort: htons(inp->sctp_ep.max_open_streams_intome); /* adaptation layer indication parameter */ - ali = (struct sctp_adaptation_layer_indication *)((caddr_t)initack + sizeof(*initack)); - ali->ph.param_type = htons(SCTP_ULP_ADAPTATION); - ali->ph.param_length = htons(sizeof(*ali)); - ali->indication = ntohl(inp->sctp_ep.adaptation_layer_indicator); - SCTP_BUF_LEN(m) += sizeof(*ali); - ecn = (struct sctp_ecn_supported_param *)((caddr_t)ali + sizeof(*ali)); + if (inp->sctp_ep.adaptation_layer_indicator_provided) { + ali = (struct sctp_adaptation_layer_indication *)((caddr_t)initack + sizeof(*initack)); + ali->ph.param_type = htons(SCTP_ULP_ADAPTATION); + ali->ph.param_length = htons(sizeof(*ali)); + ali->indication = ntohl(inp->sctp_ep.adaptation_layer_indicator); + SCTP_BUF_LEN(m) += sizeof(*ali); + ecn = (struct sctp_ecn_supported_param *)((caddr_t)ali + sizeof(*ali)); + } else { + ecn = (struct sctp_ecn_supported_param *)((caddr_t)initack + sizeof(*initack)); + } /* ECN parameter */ if (((asoc != NULL) && (asoc->ecn_allowed == 1)) || Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 16:12:22 2013 (r252965) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 16:13:54 2013 (r252966) @@ -2516,7 +2516,8 @@ sctp_inpcb_alloc(struct socket *so, uint m->pre_open_stream_count = SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default); /* Add adaptation cookie */ - m->adaptation_layer_indicator = 0x504C5253; + m->adaptation_layer_indicator = 0; + m->adaptation_layer_indicator_provided = 0; /* seed random number generator */ m->random_counter = 1; Modified: stable/9/sys/netinet/sctp_pcb.h ============================================================================== --- stable/9/sys/netinet/sctp_pcb.h Sun Jul 7 16:12:22 2013 (r252965) +++ stable/9/sys/netinet/sctp_pcb.h Sun Jul 7 16:13:54 2013 (r252966) @@ -323,6 +323,7 @@ struct sctp_pcb { int auto_close_time; uint32_t initial_sequence_debug; uint32_t adaptation_layer_indicator; + uint8_t adaptation_layer_indicator_provided; uint32_t store_at; uint32_t max_burst; uint32_t fr_max_burst; Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Sun Jul 7 16:12:22 2013 (r252965) +++ stable/9/sys/netinet/sctp_usrreq.c Sun Jul 7 16:13:54 2013 (r252966) @@ -4617,6 +4617,7 @@ sctp_setopt(struct socket *so, int optna SCTP_CHECK_AND_CAST(adap_bits, optval, struct sctp_setadaptation, optsize); SCTP_INP_WLOCK(inp); inp->sctp_ep.adaptation_layer_indicator = adap_bits->ssb_adaptation_ind; + inp->sctp_ep.adaptation_layer_indicator_provided = 1; SCTP_INP_WUNLOCK(inp); break; } From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:16:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0F4C436F; Sun, 7 Jul 2013 16:16:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0174E1A3D; Sun, 7 Jul 2013 16:16:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67GGW6l050327; Sun, 7 Jul 2013 16:16:32 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67GGWpv050326; Sun, 7 Jul 2013 16:16:32 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071616.r67GGWpv050326@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 16:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252967 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:16:33 -0000 Author: tuexen Date: Sun Jul 7 16:16:32 2013 New Revision: 252967 URL: http://svnweb.freebsd.org/changeset/base/252967 Log: MFC r247412: Fix a potential race in returning setting errno when an association goes down. Reported by Mozilla in https://bugzilla.mozilla.org/show_bug.cgi?id=845513 Modified: stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Jul 7 16:13:54 2013 (r252966) +++ stable/9/sys/netinet/sctputil.c Sun Jul 7 16:16:32 2013 (r252967) @@ -2678,6 +2678,7 @@ set_error: if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) { + SOCK_LOCK(stcb->sctp_socket); if (from_peer) { if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) { SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNREFUSED); @@ -2709,7 +2710,7 @@ set_error: if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) { - socantrcvmore(stcb->sctp_socket); + socantrcvmore_locked(stcb->sctp_socket); } sorwakeup(stcb->sctp_socket); sowwakeup(stcb->sctp_socket); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:25:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E06B2723; Sun, 7 Jul 2013 16:25:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B83CB1AAD; Sun, 7 Jul 2013 16:25:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67GPd5A053306; Sun, 7 Jul 2013 16:25:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67GPdi1053304; Sun, 7 Jul 2013 16:25:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071625.r67GPdi1053304@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 16:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252968 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:25:40 -0000 Author: tuexen Date: Sun Jul 7 16:25:39 2013 New Revision: 252968 URL: http://svnweb.freebsd.org/changeset/base/252968 Log: MFC r248172: Return an error if sctp_peeloff() fails because a socket can't be allocated. sctp_peeloff() uses sonewconn() also in cases where listen() wasn't called. So honor this use case. Modified: stable/9/sys/kern/uipc_socket.c stable/9/sys/kern/uipc_syscalls.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Sun Jul 7 16:16:32 2013 (r252967) +++ stable/9/sys/kern/uipc_socket.c Sun Jul 7 16:25:39 2013 (r252968) @@ -136,6 +136,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -505,8 +506,12 @@ sonewconn(struct socket *head, int conns /* * The accept socket may be tearing down but we just * won a race on the ACCEPT_LOCK. + * However, if sctp_peeloff() is called on a 1-to-many + * style socket, the SO_ACCEPTCONN doesn't need to be set. */ - if (!(head->so_options & SO_ACCEPTCONN)) { + if (!(head->so_options & SO_ACCEPTCONN) && + ((head->so_proto->pr_protocol != IPPROTO_SCTP) || + (head->so_type != SOCK_SEQPACKET))) { SOCK_LOCK(so); so->so_head = NULL; sofree(so); /* NB: returns ACCEPT_UNLOCK'ed. */ Modified: stable/9/sys/kern/uipc_syscalls.c ============================================================================== --- stable/9/sys/kern/uipc_syscalls.c Sun Jul 7 16:16:32 2013 (r252967) +++ stable/9/sys/kern/uipc_syscalls.c Sun Jul 7 16:25:39 2013 (r252968) @@ -2372,8 +2372,10 @@ sys_sctp_peeloff(td, uap) CURVNET_SET(head->so_vnet); so = sonewconn(head, SS_ISCONNECTED); - if (so == NULL) + if (so == NULL) { + error = ENOMEM; goto noconnection; + } /* * Before changing the flags on the socket, we have to bump the * reference count. Otherwise, if the protocol calls sofree(), From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:29:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9C138AF8; Sun, 7 Jul 2013 16:29:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E46E1AD1; Sun, 7 Jul 2013 16:29:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67GTGbu053817; Sun, 7 Jul 2013 16:29:16 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67GTGCK053816; Sun, 7 Jul 2013 16:29:16 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071629.r67GTGCK053816@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 16:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252969 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:29:16 -0000 Author: tuexen Date: Sun Jul 7 16:29:16 2013 New Revision: 252969 URL: http://svnweb.freebsd.org/changeset/base/252969 Log: MFC r248953: Add a macro for checking for IPv4 link local addresses. Modified: stable/9/sys/netinet/sctp_constants.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_constants.h ============================================================================== --- stable/9/sys/netinet/sctp_constants.h Sun Jul 7 16:25:39 2013 (r252968) +++ stable/9/sys/netinet/sctp_constants.h Sun Jul 7 16:29:16 2013 (r252969) @@ -997,6 +997,10 @@ __FBSDID("$FreeBSD$"); (((uint8_t *)&(a)->s_addr)[2] == 0) && \ (((uint8_t *)&(a)->s_addr)[3] == 1)) +#define IN4_ISLINKLOCAL_ADDRESS(a) \ + ((((uint8_t *)&(a)->s_addr)[0] == 169) && \ + (((uint8_t *)&(a)->s_addr)[1] == 254)) + #if defined(_KERNEL) #define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:31:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 28C0FC33; Sun, 7 Jul 2013 16:31:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 097941ADD; Sun, 7 Jul 2013 16:31:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67GV81f055744; Sun, 7 Jul 2013 16:31:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67GV8lq055743; Sun, 7 Jul 2013 16:31:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071631.r67GV8lq055743@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 16:31:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252970 - stable/9/lib/libc/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:31:08 -0000 Author: tuexen Date: Sun Jul 7 16:31:07 2013 New Revision: 252970 URL: http://svnweb.freebsd.org/changeset/base/252970 Log: MFC r249333: Remove the number of addresses restriction from sctp_connectx(). Remove unused code. While there, do some cleanup of the code. Modified: stable/9/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/9/lib/libc/net/sctp_sys_calls.c Sun Jul 7 16:29:16 2013 (r252969) +++ stable/9/lib/libc/net/sctp_sys_calls.c Sun Jul 7 16:31:07 2013 (r252970) @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #ifndef IN6_IS_ADDR_V4MAPPED #define IN6_IS_ADDR_V4MAPPED(a) \ ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ @@ -57,77 +55,8 @@ __FBSDID("$FreeBSD$"); (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) #endif - -#define SCTP_CONTROL_VEC_SIZE_SND 8192 #define SCTP_CONTROL_VEC_SIZE_RCV 16384 -#define SCTP_STACK_BUF_SIZE 2048 - -#ifdef SCTP_DEBUG_PRINT_ADDRESS - -#define SCTP_STRING_BUF_SZ 256 - -static void -SCTPPrintAnAddress(struct sockaddr *a) -{ - char stringToPrint[SCTP_STRING_BUF_SZ]; - u_short prt; - char *srcaddr, *txt; - - if (a == NULL) { - printf("NULL\n"); - return; - } - if (a->sa_family == AF_INET) { - srcaddr = (char *)&((struct sockaddr_in *)a)->sin_addr; - txt = "IPv4 Address: "; - prt = ntohs(((struct sockaddr_in *)a)->sin_port); - } else if (a->sa_family == AF_INET6) { - srcaddr = (char *)&((struct sockaddr_in6 *)a)->sin6_addr; - prt = ntohs(((struct sockaddr_in6 *)a)->sin6_port); - txt = "IPv6 Address: "; - } else if (a->sa_family == AF_LINK) { - int i; - char tbuf[SCTP_STRING_BUF_SZ]; - u_char adbuf[SCTP_STRING_BUF_SZ]; - struct sockaddr_dl *dl; - - dl = (struct sockaddr_dl *)a; - strncpy(tbuf, dl->sdl_data, dl->sdl_nlen); - tbuf[dl->sdl_nlen] = 0; - printf("Intf:%s (len:%d)Interface index:%d type:%x(%d) ll-len:%d ", - tbuf, - dl->sdl_nlen, - dl->sdl_index, - dl->sdl_type, - dl->sdl_type, - dl->sdl_alen - ); - memcpy(adbuf, LLADDR(dl), dl->sdl_alen); - for (i = 0; i < dl->sdl_alen; i++) { - printf("%2.2x", adbuf[i]); - if (i < (dl->sdl_alen - 1)) - printf(":"); - } - printf("\n"); - return; - } else { - return; - } - if (inet_ntop(a->sa_family, srcaddr, stringToPrint, sizeof(stringToPrint))) { - if (a->sa_family == AF_INET6) { - printf("%s%s:%d scope:%d\n", - txt, stringToPrint, prt, - ((struct sockaddr_in6 *)a)->sin6_scope_id); - } else { - printf("%s%s:%d\n", txt, stringToPrint, prt); - } - - } else { - printf("%s unprintable?\n", txt); - } -} -#endif /* SCTP_DEBUG_PRINT_ADDRESS */ static void in6_sin6_2_sin(struct sockaddr_in *sin, struct sockaddr_in6 *sin6) @@ -171,11 +100,10 @@ int sctp_connectx(int sd, const struct sockaddr *addrs, int addrcnt, sctp_assoc_t * id) { - char buf[SCTP_STACK_BUF_SIZE]; + char *buf; int i, ret, cnt, *aa; char *cpto; const struct sockaddr *at; - sctp_assoc_t *p_id; size_t len = sizeof(int); /* validate the address count and list */ @@ -183,24 +111,29 @@ sctp_connectx(int sd, const struct socka errno = EINVAL; return (-1); } + if ((buf = malloc(sizeof(int) + (size_t)addrcnt * sizeof(struct sockaddr_in6))) == NULL) { + errno = E2BIG; + return (-1); + } at = addrs; cnt = 0; - cpto = ((caddr_t)buf + sizeof(int)); + cpto = buf + sizeof(int); /* validate all the addresses and get the size */ for (i = 0; i < addrcnt; i++) { switch (at->sa_family) { case AF_INET: if (at->sa_len != sizeof(struct sockaddr_in)) { + free(buf); errno = EINVAL; return (-1); } memcpy(cpto, at, sizeof(struct sockaddr_in)); cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in)); len += sizeof(struct sockaddr_in); - at = (struct sockaddr *)((caddr_t)at + sizeof(struct sockaddr_in)); break; case AF_INET6: if (at->sa_len != sizeof(struct sockaddr_in6)) { + free(buf); errno = EINVAL; return (-1); } @@ -213,31 +146,20 @@ sctp_connectx(int sd, const struct socka cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in6)); len += sizeof(struct sockaddr_in6); } - at = (struct sockaddr *)((caddr_t)at + sizeof(struct sockaddr_in6)); break; default: + free(buf); errno = EINVAL; return (-1); } - if (len > (sizeof(buf) - sizeof(int))) { - /* Never enough memory */ - errno = E2BIG; - return (-1); - } - cnt++; - } - /* do we have any? */ - if (cnt == 0) { - errno = EINVAL; - return (-1); + at = (struct sockaddr *)((caddr_t)at + at->sa_len); } aa = (int *)buf; - *aa = cnt; + *aa = addrcnt; ret = setsockopt(sd, IPPROTO_SCTP, SCTP_CONNECT_X, (void *)buf, (socklen_t) len); - if ((ret == 0) && id) { - p_id = (sctp_assoc_t *) buf; - *id = *p_id; + if ((ret == 0) && (id != NULL)) { + *id = *(sctp_assoc_t *) buf; } return (ret); } @@ -345,7 +267,6 @@ sctp_bindx(int sd, struct sockaddr *addr return (0); } - int sctp_opt_info(int sd, sctp_assoc_t id, int opt, void *arg, socklen_t * size) { @@ -471,9 +392,9 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, void sctp_freepaddrs(struct sockaddr *addrs) { - /* Take away the hidden association id */ void *fr_addr; + /* Take away the hidden association id */ fr_addr = (void *)((caddr_t)addrs - sizeof(sctp_assoc_t)); /* Now free it */ free(fr_addr); @@ -534,15 +455,14 @@ sctp_getladdrs(int sd, sctp_assoc_t id, void sctp_freeladdrs(struct sockaddr *addrs) { - /* Take away the hidden association id */ void *fr_addr; + /* Take away the hidden association id */ fr_addr = (void *)((caddr_t)addrs - sizeof(sctp_assoc_t)); /* Now free it */ free(fr_addr); } - ssize_t sctp_sendmsg(int s, const void *data, @@ -568,11 +488,10 @@ sctp_sendmsg(int s, return (syscall(SYS_sctp_generic_sendmsg, s, data, len, to, tolen, &sinfo, 0)); #else - ssize_t sz; struct msghdr msg; - struct sctp_sndrcvinfo *s_info; + struct sctp_sndrcvinfo *sinfo; struct iovec iov; - char controlVector[SCTP_CONTROL_VEC_SIZE_RCV]; + char cmsgbuf[CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))]; struct cmsghdr *cmsg; struct sockaddr *who = NULL; union { @@ -585,8 +504,9 @@ sctp_sendmsg(int s, errno = EINVAL; return (-1); } - if (to && (tolen > 0)) { - if (to->sa_family == AF_INET) { + if ((to != NULL) && (tolen > 0)) { + switch (to->sa_family) { + case AF_INET: if (tolen != sizeof(struct sockaddr_in)) { errno = EINVAL; return (-1); @@ -598,7 +518,8 @@ sctp_sendmsg(int s, } memcpy(&addr, to, sizeof(struct sockaddr_in)); addr.in.sin_len = sizeof(struct sockaddr_in); - } else if (to->sa_family == AF_INET6) { + break; + case AF_INET6: if (tolen != sizeof(struct sockaddr_in6)) { errno = EINVAL; return (-1); @@ -610,7 +531,8 @@ sctp_sendmsg(int s, } memcpy(&addr, to, sizeof(struct sockaddr_in6)); addr.in6.sin6_len = sizeof(struct sockaddr_in6); - } else { + break; + default: errno = EAFNOSUPPORT; return (-1); } @@ -628,26 +550,21 @@ sctp_sendmsg(int s, } msg.msg_iov = &iov; msg.msg_iovlen = 1; - msg.msg_control = (caddr_t)controlVector; - - cmsg = (struct cmsghdr *)controlVector; - + msg.msg_control = cmsgbuf; + msg.msg_controllen = CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + cmsg = (struct cmsghdr *)cmsgbuf; cmsg->cmsg_level = IPPROTO_SCTP; cmsg->cmsg_type = SCTP_SNDRCV; cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); - s_info = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); - - s_info->sinfo_stream = stream_no; - s_info->sinfo_ssn = 0; - s_info->sinfo_flags = flags; - s_info->sinfo_ppid = ppid; - s_info->sinfo_context = context; - s_info->sinfo_assoc_id = 0; - s_info->sinfo_timetolive = timetolive; - errno = 0; - msg.msg_controllen = cmsg->cmsg_len; - sz = sendmsg(s, &msg, 0); - return (sz); + sinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); + sinfo->sinfo_stream = stream_no; + sinfo->sinfo_ssn = 0; + sinfo->sinfo_flags = flags; + sinfo->sinfo_ppid = ppid; + sinfo->sinfo_context = context; + sinfo->sinfo_assoc_id = 0; + sinfo->sinfo_timetolive = timetolive; + return (sendmsg(s, &msg, 0)); #endif } @@ -662,12 +579,11 @@ sctp_getassocid(int sd, struct sockaddr siz = sizeof(sp); memset(&sp, 0, sizeof(sp)); memcpy((caddr_t)&sp.spinfo_address, sa, sa->sa_len); - errno = 0; if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_PEER_ADDR_INFO, &sp, &siz) != 0) { + /* We depend on the fact that 0 can never be returned */ return ((sctp_assoc_t) 0); } - /* We depend on the fact that 0 can never be returned */ return (sp.spinfo_assoc_id); } @@ -683,11 +599,9 @@ sctp_send(int sd, const void *data, size return (syscall(SYS_sctp_generic_sendmsg, sd, data, len, to, 0, sinfo, flags)); #else - ssize_t sz; struct msghdr msg; struct iovec iov; - struct sctp_sndrcvinfo *s_info; - char controlVector[SCTP_CONTROL_VEC_SIZE_SND]; + char cmsgbuf[CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))]; struct cmsghdr *cmsg; if (sinfo == NULL) { @@ -697,24 +611,18 @@ sctp_send(int sd, const void *data, size iov.iov_base = (char *)data; iov.iov_len = len; - msg.msg_name = 0; + msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_iov = &iov; msg.msg_iovlen = 1; - msg.msg_control = (caddr_t)controlVector; - - cmsg = (struct cmsghdr *)controlVector; - + msg.msg_control = cmsgbuf; + msg.msg_controllen = CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + cmsg = (struct cmsghdr *)cmsgbuf; cmsg->cmsg_level = IPPROTO_SCTP; cmsg->cmsg_type = SCTP_SNDRCV; cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); - s_info = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); - /* copy in the data */ - *s_info = *sinfo; - errno = 0; - msg.msg_controllen = cmsg->cmsg_len; - sz = sendmsg(sd, &msg, flags); - return (sz); + memcpy(CMSG_DATA(cmsg), sinfo, sizeof(struct sctp_sndrcvinfo)); + return (sendmsg(sd, &msg, flags)); #endif } @@ -856,11 +764,10 @@ sctp_recvmsg(int s, return (syscall(SYS_sctp_generic_recvmsg, s, &iov, 1, from, fromlen, sinfo, msg_flags)); #else - struct sctp_sndrcvinfo *s_info; ssize_t sz; struct msghdr msg; struct iovec iov; - char controlVector[SCTP_CONTROL_VEC_SIZE_RCV]; + char cmsgbuf[SCTP_CONTROL_VEC_SIZE_RCV]; struct cmsghdr *cmsg; if (msg_flags == NULL) { @@ -877,52 +784,38 @@ sctp_recvmsg(int s, msg.msg_namelen = *fromlen; msg.msg_iov = &iov; msg.msg_iovlen = 1; - msg.msg_control = (caddr_t)controlVector; - msg.msg_controllen = sizeof(controlVector); - errno = 0; + msg.msg_control = cmsgbuf; + msg.msg_controllen = sizeof(cmsgbuf); sz = recvmsg(s, &msg, *msg_flags); *msg_flags = msg.msg_flags; if (sz <= 0) { return (sz); } - s_info = NULL; if (sinfo) { sinfo->sinfo_assoc_id = 0; } - if ((msg.msg_controllen) && sinfo) { + if ((msg.msg_controllen > 0) && (sinfo != NULL)) { /* * parse through and see if we find the sctp_sndrcvinfo (if * the user wants it). */ - cmsg = (struct cmsghdr *)controlVector; - while (cmsg) { - if ((cmsg->cmsg_len == 0) || (cmsg->cmsg_len > msg.msg_controllen)) { + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level != IPPROTO_SCTP) { + continue; + } + if (cmsg->cmsg_type == SCTP_SNDRCV) { + memcpy(sinfo, CMSG_DATA(cmsg), sizeof(struct sctp_sndrcvinfo)); break; } - if (cmsg->cmsg_level == IPPROTO_SCTP) { - if (cmsg->cmsg_type == SCTP_SNDRCV) { - /* Got it */ - s_info = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); - /* Copy it to the user */ - if (sinfo) - *sinfo = *s_info; - break; - } else if (cmsg->cmsg_type == SCTP_EXTRCV) { - /* - * Got it, presumably the user has - * asked for this extra info, so the - * structure holds more room :-D - */ - s_info = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); - /* Copy it to the user */ - if (sinfo) { - memcpy(sinfo, s_info, sizeof(struct sctp_extrcvinfo)); - } - break; - - } + if (cmsg->cmsg_type == SCTP_EXTRCV) { + /* + * Let's hope that the user provided enough + * enough memory. At least he asked for more + * information. + */ + memcpy(sinfo, CMSG_DATA(cmsg), sizeof(struct sctp_extrcvinfo)); + break; } - cmsg = CMSG_NXTHDR(&msg, cmsg); } } return (sz); @@ -940,10 +833,10 @@ sctp_recvv(int sd, unsigned int *infotype, int *flags) { - char ctlbuf[SCTP_CONTROL_VEC_SIZE_RCV]; + char cmsgbuf[SCTP_CONTROL_VEC_SIZE_RCV]; struct msghdr msg; struct cmsghdr *cmsg; - ssize_t n; + ssize_t ret; struct sctp_rcvinfo *rcvinfo; struct sctp_nxtinfo *nxtinfo; @@ -964,12 +857,11 @@ sctp_recvv(int sd, } msg.msg_iov = (struct iovec *)iov; msg.msg_iovlen = iovlen; - msg.msg_control = ctlbuf; - msg.msg_controllen = sizeof(ctlbuf); - errno = 0; - n = recvmsg(sd, &msg, *flags); + msg.msg_control = cmsgbuf; + msg.msg_controllen = sizeof(cmsgbuf); + ret = recvmsg(sd, &msg, *flags); *flags = msg.msg_flags; - if ((n > 0) && + if ((ret > 0) && (msg.msg_controllen > 0) && (infotype != NULL) && (infolen != NULL) && @@ -982,41 +874,44 @@ sctp_recvv(int sd, } if (cmsg->cmsg_type == SCTP_RCVINFO) { rcvinfo = (struct sctp_rcvinfo *)CMSG_DATA(cmsg); + if (nxtinfo != NULL) { + break; + } else { + continue; + } } if (cmsg->cmsg_type == SCTP_NXTINFO) { nxtinfo = (struct sctp_nxtinfo *)CMSG_DATA(cmsg); - } - if (rcvinfo && nxtinfo) { - break; + if (rcvinfo != NULL) { + break; + } else { + continue; + } } } - if (rcvinfo) { - if (nxtinfo) { - if (*infolen >= sizeof(struct sctp_recvv_rn)) { - struct sctp_recvv_rn *rn_info; - - rn_info = (struct sctp_recvv_rn *)info; - rn_info->recvv_rcvinfo = *rcvinfo; - rn_info->recvv_nxtinfo = *nxtinfo; - *infolen = (socklen_t) sizeof(struct sctp_recvv_rn); - *infotype = SCTP_RECVV_RN; - } - } else { - if (*infolen >= sizeof(struct sctp_rcvinfo)) { - memcpy(info, rcvinfo, sizeof(struct sctp_rcvinfo)); - *infolen = (socklen_t) sizeof(struct sctp_rcvinfo); - *infotype = SCTP_RECVV_RCVINFO; - } + if (rcvinfo != NULL) { + if ((nxtinfo != NULL) && (*infolen >= sizeof(struct sctp_recvv_rn))) { + struct sctp_recvv_rn *rn_info; + + rn_info = (struct sctp_recvv_rn *)info; + rn_info->recvv_rcvinfo = *rcvinfo; + rn_info->recvv_nxtinfo = *nxtinfo; + *infolen = (socklen_t) sizeof(struct sctp_recvv_rn); + *infotype = SCTP_RECVV_RN; + } else if (*infolen >= sizeof(struct sctp_rcvinfo)) { + memcpy(info, rcvinfo, sizeof(struct sctp_rcvinfo)); + *infolen = (socklen_t) sizeof(struct sctp_rcvinfo); + *infotype = SCTP_RECVV_RCVINFO; } - } else if (nxtinfo) { - if (*infolen >= sizeof(struct sctp_rcvinfo)) { + } else if (nxtinfo != NULL) { + if (*infolen >= sizeof(struct sctp_nxtinfo)) { memcpy(info, nxtinfo, sizeof(struct sctp_nxtinfo)); *infolen = (socklen_t) sizeof(struct sctp_nxtinfo); *infotype = SCTP_RECVV_NXTINFO; } } } - return (n); + return (ret); } ssize_t @@ -1241,7 +1136,4 @@ sctp_peeloff(int sd, sctp_assoc_t assoc_ #endif - -#undef SCTP_CONTROL_VEC_SIZE_SND #undef SCTP_CONTROL_VEC_SIZE_RCV -#undef SCTP_STACK_BUF_SIZE From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:51:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BB0BE316; Sun, 7 Jul 2013 16:51:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 932EA1BA8; Sun, 7 Jul 2013 16:51:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67GpIRr061514; Sun, 7 Jul 2013 16:51:18 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67GpIRW061512; Sun, 7 Jul 2013 16:51:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071651.r67GpIRW061512@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 16:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252971 - in stable/9/sys: netinet netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:51:18 -0000 Author: tuexen Date: Sun Jul 7 16:51:17 2013 New Revision: 252971 URL: http://svnweb.freebsd.org/changeset/base/252971 Log: MFC r250466: Honor the net.inet6.ip6.v6only sysctl variable and the IPV6_V6ONLY socket option for SCTP sockets in the same way as for UDP or TCP sockets. Modified: stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 16:31:07 2013 (r252970) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 16:51:17 2013 (r252971) @@ -2376,8 +2376,13 @@ sctp_inpcb_alloc(struct socket *so, uint inp->sctp_socket = so; inp->ip_inp.inp.inp_socket = so; #ifdef INET6 - if (MODULE_GLOBAL(ip6_auto_flowlabel)) { - inp->ip_inp.inp.inp_flags |= IN6P_AUTOFLOWLABEL; + if (INP_SOCKAF(so) == AF_INET6) { + if (MODULE_GLOBAL(ip6_auto_flowlabel)) { + inp->ip_inp.inp.inp_flags |= IN6P_AUTOFLOWLABEL; + } + if (MODULE_GLOBAL(ip6_v6only)) { + inp->ip_inp.inp.inp_flags |= IN6P_IPV6_V6ONLY; + } } #endif inp->sctp_associd_counter = 1; Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sun Jul 7 16:31:07 2013 (r252970) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sun Jul 7 16:51:17 2013 (r252971) @@ -787,18 +787,11 @@ sctp6_send(struct socket *so, int flags, } } if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - if (!MODULE_GLOBAL(ip6_v6only)) { - struct sockaddr_in sin; + struct sockaddr_in sin; - /* convert v4-mapped into v4 addr and send */ - in6_sin6_2_sin(&sin, sin6); - return (sctp_sendm(so, flags, m, (struct sockaddr *)&sin, - control, p)); - } else { - /* mapped addresses aren't enabled */ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); - return (EINVAL); - } + /* convert v4-mapped into v4 addr and send */ + in6_sin6_2_sin(&sin, sin6); + return (sctp_sendm(so, flags, m, (struct sockaddr *)&sin, control, p)); } #endif /* INET */ connected_type: @@ -932,17 +925,9 @@ sctp6_connect(struct socket *so, struct } } if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - if (!MODULE_GLOBAL(ip6_v6only)) { - /* convert v4-mapped into v4 addr */ - in6_sin6_2_sin((struct sockaddr_in *)&ss, sin6); - addr = (struct sockaddr *)&ss; - } else { - /* mapped addresses aren't enabled */ - SCTP_INP_RUNLOCK(inp); - SCTP_ASOC_CREATE_UNLOCK(inp); - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); - return (EINVAL); - } + /* convert v4-mapped into v4 addr */ + in6_sin6_2_sin((struct sockaddr_in *)&ss, sin6); + addr = (struct sockaddr *)&ss; } #endif /* INET */ /* Now do we connect? */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:53:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3496352F; Sun, 7 Jul 2013 16:53:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1F8F31BCD; Sun, 7 Jul 2013 16:53:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67GriJu061819; Sun, 7 Jul 2013 16:53:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67GriEK061818; Sun, 7 Jul 2013 16:53:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071653.r67GriEK061818@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 16:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252972 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:53:45 -0000 Author: tuexen Date: Sun Jul 7 16:53:44 2013 New Revision: 252972 URL: http://svnweb.freebsd.org/changeset/base/252972 Log: MFC r250754: Don't send an ABORT chunk with verification 0. Modified: stable/9/sys/netinet/sctp_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sun Jul 7 16:51:17 2013 (r252971) +++ stable/9/sys/netinet/sctp_output.c Sun Jul 7 16:53:44 2013 (r252972) @@ -10669,6 +10669,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stc struct sctp_abort_chunk *abort; struct sctp_auth_chunk *auth = NULL; struct sctp_nets *net; + uint32_t vtag; uint32_t auth_offset = 0; uint16_t cause_len, chunk_len, padding_len; @@ -10724,7 +10725,14 @@ sctp_send_abort_tcb(struct sctp_tcb *stc /* Fill in the ABORT chunk header. */ abort = mtod(m_abort, struct sctp_abort_chunk *); abort->ch.chunk_type = SCTP_ABORT_ASSOCIATION; - abort->ch.chunk_flags = 0; + if (stcb->asoc.peer_vtag == 0) { + /* This happens iff the assoc is in COOKIE-WAIT state. */ + vtag = stcb->asoc.my_vtag; + abort->ch.chunk_flags = SCTP_HAD_NO_TCB; + } else { + vtag = stcb->asoc.peer_vtag; + abort->ch.chunk_flags = 0; + } abort->ch.chunk_length = htons(chunk_len); /* Add padding, if necessary. */ if (padding_len > 0) { @@ -10736,7 +10744,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stc (void)sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, (struct sockaddr *)&net->ro._l_addr, m_out, auth_offset, auth, stcb->asoc.authinfo.active_keyid, 1, 0, 0, - stcb->sctp_ep->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), + stcb->sctp_ep->sctp_lport, stcb->rport, htonl(vtag), stcb->asoc.primary_destination->port, NULL, 0, 0, so_locked); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:55:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C8648670; Sun, 7 Jul 2013 16:55:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA8551BE0; Sun, 7 Jul 2013 16:55:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67GtvSo062180; Sun, 7 Jul 2013 16:55:57 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67GtvaE062179; Sun, 7 Jul 2013 16:55:57 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071655.r67GtvaE062179@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 16:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252973 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:55:57 -0000 Author: tuexen Date: Sun Jul 7 16:55:57 2013 New Revision: 252973 URL: http://svnweb.freebsd.org/changeset/base/252973 Log: MFC r250756: Set errno to ETIMEDOUT if an SCTP association times out during setup. Modified: stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Jul 7 16:53:44 2013 (r252972) +++ stable/9/sys/netinet/sctputil.c Sun Jul 7 16:55:57 2013 (r252973) @@ -2688,8 +2688,14 @@ set_error: stcb->sctp_socket->so_error = ECONNRESET; } } else { - SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNABORTED); - stcb->sctp_socket->so_error = ECONNABORTED; + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ETIMEDOUT); + stcb->sctp_socket->so_error = ETIMEDOUT; + } else { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNABORTED); + stcb->sctp_socket->so_error = ECONNABORTED; + } } } /* Wake ANY sleepers */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 16:59:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C95F77E0; Sun, 7 Jul 2013 16:59:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A16051BF7; Sun, 7 Jul 2013 16:59:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67GxXgc062615; Sun, 7 Jul 2013 16:59:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67GxX4k062614; Sun, 7 Jul 2013 16:59:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071659.r67GxX4k062614@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 16:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252974 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 16:59:33 -0000 Author: tuexen Date: Sun Jul 7 16:59:33 2013 New Revision: 252974 URL: http://svnweb.freebsd.org/changeset/base/252974 Log: MFC r251054: Remove redundant checks. Modified: stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Jul 7 16:55:57 2013 (r252973) +++ stable/9/sys/netinet/sctputil.c Sun Jul 7 16:59:33 2013 (r252974) @@ -3536,8 +3536,8 @@ sctp_ulp_notify(uint32_t notification, s if (stcb->sctp_socket->so_rcv.sb_state & SBS_CANTRCVMORE) { return; } - if (stcb && ((stcb->asoc.state & SCTP_STATE_COOKIE_WAIT) || - (stcb->asoc.state & SCTP_STATE_COOKIE_ECHOED))) { + if ((stcb->asoc.state & SCTP_STATE_COOKIE_WAIT) || + (stcb->asoc.state & SCTP_STATE_COOKIE_ECHOED)) { if ((notification == SCTP_NOTIFY_INTERFACE_DOWN) || (notification == SCTP_NOTIFY_INTERFACE_UP) || (notification == SCTP_NOTIFY_INTERFACE_CONFIRMED)) { @@ -3611,16 +3611,16 @@ sctp_ulp_notify(uint32_t notification, s break; } case SCTP_NOTIFY_ASSOC_LOC_ABORTED: - if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || - ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { + if (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || + ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED)) { sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 0, so_locked); } else { sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 0, so_locked); } break; case SCTP_NOTIFY_ASSOC_REM_ABORTED: - if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || - ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { + if (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || + ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED)) { sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 1, so_locked); } else { sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 1, so_locked); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 17:01:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 599AC95A; Sun, 7 Jul 2013 17:01:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4BAB11C11; Sun, 7 Jul 2013 17:01:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67H1a7e064733; Sun, 7 Jul 2013 17:01:36 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67H1ZvW064731; Sun, 7 Jul 2013 17:01:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071701.r67H1ZvW064731@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 17:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252975 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 17:01:36 -0000 Author: tuexen Date: Sun Jul 7 17:01:35 2013 New Revision: 252975 URL: http://svnweb.freebsd.org/changeset/base/252975 Log: MFC r251248: Use LIST_EMPTY when appropriate. Modified: stable/9/sys/netinet/sctputil.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sun Jul 7 16:59:33 2013 (r252974) +++ stable/9/sys/netinet/sctputil.c Sun Jul 7 17:01:35 2013 (r252975) @@ -3973,7 +3973,7 @@ sctp_abort_an_association(struct sctp_in if (stcb == NULL) { /* Got to have a TCB */ if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - if (LIST_FIRST(&inp->sctp_asoc_list) == NULL) { + if (LIST_EMPTY(&inp->sctp_asoc_list)) { sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, SCTP_CALLED_DIRECTLY_NOCMPSET); } @@ -4028,7 +4028,7 @@ sctp_handle_ootb(struct mbuf *m, int iph SCTP_STAT_INCR_COUNTER32(sctps_outoftheblue); /* Generate a TO address for future reference */ if (inp && (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { - if (LIST_FIRST(&inp->sctp_asoc_list) == NULL) { + if (LIST_EMPTY(&inp->sctp_asoc_list)) { sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, SCTP_CALLED_DIRECTLY_NOCMPSET); } From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 17:04:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 95A91BB4; Sun, 7 Jul 2013 17:04:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 876E91C30; Sun, 7 Jul 2013 17:04:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67H4OPV065292; Sun, 7 Jul 2013 17:04:24 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67H4NWq065288; Sun, 7 Jul 2013 17:04:23 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071704.r67H4NWq065288@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 17:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252976 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 17:04:24 -0000 Author: tuexen Date: Sun Jul 7 17:04:23 2013 New Revision: 252976 URL: http://svnweb.freebsd.org/changeset/base/252976 Log: MFC r252585: Code cleanups. Modified: stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_indata.h stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_pcb.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sun Jul 7 17:01:35 2013 (r252975) +++ stable/9/sys/netinet/sctp_indata.c Sun Jul 7 17:04:23 2013 (r252976) @@ -1729,7 +1729,6 @@ sctp_process_a_data_chunk(struct sctp_tc sctp_alloc_a_readq(stcb, control); sctp_build_readq_entry_mac(control, stcb, asoc->context, net, tsn, protocol_id, - stcb->asoc.context, strmno, strmseq, chunk_flags, dmbuf); @@ -1857,7 +1856,6 @@ failed_pdapi_express_del: sctp_alloc_a_readq(stcb, control); sctp_build_readq_entry_mac(control, stcb, asoc->context, net, tsn, protocol_id, - stcb->asoc.context, strmno, strmseq, chunk_flags, dmbuf); Modified: stable/9/sys/netinet/sctp_indata.h ============================================================================== --- stable/9/sys/netinet/sctp_indata.h Sun Jul 7 17:01:35 2013 (r252975) +++ stable/9/sys/netinet/sctp_indata.h Sun Jul 7 17:04:23 2013 (r252976) @@ -47,14 +47,14 @@ sctp_build_readq_entry(struct sctp_tcb * struct mbuf *dm); -#define sctp_build_readq_entry_mac(_ctl, in_it, a, net, tsn, ppid, context, stream_no, stream_seq, flags, dm) do { \ +#define sctp_build_readq_entry_mac(_ctl, in_it, context, net, tsn, ppid, stream_no, stream_seq, flags, dm) do { \ if (_ctl) { \ atomic_add_int(&((net)->ref_count), 1); \ (_ctl)->sinfo_stream = stream_no; \ (_ctl)->sinfo_ssn = stream_seq; \ (_ctl)->sinfo_flags = (flags << 8); \ (_ctl)->sinfo_ppid = ppid; \ - (_ctl)->sinfo_context = a; \ + (_ctl)->sinfo_context = context; \ (_ctl)->sinfo_timetolive = 0; \ (_ctl)->sinfo_tsn = tsn; \ (_ctl)->sinfo_cumtsn = tsn; \ Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Jul 7 17:01:35 2013 (r252975) +++ stable/9/sys/netinet/sctp_input.c Sun Jul 7 17:04:23 2013 (r252976) @@ -1028,12 +1028,13 @@ sctp_handle_shutdown_ack(struct sctp_shu SCTP_SOCKET_UNLOCK(so, 1); #endif } - /* are the queues empty? */ +#ifdef INVARIANTS if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { - sctp_report_all_outbound(stcb, 0, 0, SCTP_SO_NOT_LOCKED); + panic("Queues are not empty when handling SHUTDOWN-ACK"); } +#endif /* stop the timer */ sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_9); /* send SHUTDOWN-COMPLETE */ @@ -1875,9 +1876,14 @@ sctp_process_cookie_existing(struct mbuf cookie->tie_tag_peer_vtag != 0) { struct sctpasochead *head; +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + struct socket *so; + +#endif + if (asoc->peer_supports_nat) { /* - * This is a gross gross hack. just call the + * This is a gross gross hack. Just call the * cookie_new code since we are allowing a duplicate * association. I hope this works... */ @@ -1939,6 +1945,10 @@ sctp_process_cookie_existing(struct mbuf asoc->mapping_array_size); } SCTP_TCB_UNLOCK(stcb); +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + so = SCTP_INP_SO(stcb->sctp_ep); + SCTP_SOCKET_LOCK(so, 1); +#endif SCTP_INP_INFO_WLOCK(); SCTP_INP_WLOCK(stcb->sctp_ep); SCTP_TCB_LOCK(stcb); @@ -1946,7 +1956,7 @@ sctp_process_cookie_existing(struct mbuf /* send up all the data */ SCTP_TCB_SEND_LOCK(stcb); - sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_NOT_LOCKED); + sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_LOCKED); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { stcb->asoc.strmout[i].chunks_on_queues = 0; stcb->asoc.strmout[i].stream_no = i; @@ -1968,11 +1978,15 @@ sctp_process_cookie_existing(struct mbuf */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); - /* process the INIT info (peer's info) */ SCTP_TCB_SEND_UNLOCK(stcb); SCTP_INP_WUNLOCK(stcb->sctp_ep); SCTP_INP_INFO_WUNLOCK(); - +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + SCTP_SOCKET_UNLOCK(so, 1); +#endif + asoc->total_flight = 0; + asoc->total_flight_count = 0; + /* process the INIT info (peer's info) */ retval = sctp_process_init(init_cp, stcb); if (retval < 0) { if (how_indx < sizeof(asoc->cookie_how)) @@ -3196,13 +3210,14 @@ sctp_handle_shutdown_complete(struct sct /* notify upper layer protocol */ if (stcb->sctp_socket) { sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); - /* are the queues empty? they should be */ - if (!TAILQ_EMPTY(&asoc->send_queue) || - !TAILQ_EMPTY(&asoc->sent_queue) || - !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { - sctp_report_all_outbound(stcb, 0, 0, SCTP_SO_NOT_LOCKED); - } } +#ifdef INVARIANTS + if (!TAILQ_EMPTY(&asoc->send_queue) || + !TAILQ_EMPTY(&asoc->sent_queue) || + !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { + panic("Queues are not empty when handling SHUTDOWN-COMPLETE"); + } +#endif /* stop the timer */ sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_22); SCTP_STAT_INCR_COUNTER32(sctps_shutdown); @@ -3491,18 +3506,13 @@ sctp_reset_in_stream(struct sctp_tcb *st } static void -sctp_reset_out_streams(struct sctp_tcb *stcb, int number_entries, uint16_t * list) +sctp_reset_out_streams(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t * list) { - int i; + uint32_t i; + uint16_t temp; - if (number_entries == 0) { - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - stcb->asoc.strmout[i].next_sequence_send = 0; - } - } else if (number_entries) { + if (number_entries > 0) { for (i = 0; i < number_entries; i++) { - uint16_t temp; - temp = ntohs(list[i]); if (temp >= stcb->asoc.streamoutcnt) { /* no such stream */ @@ -3510,6 +3520,10 @@ sctp_reset_out_streams(struct sctp_tcb * } stcb->asoc.strmout[temp].next_sequence_send = 0; } + } else { + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + stcb->asoc.strmout[i].next_sequence_send = 0; + } } sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_SEND, stcb, number_entries, (void *)list, SCTP_SO_NOT_LOCKED); } @@ -3596,7 +3610,7 @@ sctp_handle_stream_reset_response(struct struct sctp_association *asoc = &stcb->asoc; struct sctp_tmit_chunk *chk; struct sctp_stream_reset_out_request *srparam; - int number_entries; + uint32_t number_entries; if (asoc->stream_reset_outstanding == 0) { /* duplicate */ Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 17:01:35 2013 (r252975) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 17:04:23 2013 (r252976) @@ -4451,23 +4451,21 @@ sctp_delete_from_timewait(uint32_t tag, int i; chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; - if (!LIST_EMPTY(chain)) { - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == tag) && - (twait_block->vtag_block[i].lport == lport) && - (twait_block->vtag_block[i].rport == rport)) { - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - found = 1; - break; - } - } - if (found) + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if ((twait_block->vtag_block[i].v_tag == tag) && + (twait_block->vtag_block[i].lport == lport) && + (twait_block->vtag_block[i].rport == rport)) { + twait_block->vtag_block[i].tv_sec_at_expire = 0; + twait_block->vtag_block[i].v_tag = 0; + twait_block->vtag_block[i].lport = 0; + twait_block->vtag_block[i].rport = 0; + found = 1; break; + } } + if (found) + break; } } @@ -4481,19 +4479,17 @@ sctp_is_in_timewait(uint32_t tag, uint16 SCTP_INP_INFO_WLOCK(); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; - if (!LIST_EMPTY(chain)) { - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == tag) && - (twait_block->vtag_block[i].lport == lport) && - (twait_block->vtag_block[i].rport == rport)) { - found = 1; - break; - } - } - if (found) + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if ((twait_block->vtag_block[i].v_tag == tag) && + (twait_block->vtag_block[i].lport == lport) && + (twait_block->vtag_block[i].rport == rport)) { + found = 1; break; + } } + if (found) + break; } SCTP_INP_INFO_WUNLOCK(); return (found); @@ -4515,42 +4511,40 @@ sctp_add_vtag_to_timewait(uint32_t tag, (void)SCTP_GETTIME_TIMEVAL(&now); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; set = 0; - if (!LIST_EMPTY(chain)) { + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { /* Block(s) present, lets find space, and expire on the fly */ - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == 0) && - !set) { - twait_block->vtag_block[i].tv_sec_at_expire = - now.tv_sec + time; + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if ((twait_block->vtag_block[i].v_tag == 0) && + !set) { + twait_block->vtag_block[i].tv_sec_at_expire = + now.tv_sec + time; + twait_block->vtag_block[i].v_tag = tag; + twait_block->vtag_block[i].lport = lport; + twait_block->vtag_block[i].rport = rport; + set = 1; + } else if ((twait_block->vtag_block[i].v_tag) && + ((long)twait_block->vtag_block[i].tv_sec_at_expire < now.tv_sec)) { + /* Audit expires this guy */ + twait_block->vtag_block[i].tv_sec_at_expire = 0; + twait_block->vtag_block[i].v_tag = 0; + twait_block->vtag_block[i].lport = 0; + twait_block->vtag_block[i].rport = 0; + if (set == 0) { + /* Reuse it for my new tag */ + twait_block->vtag_block[i].tv_sec_at_expire = now.tv_sec + time; twait_block->vtag_block[i].v_tag = tag; twait_block->vtag_block[i].lport = lport; twait_block->vtag_block[i].rport = rport; set = 1; - } else if ((twait_block->vtag_block[i].v_tag) && - ((long)twait_block->vtag_block[i].tv_sec_at_expire < now.tv_sec)) { - /* Audit expires this guy */ - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - if (set == 0) { - /* Reuse it for my new tag */ - twait_block->vtag_block[i].tv_sec_at_expire = now.tv_sec + time; - twait_block->vtag_block[i].v_tag = tag; - twait_block->vtag_block[i].lport = lport; - twait_block->vtag_block[i].rport = rport; - set = 1; - } } } - if (set) { - /* - * We only do up to the block where we can - * place our tag for audits - */ - break; - } + } + if (set) { + /* + * We only do up to the block where we can place our + * tag for audits + */ + break; } } /* Need to add a new block to chain */ @@ -6700,30 +6694,28 @@ skip_vtag_check: chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; /* Now what about timed wait ? */ - if (!LIST_EMPTY(chain)) { + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { /* * Block(s) are present, lets see if we have this tag in the * list */ - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if (twait_block->vtag_block[i].v_tag == 0) { - /* not used */ - continue; - } else if ((long)twait_block->vtag_block[i].tv_sec_at_expire < - now->tv_sec) { - /* Audit expires this guy */ - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - } else if ((twait_block->vtag_block[i].v_tag == tag) && - (twait_block->vtag_block[i].lport == lport) && - (twait_block->vtag_block[i].rport == rport)) { - /* Bad tag, sorry :< */ - SCTP_INP_INFO_RUNLOCK(); - return (0); - } + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if (twait_block->vtag_block[i].v_tag == 0) { + /* not used */ + continue; + } else if ((long)twait_block->vtag_block[i].tv_sec_at_expire < + now->tv_sec) { + /* Audit expires this guy */ + twait_block->vtag_block[i].tv_sec_at_expire = 0; + twait_block->vtag_block[i].v_tag = 0; + twait_block->vtag_block[i].lport = 0; + twait_block->vtag_block[i].rport = 0; + } else if ((twait_block->vtag_block[i].v_tag == tag) && + (twait_block->vtag_block[i].lport == lport) && + (twait_block->vtag_block[i].rport == rport)) { + /* Bad tag, sorry :< */ + SCTP_INP_INFO_RUNLOCK(); + return (0); } } } From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 17:06:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 845ECCF7; Sun, 7 Jul 2013 17:06:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 767E61C40; Sun, 7 Jul 2013 17:06:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67H6XaU065697; Sun, 7 Jul 2013 17:06:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67H6XrS065696; Sun, 7 Jul 2013 17:06:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071706.r67H6XrS065696@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 17:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252977 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 17:06:33 -0000 Author: tuexen Date: Sun Jul 7 17:06:33 2013 New Revision: 252977 URL: http://svnweb.freebsd.org/changeset/base/252977 Log: MFC r252718: When processing an incoming ABORT, SHUTDOWN_COMPLETE or ERROR (NAT related) chunk, take always the T-bit into account, when checking the verification tag. Modified: stable/9/sys/netinet/sctp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Jul 7 17:04:23 2013 (r252976) +++ stable/9/sys/netinet/sctp_input.c Sun Jul 7 17:06:33 2013 (r252977) @@ -4568,8 +4568,10 @@ __attribute__((noinline)) if ((ch->chunk_type == SCTP_ABORT_ASSOCIATION) || (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) || (ch->chunk_type == SCTP_PACKET_DROPPED)) { - if ((vtag_in == asoc->my_vtag) || - ((ch->chunk_flags & SCTP_HAD_NO_TCB) && + /* Take the T-bit always into account. */ + if ((((ch->chunk_flags & SCTP_HAD_NO_TCB) == 0) && + (vtag_in == asoc->my_vtag)) || + (((ch->chunk_flags & SCTP_HAD_NO_TCB) == SCTP_HAD_NO_TCB) && (vtag_in == asoc->peer_vtag))) { /* this is valid */ } else { From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 17:09:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 05925E48; Sun, 7 Jul 2013 17:09:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EB5811C57; Sun, 7 Jul 2013 17:09:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67H90Tu066131; Sun, 7 Jul 2013 17:09:00 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67H8x1B066116; Sun, 7 Jul 2013 17:08:59 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071708.r67H8x1B066116@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 17:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252978 - stable/9/sys/netinet X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 17:09:01 -0000 Author: tuexen Date: Sun Jul 7 17:08:59 2013 New Revision: 252978 URL: http://svnweb.freebsd.org/changeset/base/252978 Log: MFC r252779: Fix a bug were only 2048 streams where usable even though more than 2048 streams were negotiated on the wire. While there, remove the hard coded limit of 2048 streams. Modified: stable/9/sys/netinet/sctp_constants.h stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_sysctl.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_constants.h ============================================================================== --- stable/9/sys/netinet/sctp_constants.h Sun Jul 7 17:06:33 2013 (r252977) +++ stable/9/sys/netinet/sctp_constants.h Sun Jul 7 17:08:59 2013 (r252978) @@ -521,9 +521,6 @@ __FBSDID("$FreeBSD$"); /* How long a cookie lives in milli-seconds */ #define SCTP_DEFAULT_COOKIE_LIFE 60000 -/* resource limit of streams */ -#define MAX_SCTP_STREAMS 2048 - /* Maximum the mapping array will grow to (TSN mapping array) */ #define SCTP_MAPPING_ARRAY 512 @@ -658,6 +655,7 @@ __FBSDID("$FreeBSD$"); /* How many streams I request initally by default */ #define SCTP_OSTREAM_INITIAL 10 +#define SCTP_ISTREAM_INITIAL 2048 /* * How many smallest_mtu's need to increase before a window update sack is Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sun Jul 7 17:06:33 2013 (r252977) +++ stable/9/sys/netinet/sctp_input.c Sun Jul 7 17:08:59 2013 (r252978) @@ -389,9 +389,10 @@ sctp_process_init(struct sctp_init_chunk } SCTP_FREE(asoc->strmin, SCTP_M_STRMI); } - asoc->streamincnt = ntohs(init->num_outbound_streams); - if (asoc->streamincnt > MAX_SCTP_STREAMS) { - asoc->streamincnt = MAX_SCTP_STREAMS; + if (asoc->max_inbound_streams > ntohs(init->num_outbound_streams)) { + asoc->streamincnt = ntohs(init->num_outbound_streams); + } else { + asoc->streamincnt = asoc->max_inbound_streams; } SCTP_MALLOC(asoc->strmin, struct sctp_stream_in *, asoc->streamincnt * sizeof(struct sctp_stream_in), SCTP_M_STRMI); @@ -403,11 +404,6 @@ sctp_process_init(struct sctp_init_chunk for (i = 0; i < asoc->streamincnt; i++) { asoc->strmin[i].stream_no = i; asoc->strmin[i].last_sequence_delivered = 0xffff; - /* - * U-stream ranges will be set when the cookie is unpacked. - * Or for the INIT sender they are un set (if pr-sctp not - * supported) when the INIT-ACK arrives. - */ TAILQ_INIT(&asoc->strmin[i].inqueue); asoc->strmin[i].delivery_started = 0; } Modified: stable/9/sys/netinet/sctp_pcb.c ============================================================================== --- stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 17:06:33 2013 (r252977) +++ stable/9/sys/netinet/sctp_pcb.c Sun Jul 7 17:08:59 2013 (r252978) @@ -2503,9 +2503,6 @@ sctp_inpcb_alloc(struct socket *so, uint m->initial_rto = SCTP_BASE_SYSCTL(sctp_rto_initial_default); m->initial_init_rto_max = SCTP_BASE_SYSCTL(sctp_init_rto_max_default); m->sctp_sack_freq = SCTP_BASE_SYSCTL(sctp_sack_freq_default); - - m->max_open_streams_intome = MAX_SCTP_STREAMS; - m->max_init_times = SCTP_BASE_SYSCTL(sctp_init_rtx_max_default); m->max_send_times = SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default); m->def_net_failure = SCTP_BASE_SYSCTL(sctp_path_rtx_max_default); @@ -2517,6 +2514,7 @@ sctp_inpcb_alloc(struct socket *so, uint m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); m->sctp_default_ss_module = SCTP_BASE_SYSCTL(sctp_default_ss_module); + m->max_open_streams_intome = SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default); /* number of streams to pre-open on a association */ m->pre_open_stream_count = SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default); Modified: stable/9/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.c Sun Jul 7 17:06:33 2013 (r252977) +++ stable/9/sys/netinet/sctp_sysctl.c Sun Jul 7 17:08:59 2013 (r252978) @@ -81,6 +81,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_path_rtx_max_default) = SCTPCTL_PATH_RTX_MAX_DEFAULT; SCTP_BASE_SYSCTL(sctp_path_pf_threshold) = SCTPCTL_PATH_PF_THRESHOLD_DEFAULT; SCTP_BASE_SYSCTL(sctp_add_more_threshold) = SCTPCTL_ADD_MORE_ON_OUTPUT_DEFAULT; + SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default) = SCTPCTL_INCOMING_STREAMS_DEFAULT; SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default) = SCTPCTL_OUTGOING_STREAMS_DEFAULT; SCTP_BASE_SYSCTL(sctp_cmt_on_off) = SCTPCTL_CMT_ON_OFF_DEFAULT; /* EY */ @@ -623,6 +624,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), SCTPCTL_PATH_RTX_MAX_MIN, SCTPCTL_PATH_RTX_MAX_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_path_pf_threshold), SCTPCTL_PATH_PF_THRESHOLD_MIN, SCTPCTL_PATH_PF_THRESHOLD_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_add_more_threshold), SCTPCTL_ADD_MORE_ON_OUTPUT_MIN, SCTPCTL_ADD_MORE_ON_OUTPUT_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), SCTPCTL_INCOMING_STREAMS_MIN, SCTPCTL_INCOMING_STREAMS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), SCTPCTL_OUTGOING_STREAMS_MIN, SCTPCTL_OUTGOING_STREAMS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_on_off), SCTPCTL_CMT_ON_OFF_MIN, SCTPCTL_CMT_ON_OFF_MAX); /* EY */ @@ -965,6 +967,10 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_add_more_threshold), 0, sysctl_sctp_check, "IU", SCTPCTL_ADD_MORE_ON_OUTPUT_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, incoming_streams, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), 0, sysctl_sctp_check, "IU", + SCTPCTL_INCOMING_STREAMS_DESC); + SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTGOING_STREAMS_DESC); Modified: stable/9/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.h Sun Jul 7 17:06:33 2013 (r252977) +++ stable/9/sys/netinet/sctp_sysctl.h Sun Jul 7 17:08:59 2013 (r252978) @@ -72,6 +72,7 @@ struct sctp_sysctl { uint32_t sctp_path_rtx_max_default; uint32_t sctp_path_pf_threshold; uint32_t sctp_add_more_threshold; + uint32_t sctp_nr_incoming_streams_default; uint32_t sctp_nr_outgoing_streams_default; uint32_t sctp_cmt_on_off; uint32_t sctp_cmt_use_dac; @@ -322,6 +323,12 @@ struct sctp_sysctl { #define SCTPCTL_ADD_MORE_ON_OUTPUT_MAX 0xFFFFFFFF #define SCTPCTL_ADD_MORE_ON_OUTPUT_DEFAULT SCTP_DEFAULT_ADD_MORE +/* incoming_streams: Default number of incoming streams */ +#define SCTPCTL_INCOMING_STREAMS_DESC "Default number of incoming streams" +#define SCTPCTL_INCOMING_STREAMS_MIN 1 +#define SCTPCTL_INCOMING_STREAMS_MAX 65535 +#define SCTPCTL_INCOMING_STREAMS_DEFAULT SCTP_ISTREAM_INITIAL + /* outgoing_streams: Default number of outgoing streams */ #define SCTPCTL_OUTGOING_STREAMS_DESC "Default number of outgoing streams" #define SCTPCTL_OUTGOING_STREAMS_MIN 1 From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 17:12:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0FE681AF for ; Sun, 7 Jul 2013 17:12:47 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ie0-f181.google.com (mail-ie0-f181.google.com [209.85.223.181]) by mx1.freebsd.org (Postfix) with ESMTP id C8D211C85 for ; Sun, 7 Jul 2013 17:12:46 +0000 (UTC) Received: by mail-ie0-f181.google.com with SMTP id x12so8501267ief.12 for ; Sun, 07 Jul 2013 10:12:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=f5KJRwtK4EF/MJZGk8R30PA7gbAbJenkocR58VGPdPo=; b=Dfufya0KBdY/HkAf1UgHWGF1J0K7S4A8NKckr1qLXIEAM7fgWWJHUCjt7cgl3ksKDv g2oxm8DGFUzeVP/R83LlFQUSawuviXO62BZwLNu0hoZ9sdue3Dwv0suYCjvuvaSy0Bun M803J+OxaPTcgbQduu3GzdjEGfN9x6HTE/eLclYIenELxnXCL6LVO+hGJxL16CfIQ0jj ToWBudRCF51M2/iIkHP78TiDH9g/fdgpO/2CzwL2k9P8Ow2INrPBe+t+Sr70axLHfqr1 XAIef0vvQH7iiD3Hzsa/UM5rlgG49ubRfLSpXqvhDmx5IXtCL9iRQ9tZeifSdbTfesH2 AoZA== X-Received: by 10.50.79.169 with SMTP id k9mr31973136igx.20.1373217160461; Sun, 07 Jul 2013 10:12:40 -0700 (PDT) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id q10sm7773075ige.4.2013.07.07.10.12.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 07 Jul 2013 10:12:39 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r252856 - head Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <201307060013.r660D8bg037291@svn.freebsd.org> Date: Sun, 7 Jul 2013 11:12:36 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201307060013.r660D8bg037291@svn.freebsd.org> To: Simon J. Gerraty X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQkF86+MHDV6EJwibvXuNT3tVl+gv0fflOUPXWMg7jMLpDlnahnpsaHRjKevIwnKFc8BXd3y Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 17:12:47 -0000 Doesn't .MAKE break the update path? Warner On Jul 5, 2013, at 6:13 PM, Simon J. Gerraty wrote: > Author: sjg > Date: Sat Jul 6 00:13:08 2013 > New Revision: 252856 > URL: http://svnweb.freebsd.org/changeset/base/252856 >=20 > Log: > Sprinkle some .MAKE magic >=20 > Modified: > head/Makefile.inc1 >=20 > Modified: head/Makefile.inc1 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/Makefile.inc1 Sat Jul 6 00:10:52 2013 = (r252855) > +++ head/Makefile.inc1 Sat Jul 6 00:13:08 2013 = (r252856) > @@ -1237,7 +1237,7 @@ _kerberos5_bootstrap_tools=3D \ > # Please document (add comment) why something is in = 'bootstrap-tools'. > # Try to bound the building of the bootstrap-tool to just the > # FreeBSD versions that need the tool built at this stage of the = build. > -bootstrap-tools: > +bootstrap-tools: .MAKE > .for _tool in \ > ${_clang_tblgen} \ > ${_kerberos5_bootstrap_tools} \ > @@ -1290,7 +1290,7 @@ _gcc_tools=3D gnu/usr.bin/cc/cc_tools > _rescue=3D rescue/rescue > .endif >=20 > -build-tools: > +build-tools: .MAKE > .for _tool in \ > bin/csh \ > bin/sh \ > @@ -1352,7 +1352,7 @@ _cc=3D gnu/usr.bin/cc > .endif > .endif >=20 > -cross-tools: > +cross-tools: .MAKE > .for _tool in \ > ${_clang_libs} \ > ${_clang} \ > @@ -1383,12 +1383,12 @@ hierarchy hier: > # interdependencies (__L) are built automatically by the > # ${.CURDIR}/tools/make_libdeps.sh script. > # > -libraries: > - cd ${.CURDIR}; \ > - ${MAKE} -f Makefile.inc1 _prereq_libs; \ > - ${MAKE} -f Makefile.inc1 _startup_libs; \ > - ${MAKE} -f Makefile.inc1 _prebuild_libs; \ > - ${MAKE} -f Makefile.inc1 _generic_libs; > +libraries: .MAKE > + cd ${.CURDIR} && \ > + ${MAKE} -f Makefile.inc1 _prereq_libs && \ > + ${MAKE} -f Makefile.inc1 _startup_libs && \ > + ${MAKE} -f Makefile.inc1 _prebuild_libs && \ > + ${MAKE} -f Makefile.inc1 _generic_libs >=20 > # > # static libgcc.a prerequisite for shared libc > @@ -1542,7 +1542,7 @@ lib/libradius__L: lib/libmd__L > .endif >=20 > .for _lib in ${_prereq_libs} > -${_lib}__PL: .PHONY > +${_lib}__PL: .PHONY .MAKE > .if exists(${.CURDIR}/${_lib}) > ${_+_}@${ECHODIR} "=3D=3D=3D> ${_lib} (obj,depend,all,install)"; = \ > cd ${.CURDIR}/${_lib} && \ > @@ -1554,7 +1554,7 @@ ${_lib}__PL: .PHONY > .endfor >=20 > .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} = ${_generic_libs} > -${_lib}__L: .PHONY > +${_lib}__L: .PHONY .MAKE > .if exists(${.CURDIR}/${_lib}) > ${_+_}@${ECHODIR} "=3D=3D=3D> ${_lib} (obj,depend,all,install)"; = \ > cd ${.CURDIR}/${_lib} && \ > @@ -1568,7 +1568,7 @@ ${_lib}__L: .PHONY > # libpam is special: we need to build static PAM modules before > # static PAM library, and dynamic PAM library before dynamic PAM > # modules. > -lib/libpam__L: .PHONY > +lib/libpam__L: .PHONY .MAKE > ${_+_}@${ECHODIR} "=3D=3D=3D> lib/libpam = (obj,depend,all,install)"; \ > cd ${.CURDIR}/lib/libpam && \ > ${MAKE} DIRPRFX=3Dlib/libpam/ obj && \ > @@ -1583,7 +1583,7 @@ _generic_libs: ${_generic_libs:S/$/__L/} >=20 > .for __target in all clean cleandepend cleandir depend includes obj > .for entry in ${SUBDIR} > -${entry}.${__target}__D: .PHONY > +${entry}.${__target}__D: .PHONY .MAKE > ${_+_}@set -e; if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; = then \ > ${ECHODIR} "=3D=3D=3D> = ${DIRPRFX}${entry}.${MACHINE_ARCH} (${__target})"; \ > edir=3D${entry}.${MACHINE_ARCH}; \ From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 17:45:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 09BDCDD8; Sun, 7 Jul 2013 17:45:59 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D56831DDC; Sun, 7 Jul 2013 17:45:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67HjwXF077313; Sun, 7 Jul 2013 17:45:58 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67Hjw9t077312; Sun, 7 Jul 2013 17:45:58 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201307071745.r67Hjw9t077312@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 7 Jul 2013 17:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r252979 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 17:45:59 -0000 Author: gavin Date: Sun Jul 7 17:45:58 2013 New Revision: 252979 URL: http://svnweb.freebsd.org/changeset/base/252979 Log: Shteryana Shopova (syrinx) has requested her commit bit be reactivated. Approved by: core Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sun Jul 7 17:08:59 2013 (r252978) +++ svnadmin/conf/access Sun Jul 7 17:45:58 2013 (r252979) @@ -193,6 +193,7 @@ smh sobomax stas stefanf +syrinx syuu takawata theraven From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 18:21:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 225081E1; Sun, 7 Jul 2013 18:21:49 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 11DC31EB7; Sun, 7 Jul 2013 18:21:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67ILmjg088750; Sun, 7 Jul 2013 18:21:48 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67ILU3U088640; Sun, 7 Jul 2013 18:21:30 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307071821.r67ILU3U088640@svn.freebsd.org> From: Devin Teske Date: Sun, 7 Jul 2013 18:21:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252980 - in head/usr.sbin/bsdconfig: . console diskmgmt docsinstall dot mouse networking networking/share packages password security share share/media share/packages startup startup/sh... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:21:49 -0000 Author: dteske Date: Sun Jul 7 18:21:30 2013 New Revision: 252980 URL: http://svnweb.freebsd.org/changeset/base/252980 Log: Be consistent with other usr.sbin programs w/respect to the copyright wording ("All rights reserved."); I had the casing wrong on many instances. Modified: head/usr.sbin/bsdconfig/USAGE head/usr.sbin/bsdconfig/console/USAGE head/usr.sbin/bsdconfig/console/console head/usr.sbin/bsdconfig/console/font head/usr.sbin/bsdconfig/console/keymap head/usr.sbin/bsdconfig/console/repeat head/usr.sbin/bsdconfig/console/saver head/usr.sbin/bsdconfig/console/screenmap head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/diskmgmt/USAGE head/usr.sbin/bsdconfig/diskmgmt/diskmgmt head/usr.sbin/bsdconfig/docsinstall/USAGE head/usr.sbin/bsdconfig/docsinstall/docsinstall head/usr.sbin/bsdconfig/dot/USAGE head/usr.sbin/bsdconfig/dot/dot head/usr.sbin/bsdconfig/mouse/USAGE head/usr.sbin/bsdconfig/mouse/disable head/usr.sbin/bsdconfig/mouse/enable head/usr.sbin/bsdconfig/mouse/flags head/usr.sbin/bsdconfig/mouse/mouse head/usr.sbin/bsdconfig/mouse/port head/usr.sbin/bsdconfig/mouse/type head/usr.sbin/bsdconfig/networking/USAGE head/usr.sbin/bsdconfig/networking/defaultrouter head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/hostname head/usr.sbin/bsdconfig/networking/nameservers head/usr.sbin/bsdconfig/networking/networking head/usr.sbin/bsdconfig/networking/share/common.subr head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/hostname.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr head/usr.sbin/bsdconfig/networking/share/media.subr head/usr.sbin/bsdconfig/networking/share/netmask.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/networking/share/routing.subr head/usr.sbin/bsdconfig/networking/share/services.subr head/usr.sbin/bsdconfig/packages/USAGE head/usr.sbin/bsdconfig/packages/packages head/usr.sbin/bsdconfig/password/USAGE head/usr.sbin/bsdconfig/password/password head/usr.sbin/bsdconfig/security/USAGE head/usr.sbin/bsdconfig/security/kern_securelevel head/usr.sbin/bsdconfig/security/security head/usr.sbin/bsdconfig/share/device.subr head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/media/any.subr head/usr.sbin/bsdconfig/share/media/cdrom.subr head/usr.sbin/bsdconfig/share/media/common.subr head/usr.sbin/bsdconfig/share/media/directory.subr head/usr.sbin/bsdconfig/share/media/dos.subr head/usr.sbin/bsdconfig/share/media/floppy.subr head/usr.sbin/bsdconfig/share/media/ftp.subr head/usr.sbin/bsdconfig/share/media/http.subr head/usr.sbin/bsdconfig/share/media/httpproxy.subr head/usr.sbin/bsdconfig/share/media/network.subr head/usr.sbin/bsdconfig/share/media/nfs.subr head/usr.sbin/bsdconfig/share/media/options.subr head/usr.sbin/bsdconfig/share/media/tcpip.subr head/usr.sbin/bsdconfig/share/media/ufs.subr head/usr.sbin/bsdconfig/share/media/usb.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/share/packages/categories.subr head/usr.sbin/bsdconfig/share/packages/index.subr head/usr.sbin/bsdconfig/share/packages/packages.subr head/usr.sbin/bsdconfig/share/script.subr head/usr.sbin/bsdconfig/share/strings.subr head/usr.sbin/bsdconfig/share/struct.subr head/usr.sbin/bsdconfig/share/variable.subr head/usr.sbin/bsdconfig/startup/USAGE head/usr.sbin/bsdconfig/startup/misc head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/startup/share/rcvar.subr head/usr.sbin/bsdconfig/startup/startup head/usr.sbin/bsdconfig/timezone/USAGE head/usr.sbin/bsdconfig/timezone/share/continents.subr head/usr.sbin/bsdconfig/timezone/share/countries.subr head/usr.sbin/bsdconfig/timezone/share/iso3166.subr head/usr.sbin/bsdconfig/timezone/share/menus.subr head/usr.sbin/bsdconfig/timezone/share/zones.subr head/usr.sbin/bsdconfig/timezone/timezone head/usr.sbin/bsdconfig/ttys/USAGE head/usr.sbin/bsdconfig/ttys/ttys head/usr.sbin/bsdconfig/usermgmt/USAGE Modified: head/usr.sbin/bsdconfig/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/USAGE Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/USAGE Sun Jul 7 18:21:30 2013 (r252980) @@ -1,6 +1,6 @@ # Copyright (c) 2012 Ron McDowell # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/console/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/console/USAGE Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/console/USAGE Sun Jul 7 18:21:30 2013 (r252980) @@ -1,5 +1,5 @@ # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/console/console ============================================================================== --- head/usr.sbin/bsdconfig/console/console Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/console/console Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/console/font ============================================================================== --- head/usr.sbin/bsdconfig/console/font Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/console/font Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/console/keymap ============================================================================== --- head/usr.sbin/bsdconfig/console/keymap Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/console/keymap Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/console/repeat ============================================================================== --- head/usr.sbin/bsdconfig/console/repeat Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/console/repeat Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/console/saver ============================================================================== --- head/usr.sbin/bsdconfig/console/saver Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/console/saver Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/console/screenmap ============================================================================== --- head/usr.sbin/bsdconfig/console/screenmap Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/console/screenmap Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/console/ttys Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/diskmgmt/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/diskmgmt/USAGE Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/diskmgmt/USAGE Sun Jul 7 18:21:30 2013 (r252980) @@ -1,5 +1,5 @@ # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/diskmgmt/diskmgmt ============================================================================== --- head/usr.sbin/bsdconfig/diskmgmt/diskmgmt Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/diskmgmt/diskmgmt Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/docsinstall/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/docsinstall/USAGE Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/docsinstall/USAGE Sun Jul 7 18:21:30 2013 (r252980) @@ -1,5 +1,5 @@ # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/docsinstall/docsinstall ============================================================================== --- head/usr.sbin/bsdconfig/docsinstall/docsinstall Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/docsinstall/docsinstall Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/dot/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/dot/USAGE Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/dot/USAGE Sun Jul 7 18:21:30 2013 (r252980) @@ -1,5 +1,5 @@ # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/dot/dot ============================================================================== --- head/usr.sbin/bsdconfig/dot/dot Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/dot/dot Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/mouse/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/mouse/USAGE Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/mouse/USAGE Sun Jul 7 18:21:30 2013 (r252980) @@ -1,5 +1,5 @@ # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/mouse/disable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/disable Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/mouse/disable Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/mouse/enable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/enable Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/mouse/enable Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/mouse/flags ============================================================================== --- head/usr.sbin/bsdconfig/mouse/flags Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/mouse/flags Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/mouse/mouse ============================================================================== --- head/usr.sbin/bsdconfig/mouse/mouse Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/mouse/mouse Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/mouse/port ============================================================================== --- head/usr.sbin/bsdconfig/mouse/port Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/mouse/port Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/mouse/type ============================================================================== --- head/usr.sbin/bsdconfig/mouse/type Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/mouse/type Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/networking/USAGE Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/USAGE Sun Jul 7 18:21:30 2013 (r252980) @@ -1,5 +1,5 @@ # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/defaultrouter ============================================================================== --- head/usr.sbin/bsdconfig/networking/defaultrouter Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/defaultrouter Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/devices Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/hostname ============================================================================== --- head/usr.sbin/bsdconfig/networking/hostname Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/hostname Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/nameservers ============================================================================== --- head/usr.sbin/bsdconfig/networking/nameservers Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/nameservers Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/networking Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/common.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/share/common.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_NETWORKING_COMMON_SUBR" ]; then _NETWORKING_COMMON_SUBR=1 # # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_NETWORKING_DEVICE_SUBR" ]; then _NETWORKING_DEVICE_SUBR=1 # # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/share/hostname.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/hostname.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/share/hostname.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_NETWORKING_HOSTNAME_SUBR" ]; then _NETWORKING_HOSTNAME_SUBR=1 # # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_NETWORKING_IPADDR_SUBR" ]; then _NETWORKING_IPADDR_SUBR=1 # # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_NETWORKING_MEDIA_SUBR" ]; then _NETWORKING_MEDIA_SUBR=1 # # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/share/netmask.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/netmask.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/share/netmask.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_NETWORKING_NETMASK_SUBR" ]; then _NETWORKING_NETMASK_SUBR=1 # # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_NETWORKING_RESOLV_SUBR" ]; then _NETWORKING_RESOLV_SUBR=1 # # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/share/routing.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/routing.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_NETWORKING_ROUTING_SUBR" ]; then _NETWORKING_ROUTING_SUBR=1 # # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/networking/share/services.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/services.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/networking/share/services.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_NETWORKING_SERVICES_SUBR" ]; then _NETWORKING_SERVICES_SUBR=1 # # Copyright (c) 2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/packages/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/packages/USAGE Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/packages/USAGE Sun Jul 7 18:21:30 2013 (r252980) @@ -1,5 +1,5 @@ # Copyright (c) 2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/packages/packages ============================================================================== --- head/usr.sbin/bsdconfig/packages/packages Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/packages/packages Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/password/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/password/USAGE Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/password/USAGE Sun Jul 7 18:21:30 2013 (r252980) @@ -1,5 +1,5 @@ # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/password/password ============================================================================== --- head/usr.sbin/bsdconfig/password/password Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/password/password Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/security/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/security/USAGE Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/security/USAGE Sun Jul 7 18:21:30 2013 (r252980) @@ -1,5 +1,5 @@ # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/security/security ============================================================================== --- head/usr.sbin/bsdconfig/security/security Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/security/security Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/device.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_DEVICE_SUBR" ]; then _DEVICE_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/dialog.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_DIALOG_SUBR" ]; then _DIALOG_SUBR=1 # # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/any.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/any.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/any.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_ANY_SUBR" ]; then _MEDIA_ANY_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/cdrom.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/cdrom.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/cdrom.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_CDROM_SUBR" ]; then _MEDIA_CDROM_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/common.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/common.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_COMMON_SUBR" ]; then _MEDIA_COMMON_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/directory.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/directory.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/directory.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_DIRECTORY_SUBR" ]; then _MEDIA_DIRECTORY_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/dos.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/dos.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/dos.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_DOS_SUBR" ]; then _MEDIA_DOS_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/floppy.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/floppy.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/floppy.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_FLOPPY_SUBR" ]; then _MEDIA_FLOPPY_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ftp.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/ftp.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_FTP_SUBR" ]; then _MEDIA_FTP_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/http.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/http.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/http.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_HTTP_SUBR" ]; then _MEDIA_HTTP_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/httpproxy.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/httpproxy.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/httpproxy.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_HTTPPROXY_SUBR" ]; then _MEDIA_HTTPPROXY_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/network.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/network.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/network.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_NETWORK_SUBR" ]; then _MEDIA_NETWORK_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/nfs.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/nfs.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/nfs.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_NFS_SUBR" ]; then _MEDIA_NFS_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/options.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/options.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/options.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_OPTIONS_SUBR" ]; then _MEDIA_OPTIONS_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/tcpip.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/tcpip.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/tcpip.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_TCPIP_SUBR" ]; then _MEDIA_TCPIP_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/ufs.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ufs.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/ufs.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_UFS_SUBR" ]; then _MEDIA_UFS_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/media/usb.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/usb.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/media/usb.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MEDIA_USB_SUBR" ]; then _MEDIA_USB_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_MUSTBEROOT_SUBR" ]; then _MUSTBEROOT_SUBR=1 # # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/packages/categories.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/categories.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/packages/categories.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_PACKAGES_CATEGORIES_SUBR" ]; then _PACKAGES_CATEGORIES_SUBR=1 # # Copyright (c) 2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_PACKAGES_INDEX_SUBR" ]; then _PACKAGES_INDEX_SUBR=1 # # Copyright (c) 2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_PACKAGES_PACKAGES_SUBR" ]; then _PACKAGES_PACKAGES_SUBR=1 # # Copyright (c) 2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/script.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/script.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_SCRIPT_SUBR" ]; then _SCRIPT_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/strings.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/strings.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/strings.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_STRINGS_SUBR" ]; then _STRINGS_SUBR=1 # # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/struct.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/struct.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/struct.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_STRUCT_SUBR" ]; then _STRUCT_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/share/variable.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/variable.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/share/variable.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_VARIABLE_SUBR" ]; then _VARIABLE_SUBR=1 # # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/startup/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/startup/USAGE Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/startup/USAGE Sun Jul 7 18:21:30 2013 (r252980) @@ -1,5 +1,5 @@ # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/startup/misc ============================================================================== --- head/usr.sbin/bsdconfig/startup/misc Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/startup/misc Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/startup/rcadd ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcadd Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/startup/rcadd Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/startup/rcconf ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcconf Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/startup/rcconf Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/startup/rcdelete Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/startup/rcvar Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/startup/share/rcconf.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcconf.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/startup/share/rcconf.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_STARTUP_RCCONF_SUBR" ]; then _STARTUP_RCCONF_SUBR=1 # # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/startup/share/rcvar.subr ============================================================================== --- head/usr.sbin/bsdconfig/startup/share/rcvar.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/startup/share/rcvar.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_STARTUP_RCVAR_SUBR" ]; then _STARTUP_RCVAR_SUBR=1 # # Copyright (c) 2006-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/startup/startup ============================================================================== --- head/usr.sbin/bsdconfig/startup/startup Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/startup/startup Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/timezone/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/timezone/USAGE Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/timezone/USAGE Sun Jul 7 18:21:30 2013 (r252980) @@ -1,5 +1,5 @@ # Copyright (c) 2011-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/timezone/share/continents.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/continents.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/timezone/share/continents.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_TIMEZONE_CONTINENTS_SUBR" ]; then _TIMEZONE_CONTINENTS_SUBR=1 # # Copyright (c) 2011-2012 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/timezone/share/countries.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/countries.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/timezone/share/countries.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_TIMEZONE_COUNTRIES_SUBR" ]; then _TIMEZONE_COUNTRIES_SUBR=1 # # Copyright (c) 2011-2012 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/timezone/share/iso3166.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/iso3166.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/timezone/share/iso3166.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_TIMEZONE_ISO3166_SUBR" ]; then _TIMEZONE_ISO3166_SUBR=1 # # Copyright (c) 2011-2012 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/timezone/share/menus.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/menus.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/timezone/share/menus.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_TIMEZONE_MENUS_SUBR" ]; then _TIMEZONE_MENUS_SUBR=1 # # Copyright (c) 2011-2012 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/timezone/share/zones.subr ============================================================================== --- head/usr.sbin/bsdconfig/timezone/share/zones.subr Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/timezone/share/zones.subr Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ if [ ! "$_TIMEZONE_ZONES_SUBR" ]; then _TIMEZONE_ZONES_SUBR=1 # # Copyright (c) 2011-2012 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/timezone/timezone ============================================================================== --- head/usr.sbin/bsdconfig/timezone/timezone Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/timezone/timezone Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/ttys/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/ttys/USAGE Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/ttys/USAGE Sun Jul 7 18:21:30 2013 (r252980) @@ -1,5 +1,5 @@ # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/ttys/ttys ============================================================================== --- head/usr.sbin/bsdconfig/ttys/ttys Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/ttys/ttys Sun Jul 7 18:21:30 2013 (r252980) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions Modified: head/usr.sbin/bsdconfig/usermgmt/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/USAGE Sun Jul 7 17:45:58 2013 (r252979) +++ head/usr.sbin/bsdconfig/usermgmt/USAGE Sun Jul 7 18:21:30 2013 (r252980) @@ -1,5 +1,5 @@ # Copyright (c) 2012-2013 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 18:31:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5E1A35F5; Sun, 7 Jul 2013 18:31:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5015D1F2A; Sun, 7 Jul 2013 18:31:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67IV2jl091539; Sun, 7 Jul 2013 18:31:02 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67IV2TH091537; Sun, 7 Jul 2013 18:31:02 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071831.r67IV2TH091537@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252981 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:31:03 -0000 Author: tuexen Date: Sun Jul 7 18:31:02 2013 New Revision: 252981 URL: http://svnweb.freebsd.org/changeset/base/252981 Log: MFC r248172 (partially): Return an error if sctp_peeloff() fails because a socket can't be allocated. Modified: stable/8/sys/kern/uipc_syscalls.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/uipc_syscalls.c ============================================================================== --- stable/8/sys/kern/uipc_syscalls.c Sun Jul 7 18:21:30 2013 (r252980) +++ stable/8/sys/kern/uipc_syscalls.c Sun Jul 7 18:31:02 2013 (r252981) @@ -2320,8 +2320,10 @@ sctp_peeloff(td, uap) CURVNET_SET(head->so_vnet); so = sonewconn(head, SS_ISCONNECTED); - if (so == NULL) + if (so == NULL) { + error = ENOMEM; goto noconnection; + } /* * Before changing the flags on the socket, we have to bump the * reference count. Otherwise, if the protocol calls sofree(), From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 18:34:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1E3757C4; Sun, 7 Jul 2013 18:34:37 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 10C891F5A; Sun, 7 Jul 2013 18:34:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67IYabk092029; Sun, 7 Jul 2013 18:34:36 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67IYaPE092028; Sun, 7 Jul 2013 18:34:36 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307071834.r67IYaPE092028@svn.freebsd.org> From: Devin Teske Date: Sun, 7 Jul 2013 18:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252982 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:34:37 -0000 Author: dteske Date: Sun Jul 7 18:34:36 2013 New Revision: 252982 URL: http://svnweb.freebsd.org/changeset/base/252982 Log: Be consistent with other usr.sbin programs w/respect to the copyright wording ("All rights reserved."); I had the casing wrong on many instances. Modified: head/usr.sbin/bsdconfig/share/sysrc.subr Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Sun Jul 7 18:31:02 2013 (r252981) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Sun Jul 7 18:34:36 2013 (r252982) @@ -1,7 +1,7 @@ if [ ! "$_SYSRC_SUBR" ]; then _SYSRC_SUBR=1 # # Copyright (c) 2006-2012 Devin Teske -# All Rights Reserved. +# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 18:41:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6E770AED; Sun, 7 Jul 2013 18:41:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 606F81FBA; Sun, 7 Jul 2013 18:41:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67IfQjF094460; Sun, 7 Jul 2013 18:41:26 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67IfQgm094459; Sun, 7 Jul 2013 18:41:26 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071841.r67IfQgm094459@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252983 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:41:26 -0000 Author: tuexen Date: Sun Jul 7 18:41:25 2013 New Revision: 252983 URL: http://svnweb.freebsd.org/changeset/base/252983 Log: MFC r248953: Add a macro for checking for IPv4 link local addresses. Modified: stable/8/sys/netinet/sctp_constants.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Sun Jul 7 18:34:36 2013 (r252982) +++ stable/8/sys/netinet/sctp_constants.h Sun Jul 7 18:41:25 2013 (r252983) @@ -997,6 +997,10 @@ __FBSDID("$FreeBSD$"); (((uint8_t *)&(a)->s_addr)[2] == 0) && \ (((uint8_t *)&(a)->s_addr)[3] == 1)) +#define IN4_ISLINKLOCAL_ADDRESS(a) \ + ((((uint8_t *)&(a)->s_addr)[0] == 169) && \ + (((uint8_t *)&(a)->s_addr)[1] == 254)) + #if defined(_KERNEL) #define SCTP_GETTIME_TIMEVAL(x) (getmicrouptime(x)) From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 18:43:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3F36ACD0; Sun, 7 Jul 2013 18:43:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1FFA71FE2; Sun, 7 Jul 2013 18:43:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67IhnYP094751; Sun, 7 Jul 2013 18:43:49 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67Ihn1Z094750; Sun, 7 Jul 2013 18:43:49 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071843.r67Ihn1Z094750@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252984 - stable/8/lib/libc/net X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:43:49 -0000 Author: tuexen Date: Sun Jul 7 18:43:48 2013 New Revision: 252984 URL: http://svnweb.freebsd.org/changeset/base/252984 Log: MFC r249333: Remove the number of addresses restriction from sctp_connectx(). Remove unused code. While there, do some cleanup of the code. Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Sun Jul 7 18:41:25 2013 (r252983) +++ stable/8/lib/libc/net/sctp_sys_calls.c Sun Jul 7 18:43:48 2013 (r252984) @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #ifndef IN6_IS_ADDR_V4MAPPED #define IN6_IS_ADDR_V4MAPPED(a) \ ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ @@ -57,77 +55,8 @@ __FBSDID("$FreeBSD$"); (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) #endif - -#define SCTP_CONTROL_VEC_SIZE_SND 8192 #define SCTP_CONTROL_VEC_SIZE_RCV 16384 -#define SCTP_STACK_BUF_SIZE 2048 - -#ifdef SCTP_DEBUG_PRINT_ADDRESS - -#define SCTP_STRING_BUF_SZ 256 - -static void -SCTPPrintAnAddress(struct sockaddr *a) -{ - char stringToPrint[SCTP_STRING_BUF_SZ]; - u_short prt; - char *srcaddr, *txt; - - if (a == NULL) { - printf("NULL\n"); - return; - } - if (a->sa_family == AF_INET) { - srcaddr = (char *)&((struct sockaddr_in *)a)->sin_addr; - txt = "IPv4 Address: "; - prt = ntohs(((struct sockaddr_in *)a)->sin_port); - } else if (a->sa_family == AF_INET6) { - srcaddr = (char *)&((struct sockaddr_in6 *)a)->sin6_addr; - prt = ntohs(((struct sockaddr_in6 *)a)->sin6_port); - txt = "IPv6 Address: "; - } else if (a->sa_family == AF_LINK) { - int i; - char tbuf[SCTP_STRING_BUF_SZ]; - u_char adbuf[SCTP_STRING_BUF_SZ]; - struct sockaddr_dl *dl; - - dl = (struct sockaddr_dl *)a; - strncpy(tbuf, dl->sdl_data, dl->sdl_nlen); - tbuf[dl->sdl_nlen] = 0; - printf("Intf:%s (len:%d)Interface index:%d type:%x(%d) ll-len:%d ", - tbuf, - dl->sdl_nlen, - dl->sdl_index, - dl->sdl_type, - dl->sdl_type, - dl->sdl_alen - ); - memcpy(adbuf, LLADDR(dl), dl->sdl_alen); - for (i = 0; i < dl->sdl_alen; i++) { - printf("%2.2x", adbuf[i]); - if (i < (dl->sdl_alen - 1)) - printf(":"); - } - printf("\n"); - return; - } else { - return; - } - if (inet_ntop(a->sa_family, srcaddr, stringToPrint, sizeof(stringToPrint))) { - if (a->sa_family == AF_INET6) { - printf("%s%s:%d scope:%d\n", - txt, stringToPrint, prt, - ((struct sockaddr_in6 *)a)->sin6_scope_id); - } else { - printf("%s%s:%d\n", txt, stringToPrint, prt); - } - - } else { - printf("%s unprintable?\n", txt); - } -} -#endif /* SCTP_DEBUG_PRINT_ADDRESS */ static void in6_sin6_2_sin(struct sockaddr_in *sin, struct sockaddr_in6 *sin6) @@ -171,11 +100,10 @@ int sctp_connectx(int sd, const struct sockaddr *addrs, int addrcnt, sctp_assoc_t * id) { - char buf[SCTP_STACK_BUF_SIZE]; + char *buf; int i, ret, cnt, *aa; char *cpto; const struct sockaddr *at; - sctp_assoc_t *p_id; size_t len = sizeof(int); /* validate the address count and list */ @@ -183,24 +111,29 @@ sctp_connectx(int sd, const struct socka errno = EINVAL; return (-1); } + if ((buf = malloc(sizeof(int) + (size_t)addrcnt * sizeof(struct sockaddr_in6))) == NULL) { + errno = E2BIG; + return (-1); + } at = addrs; cnt = 0; - cpto = ((caddr_t)buf + sizeof(int)); + cpto = buf + sizeof(int); /* validate all the addresses and get the size */ for (i = 0; i < addrcnt; i++) { switch (at->sa_family) { case AF_INET: if (at->sa_len != sizeof(struct sockaddr_in)) { + free(buf); errno = EINVAL; return (-1); } memcpy(cpto, at, sizeof(struct sockaddr_in)); cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in)); len += sizeof(struct sockaddr_in); - at = (struct sockaddr *)((caddr_t)at + sizeof(struct sockaddr_in)); break; case AF_INET6: if (at->sa_len != sizeof(struct sockaddr_in6)) { + free(buf); errno = EINVAL; return (-1); } @@ -213,31 +146,20 @@ sctp_connectx(int sd, const struct socka cpto = ((caddr_t)cpto + sizeof(struct sockaddr_in6)); len += sizeof(struct sockaddr_in6); } - at = (struct sockaddr *)((caddr_t)at + sizeof(struct sockaddr_in6)); break; default: + free(buf); errno = EINVAL; return (-1); } - if (len > (sizeof(buf) - sizeof(int))) { - /* Never enough memory */ - errno = E2BIG; - return (-1); - } - cnt++; - } - /* do we have any? */ - if (cnt == 0) { - errno = EINVAL; - return (-1); + at = (struct sockaddr *)((caddr_t)at + at->sa_len); } aa = (int *)buf; - *aa = cnt; + *aa = addrcnt; ret = setsockopt(sd, IPPROTO_SCTP, SCTP_CONNECT_X, (void *)buf, (socklen_t) len); - if ((ret == 0) && id) { - p_id = (sctp_assoc_t *) buf; - *id = *p_id; + if ((ret == 0) && (id != NULL)) { + *id = *(sctp_assoc_t *) buf; } return (ret); } @@ -345,7 +267,6 @@ sctp_bindx(int sd, struct sockaddr *addr return (0); } - int sctp_opt_info(int sd, sctp_assoc_t id, int opt, void *arg, socklen_t * size) { @@ -468,9 +389,9 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, void sctp_freepaddrs(struct sockaddr *addrs) { - /* Take away the hidden association id */ void *fr_addr; + /* Take away the hidden association id */ fr_addr = (void *)((caddr_t)addrs - sizeof(sctp_assoc_t)); /* Now free it */ free(fr_addr); @@ -531,15 +452,14 @@ sctp_getladdrs(int sd, sctp_assoc_t id, void sctp_freeladdrs(struct sockaddr *addrs) { - /* Take away the hidden association id */ void *fr_addr; + /* Take away the hidden association id */ fr_addr = (void *)((caddr_t)addrs - sizeof(sctp_assoc_t)); /* Now free it */ free(fr_addr); } - ssize_t sctp_sendmsg(int s, const void *data, @@ -565,11 +485,10 @@ sctp_sendmsg(int s, return (syscall(SYS_sctp_generic_sendmsg, s, data, len, to, tolen, &sinfo, 0)); #else - ssize_t sz; struct msghdr msg; - struct sctp_sndrcvinfo *s_info; + struct sctp_sndrcvinfo *sinfo; struct iovec iov; - char controlVector[SCTP_CONTROL_VEC_SIZE_RCV]; + char cmsgbuf[CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))]; struct cmsghdr *cmsg; struct sockaddr *who = NULL; union { @@ -582,8 +501,9 @@ sctp_sendmsg(int s, errno = EINVAL; return (-1); } - if (to && (tolen > 0)) { - if (to->sa_family == AF_INET) { + if ((to != NULL) && (tolen > 0)) { + switch (to->sa_family) { + case AF_INET: if (tolen != sizeof(struct sockaddr_in)) { errno = EINVAL; return (-1); @@ -595,7 +515,8 @@ sctp_sendmsg(int s, } memcpy(&addr, to, sizeof(struct sockaddr_in)); addr.in.sin_len = sizeof(struct sockaddr_in); - } else if (to->sa_family == AF_INET6) { + break; + case AF_INET6: if (tolen != sizeof(struct sockaddr_in6)) { errno = EINVAL; return (-1); @@ -607,7 +528,8 @@ sctp_sendmsg(int s, } memcpy(&addr, to, sizeof(struct sockaddr_in6)); addr.in6.sin6_len = sizeof(struct sockaddr_in6); - } else { + break; + default: errno = EAFNOSUPPORT; return (-1); } @@ -625,26 +547,21 @@ sctp_sendmsg(int s, } msg.msg_iov = &iov; msg.msg_iovlen = 1; - msg.msg_control = (caddr_t)controlVector; - - cmsg = (struct cmsghdr *)controlVector; - + msg.msg_control = cmsgbuf; + msg.msg_controllen = CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + cmsg = (struct cmsghdr *)cmsgbuf; cmsg->cmsg_level = IPPROTO_SCTP; cmsg->cmsg_type = SCTP_SNDRCV; cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); - s_info = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); - - s_info->sinfo_stream = stream_no; - s_info->sinfo_ssn = 0; - s_info->sinfo_flags = flags; - s_info->sinfo_ppid = ppid; - s_info->sinfo_context = context; - s_info->sinfo_assoc_id = 0; - s_info->sinfo_timetolive = timetolive; - errno = 0; - msg.msg_controllen = cmsg->cmsg_len; - sz = sendmsg(s, &msg, 0); - return (sz); + sinfo = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); + sinfo->sinfo_stream = stream_no; + sinfo->sinfo_ssn = 0; + sinfo->sinfo_flags = flags; + sinfo->sinfo_ppid = ppid; + sinfo->sinfo_context = context; + sinfo->sinfo_assoc_id = 0; + sinfo->sinfo_timetolive = timetolive; + return (sendmsg(s, &msg, 0)); #endif } @@ -659,12 +576,11 @@ sctp_getassocid(int sd, struct sockaddr siz = sizeof(sp); memset(&sp, 0, sizeof(sp)); memcpy((caddr_t)&sp.spinfo_address, sa, sa->sa_len); - errno = 0; if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_PEER_ADDR_INFO, &sp, &siz) != 0) { + /* We depend on the fact that 0 can never be returned */ return ((sctp_assoc_t) 0); } - /* We depend on the fact that 0 can never be returned */ return (sp.spinfo_assoc_id); } @@ -680,11 +596,9 @@ sctp_send(int sd, const void *data, size return (syscall(SYS_sctp_generic_sendmsg, sd, data, len, to, 0, sinfo, flags)); #else - ssize_t sz; struct msghdr msg; struct iovec iov; - struct sctp_sndrcvinfo *s_info; - char controlVector[SCTP_CONTROL_VEC_SIZE_SND]; + char cmsgbuf[CMSG_SPACE(sizeof(struct sctp_sndrcvinfo))]; struct cmsghdr *cmsg; if (sinfo == NULL) { @@ -694,24 +608,18 @@ sctp_send(int sd, const void *data, size iov.iov_base = (char *)data; iov.iov_len = len; - msg.msg_name = 0; + msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_iov = &iov; msg.msg_iovlen = 1; - msg.msg_control = (caddr_t)controlVector; - - cmsg = (struct cmsghdr *)controlVector; - + msg.msg_control = cmsgbuf; + msg.msg_controllen = CMSG_SPACE(sizeof(struct sctp_sndrcvinfo)); + cmsg = (struct cmsghdr *)cmsgbuf; cmsg->cmsg_level = IPPROTO_SCTP; cmsg->cmsg_type = SCTP_SNDRCV; cmsg->cmsg_len = CMSG_LEN(sizeof(struct sctp_sndrcvinfo)); - s_info = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); - /* copy in the data */ - *s_info = *sinfo; - errno = 0; - msg.msg_controllen = cmsg->cmsg_len; - sz = sendmsg(sd, &msg, flags); - return (sz); + memcpy(CMSG_DATA(cmsg), sinfo, sizeof(struct sctp_sndrcvinfo)); + return (sendmsg(sd, &msg, flags)); #endif } @@ -853,11 +761,10 @@ sctp_recvmsg(int s, return (syscall(SYS_sctp_generic_recvmsg, s, &iov, 1, from, fromlen, sinfo, msg_flags)); #else - struct sctp_sndrcvinfo *s_info; ssize_t sz; struct msghdr msg; struct iovec iov; - char controlVector[SCTP_CONTROL_VEC_SIZE_RCV]; + char cmsgbuf[SCTP_CONTROL_VEC_SIZE_RCV]; struct cmsghdr *cmsg; if (msg_flags == NULL) { @@ -874,52 +781,38 @@ sctp_recvmsg(int s, msg.msg_namelen = *fromlen; msg.msg_iov = &iov; msg.msg_iovlen = 1; - msg.msg_control = (caddr_t)controlVector; - msg.msg_controllen = sizeof(controlVector); - errno = 0; + msg.msg_control = cmsgbuf; + msg.msg_controllen = sizeof(cmsgbuf); sz = recvmsg(s, &msg, *msg_flags); *msg_flags = msg.msg_flags; if (sz <= 0) { return (sz); } - s_info = NULL; if (sinfo) { sinfo->sinfo_assoc_id = 0; } - if ((msg.msg_controllen) && sinfo) { + if ((msg.msg_controllen > 0) && (sinfo != NULL)) { /* * parse through and see if we find the sctp_sndrcvinfo (if * the user wants it). */ - cmsg = (struct cmsghdr *)controlVector; - while (cmsg) { - if ((cmsg->cmsg_len == 0) || (cmsg->cmsg_len > msg.msg_controllen)) { + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_level != IPPROTO_SCTP) { + continue; + } + if (cmsg->cmsg_type == SCTP_SNDRCV) { + memcpy(sinfo, CMSG_DATA(cmsg), sizeof(struct sctp_sndrcvinfo)); break; } - if (cmsg->cmsg_level == IPPROTO_SCTP) { - if (cmsg->cmsg_type == SCTP_SNDRCV) { - /* Got it */ - s_info = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); - /* Copy it to the user */ - if (sinfo) - *sinfo = *s_info; - break; - } else if (cmsg->cmsg_type == SCTP_EXTRCV) { - /* - * Got it, presumably the user has - * asked for this extra info, so the - * structure holds more room :-D - */ - s_info = (struct sctp_sndrcvinfo *)CMSG_DATA(cmsg); - /* Copy it to the user */ - if (sinfo) { - memcpy(sinfo, s_info, sizeof(struct sctp_extrcvinfo)); - } - break; - - } + if (cmsg->cmsg_type == SCTP_EXTRCV) { + /* + * Let's hope that the user provided enough + * enough memory. At least he asked for more + * information. + */ + memcpy(sinfo, CMSG_DATA(cmsg), sizeof(struct sctp_extrcvinfo)); + break; } - cmsg = CMSG_NXTHDR(&msg, cmsg); } } return (sz); @@ -937,10 +830,10 @@ sctp_recvv(int sd, unsigned int *infotype, int *flags) { - char ctlbuf[SCTP_CONTROL_VEC_SIZE_RCV]; + char cmsgbuf[SCTP_CONTROL_VEC_SIZE_RCV]; struct msghdr msg; struct cmsghdr *cmsg; - ssize_t n; + ssize_t ret; struct sctp_rcvinfo *rcvinfo; struct sctp_nxtinfo *nxtinfo; @@ -961,12 +854,11 @@ sctp_recvv(int sd, } msg.msg_iov = (struct iovec *)iov; msg.msg_iovlen = iovlen; - msg.msg_control = ctlbuf; - msg.msg_controllen = sizeof(ctlbuf); - errno = 0; - n = recvmsg(sd, &msg, *flags); + msg.msg_control = cmsgbuf; + msg.msg_controllen = sizeof(cmsgbuf); + ret = recvmsg(sd, &msg, *flags); *flags = msg.msg_flags; - if ((n > 0) && + if ((ret > 0) && (msg.msg_controllen > 0) && (infotype != NULL) && (infolen != NULL) && @@ -979,41 +871,44 @@ sctp_recvv(int sd, } if (cmsg->cmsg_type == SCTP_RCVINFO) { rcvinfo = (struct sctp_rcvinfo *)CMSG_DATA(cmsg); + if (nxtinfo != NULL) { + break; + } else { + continue; + } } if (cmsg->cmsg_type == SCTP_NXTINFO) { nxtinfo = (struct sctp_nxtinfo *)CMSG_DATA(cmsg); - } - if (rcvinfo && nxtinfo) { - break; + if (rcvinfo != NULL) { + break; + } else { + continue; + } } } - if (rcvinfo) { - if (nxtinfo) { - if (*infolen >= sizeof(struct sctp_recvv_rn)) { - struct sctp_recvv_rn *rn_info; - - rn_info = (struct sctp_recvv_rn *)info; - rn_info->recvv_rcvinfo = *rcvinfo; - rn_info->recvv_nxtinfo = *nxtinfo; - *infolen = (socklen_t) sizeof(struct sctp_recvv_rn); - *infotype = SCTP_RECVV_RN; - } - } else { - if (*infolen >= sizeof(struct sctp_rcvinfo)) { - memcpy(info, rcvinfo, sizeof(struct sctp_rcvinfo)); - *infolen = (socklen_t) sizeof(struct sctp_rcvinfo); - *infotype = SCTP_RECVV_RCVINFO; - } + if (rcvinfo != NULL) { + if ((nxtinfo != NULL) && (*infolen >= sizeof(struct sctp_recvv_rn))) { + struct sctp_recvv_rn *rn_info; + + rn_info = (struct sctp_recvv_rn *)info; + rn_info->recvv_rcvinfo = *rcvinfo; + rn_info->recvv_nxtinfo = *nxtinfo; + *infolen = (socklen_t) sizeof(struct sctp_recvv_rn); + *infotype = SCTP_RECVV_RN; + } else if (*infolen >= sizeof(struct sctp_rcvinfo)) { + memcpy(info, rcvinfo, sizeof(struct sctp_rcvinfo)); + *infolen = (socklen_t) sizeof(struct sctp_rcvinfo); + *infotype = SCTP_RECVV_RCVINFO; } - } else if (nxtinfo) { - if (*infolen >= sizeof(struct sctp_rcvinfo)) { + } else if (nxtinfo != NULL) { + if (*infolen >= sizeof(struct sctp_nxtinfo)) { memcpy(info, nxtinfo, sizeof(struct sctp_nxtinfo)); *infolen = (socklen_t) sizeof(struct sctp_nxtinfo); *infotype = SCTP_RECVV_NXTINFO; } } } - return (n); + return (ret); } ssize_t @@ -1238,7 +1133,4 @@ sctp_peeloff(int sd, sctp_assoc_t assoc_ #endif - -#undef SCTP_CONTROL_VEC_SIZE_SND #undef SCTP_CONTROL_VEC_SIZE_RCV -#undef SCTP_STACK_BUF_SIZE From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 18:48:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DBB0DECB; Sun, 7 Jul 2013 18:48:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B380E1011; Sun, 7 Jul 2013 18:48:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67ImLgU095439; Sun, 7 Jul 2013 18:48:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67ImLXT095437; Sun, 7 Jul 2013 18:48:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071848.r67ImLXT095437@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252985 - in stable/8/sys: netinet netinet6 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:48:21 -0000 Author: tuexen Date: Sun Jul 7 18:48:21 2013 New Revision: 252985 URL: http://svnweb.freebsd.org/changeset/base/252985 Log: MFC r250466: Honor the net.inet6.ip6.v6only sysctl variable and the IPV6_V6ONLY socket option for SCTP sockets in the same way as for UDP or TCP sockets. Modified: stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Sun Jul 7 18:43:48 2013 (r252984) +++ stable/8/sys/netinet/sctp_pcb.c Sun Jul 7 18:48:21 2013 (r252985) @@ -2376,8 +2376,13 @@ sctp_inpcb_alloc(struct socket *so, uint inp->sctp_socket = so; inp->ip_inp.inp.inp_socket = so; #ifdef INET6 - if (MODULE_GLOBAL(ip6_auto_flowlabel)) { - inp->ip_inp.inp.inp_flags |= IN6P_AUTOFLOWLABEL; + if (INP_SOCKAF(so) == AF_INET6) { + if (MODULE_GLOBAL(ip6_auto_flowlabel)) { + inp->ip_inp.inp.inp_flags |= IN6P_AUTOFLOWLABEL; + } + if (MODULE_GLOBAL(ip6_v6only)) { + inp->ip_inp.inp.inp_flags |= IN6P_IPV6_V6ONLY; + } } #endif inp->sctp_associd_counter = 1; Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Sun Jul 7 18:43:48 2013 (r252984) +++ stable/8/sys/netinet6/sctp6_usrreq.c Sun Jul 7 18:48:21 2013 (r252985) @@ -787,18 +787,11 @@ sctp6_send(struct socket *so, int flags, } } if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - if (!MODULE_GLOBAL(ip6_v6only)) { - struct sockaddr_in sin; + struct sockaddr_in sin; - /* convert v4-mapped into v4 addr and send */ - in6_sin6_2_sin(&sin, sin6); - return (sctp_sendm(so, flags, m, (struct sockaddr *)&sin, - control, p)); - } else { - /* mapped addresses aren't enabled */ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); - return (EINVAL); - } + /* convert v4-mapped into v4 addr and send */ + in6_sin6_2_sin(&sin, sin6); + return (sctp_sendm(so, flags, m, (struct sockaddr *)&sin, control, p)); } #endif /* INET */ connected_type: @@ -932,17 +925,9 @@ sctp6_connect(struct socket *so, struct } } if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - if (!MODULE_GLOBAL(ip6_v6only)) { - /* convert v4-mapped into v4 addr */ - in6_sin6_2_sin((struct sockaddr_in *)&ss, sin6); - addr = (struct sockaddr *)&ss; - } else { - /* mapped addresses aren't enabled */ - SCTP_INP_RUNLOCK(inp); - SCTP_ASOC_CREATE_UNLOCK(inp); - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); - return (EINVAL); - } + /* convert v4-mapped into v4 addr */ + in6_sin6_2_sin((struct sockaddr_in *)&ss, sin6); + addr = (struct sockaddr *)&ss; } #endif /* INET */ /* Now do we connect? */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 18:50:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B0B7A7B; Sun, 7 Jul 2013 18:50:26 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A32B31029; Sun, 7 Jul 2013 18:50:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67IoQF3097251; Sun, 7 Jul 2013 18:50:26 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67IoQRq097250; Sun, 7 Jul 2013 18:50:26 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071850.r67IoQRq097250@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:50:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252986 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:50:26 -0000 Author: tuexen Date: Sun Jul 7 18:50:26 2013 New Revision: 252986 URL: http://svnweb.freebsd.org/changeset/base/252986 Log: MFC r250754: Don't send an ABORT chunk with verification 0. Modified: stable/8/sys/netinet/sctp_output.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Sun Jul 7 18:48:21 2013 (r252985) +++ stable/8/sys/netinet/sctp_output.c Sun Jul 7 18:50:26 2013 (r252986) @@ -10673,6 +10673,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stc struct sctp_abort_chunk *abort; struct sctp_auth_chunk *auth = NULL; struct sctp_nets *net; + uint32_t vtag; uint32_t auth_offset = 0; uint16_t cause_len, chunk_len, padding_len; @@ -10728,7 +10729,14 @@ sctp_send_abort_tcb(struct sctp_tcb *stc /* Fill in the ABORT chunk header. */ abort = mtod(m_abort, struct sctp_abort_chunk *); abort->ch.chunk_type = SCTP_ABORT_ASSOCIATION; - abort->ch.chunk_flags = 0; + if (stcb->asoc.peer_vtag == 0) { + /* This happens iff the assoc is in COOKIE-WAIT state. */ + vtag = stcb->asoc.my_vtag; + abort->ch.chunk_flags = SCTP_HAD_NO_TCB; + } else { + vtag = stcb->asoc.peer_vtag; + abort->ch.chunk_flags = 0; + } abort->ch.chunk_length = htons(chunk_len); /* Add padding, if necessary. */ if (padding_len > 0) { @@ -10740,7 +10748,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stc (void)sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, (struct sockaddr *)&net->ro._l_addr, m_out, auth_offset, auth, stcb->asoc.authinfo.active_keyid, 1, 0, 0, - stcb->sctp_ep->sctp_lport, stcb->rport, htonl(stcb->asoc.peer_vtag), + stcb->sctp_ep->sctp_lport, stcb->rport, htonl(vtag), stcb->asoc.primary_destination->port, NULL, 0, 0, so_locked); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 18:51:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8445A391; Sun, 7 Jul 2013 18:51:57 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 735A81050; Sun, 7 Jul 2013 18:51:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67IpvJf097663; Sun, 7 Jul 2013 18:51:57 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67Ipimp097582; Sun, 7 Jul 2013 18:51:44 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307071851.r67Ipimp097582@svn.freebsd.org> From: Devin Teske Date: Sun, 7 Jul 2013 18:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252987 - in head/usr.sbin: bsdconfig bsdconfig/console bsdconfig/diskmgmt bsdconfig/docsinstall bsdconfig/dot bsdconfig/mouse bsdconfig/networking bsdconfig/networking/share bsdconfig/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:51:57 -0000 Author: dteske Date: Sun Jul 7 18:51:44 2013 New Revision: 252987 URL: http://svnweb.freebsd.org/changeset/base/252987 Log: Fix typos in the BSD License. Modified: head/usr.sbin/bsdconfig/USAGE head/usr.sbin/bsdconfig/console/USAGE head/usr.sbin/bsdconfig/console/console head/usr.sbin/bsdconfig/console/font head/usr.sbin/bsdconfig/console/keymap head/usr.sbin/bsdconfig/console/repeat head/usr.sbin/bsdconfig/console/saver head/usr.sbin/bsdconfig/console/screenmap head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/diskmgmt/USAGE head/usr.sbin/bsdconfig/diskmgmt/diskmgmt head/usr.sbin/bsdconfig/docsinstall/USAGE head/usr.sbin/bsdconfig/docsinstall/docsinstall head/usr.sbin/bsdconfig/dot/USAGE head/usr.sbin/bsdconfig/dot/dot head/usr.sbin/bsdconfig/mouse/USAGE head/usr.sbin/bsdconfig/mouse/disable head/usr.sbin/bsdconfig/mouse/enable head/usr.sbin/bsdconfig/mouse/flags head/usr.sbin/bsdconfig/mouse/mouse head/usr.sbin/bsdconfig/mouse/port head/usr.sbin/bsdconfig/mouse/type head/usr.sbin/bsdconfig/networking/USAGE head/usr.sbin/bsdconfig/networking/defaultrouter head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/hostname head/usr.sbin/bsdconfig/networking/nameservers head/usr.sbin/bsdconfig/networking/networking head/usr.sbin/bsdconfig/networking/share/common.subr head/usr.sbin/bsdconfig/networking/share/device.subr head/usr.sbin/bsdconfig/networking/share/hostname.subr head/usr.sbin/bsdconfig/networking/share/ipaddr.subr head/usr.sbin/bsdconfig/networking/share/media.subr head/usr.sbin/bsdconfig/networking/share/netmask.subr head/usr.sbin/bsdconfig/networking/share/resolv.subr head/usr.sbin/bsdconfig/networking/share/routing.subr head/usr.sbin/bsdconfig/networking/share/services.subr head/usr.sbin/bsdconfig/packages/USAGE head/usr.sbin/bsdconfig/packages/packages head/usr.sbin/bsdconfig/password/USAGE head/usr.sbin/bsdconfig/password/password head/usr.sbin/bsdconfig/security/USAGE head/usr.sbin/bsdconfig/security/kern_securelevel head/usr.sbin/bsdconfig/security/security head/usr.sbin/bsdconfig/share/device.subr head/usr.sbin/bsdconfig/share/dialog.subr head/usr.sbin/bsdconfig/share/media/any.subr head/usr.sbin/bsdconfig/share/media/cdrom.subr head/usr.sbin/bsdconfig/share/media/common.subr head/usr.sbin/bsdconfig/share/media/directory.subr head/usr.sbin/bsdconfig/share/media/dos.subr head/usr.sbin/bsdconfig/share/media/floppy.subr head/usr.sbin/bsdconfig/share/media/ftp.subr head/usr.sbin/bsdconfig/share/media/http.subr head/usr.sbin/bsdconfig/share/media/httpproxy.subr head/usr.sbin/bsdconfig/share/media/network.subr head/usr.sbin/bsdconfig/share/media/nfs.subr head/usr.sbin/bsdconfig/share/media/options.subr head/usr.sbin/bsdconfig/share/media/tcpip.subr head/usr.sbin/bsdconfig/share/media/ufs.subr head/usr.sbin/bsdconfig/share/media/usb.subr head/usr.sbin/bsdconfig/share/mustberoot.subr head/usr.sbin/bsdconfig/share/packages/categories.subr head/usr.sbin/bsdconfig/share/packages/index.subr head/usr.sbin/bsdconfig/share/packages/packages.subr head/usr.sbin/bsdconfig/share/script.subr head/usr.sbin/bsdconfig/share/strings.subr head/usr.sbin/bsdconfig/share/struct.subr head/usr.sbin/bsdconfig/share/sysrc.subr head/usr.sbin/bsdconfig/share/variable.subr head/usr.sbin/bsdconfig/startup/USAGE head/usr.sbin/bsdconfig/startup/misc head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/share/rcconf.subr head/usr.sbin/bsdconfig/startup/share/rcvar.subr head/usr.sbin/bsdconfig/startup/startup head/usr.sbin/bsdconfig/timezone/USAGE head/usr.sbin/bsdconfig/timezone/share/continents.subr head/usr.sbin/bsdconfig/timezone/share/countries.subr head/usr.sbin/bsdconfig/timezone/share/iso3166.subr head/usr.sbin/bsdconfig/timezone/share/menus.subr head/usr.sbin/bsdconfig/timezone/share/zones.subr head/usr.sbin/bsdconfig/timezone/timezone head/usr.sbin/bsdconfig/ttys/USAGE head/usr.sbin/bsdconfig/ttys/ttys head/usr.sbin/bsdconfig/usermgmt/USAGE head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/bsdconfig/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/USAGE Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/USAGE Sun Jul 7 18:51:44 2013 (r252987) @@ -12,11 +12,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/console/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/console/USAGE Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/console/USAGE Sun Jul 7 18:51:44 2013 (r252987) @@ -11,11 +11,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/console/console ============================================================================== --- head/usr.sbin/bsdconfig/console/console Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/console/console Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/console/font ============================================================================== --- head/usr.sbin/bsdconfig/console/font Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/console/font Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/console/keymap ============================================================================== --- head/usr.sbin/bsdconfig/console/keymap Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/console/keymap Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/console/repeat ============================================================================== --- head/usr.sbin/bsdconfig/console/repeat Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/console/repeat Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/console/saver ============================================================================== --- head/usr.sbin/bsdconfig/console/saver Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/console/saver Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/console/screenmap ============================================================================== --- head/usr.sbin/bsdconfig/console/screenmap Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/console/screenmap Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/console/ttys Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/diskmgmt/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/diskmgmt/USAGE Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/diskmgmt/USAGE Sun Jul 7 18:51:44 2013 (r252987) @@ -11,11 +11,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/diskmgmt/diskmgmt ============================================================================== --- head/usr.sbin/bsdconfig/diskmgmt/diskmgmt Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/diskmgmt/diskmgmt Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/docsinstall/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/docsinstall/USAGE Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/docsinstall/USAGE Sun Jul 7 18:51:44 2013 (r252987) @@ -11,11 +11,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/docsinstall/docsinstall ============================================================================== --- head/usr.sbin/bsdconfig/docsinstall/docsinstall Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/docsinstall/docsinstall Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/dot/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/dot/USAGE Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/dot/USAGE Sun Jul 7 18:51:44 2013 (r252987) @@ -11,11 +11,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/dot/dot ============================================================================== --- head/usr.sbin/bsdconfig/dot/dot Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/dot/dot Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/mouse/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/mouse/USAGE Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/mouse/USAGE Sun Jul 7 18:51:44 2013 (r252987) @@ -11,11 +11,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/mouse/disable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/disable Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/mouse/disable Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/mouse/enable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/enable Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/mouse/enable Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/mouse/flags ============================================================================== --- head/usr.sbin/bsdconfig/mouse/flags Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/mouse/flags Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/mouse/mouse ============================================================================== --- head/usr.sbin/bsdconfig/mouse/mouse Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/mouse/mouse Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/mouse/port ============================================================================== --- head/usr.sbin/bsdconfig/mouse/port Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/mouse/port Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/mouse/type ============================================================================== --- head/usr.sbin/bsdconfig/mouse/type Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/mouse/type Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/networking/USAGE Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/USAGE Sun Jul 7 18:51:44 2013 (r252987) @@ -11,11 +11,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/defaultrouter ============================================================================== --- head/usr.sbin/bsdconfig/networking/defaultrouter Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/defaultrouter Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/devices Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/hostname ============================================================================== --- head/usr.sbin/bsdconfig/networking/hostname Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/hostname Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/nameservers ============================================================================== --- head/usr.sbin/bsdconfig/networking/nameservers Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/nameservers Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/networking Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/common.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/share/common.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_NETWORKING_COMMON_SUBR" ]; 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/device.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/share/device.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_NETWORKING_DEVICE_SUBR" ]; 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/share/hostname.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/hostname.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/share/hostname.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_NETWORKING_HOSTNAME_SUBR" ]; t # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/share/ipaddr.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/share/ipaddr.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_NETWORKING_IPADDR_SUBR" ]; 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/share/media.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/media.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/share/media.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_NETWORKING_MEDIA_SUBR" ]; then # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/share/netmask.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/netmask.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/share/netmask.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_NETWORKING_NETMASK_SUBR" ]; th # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/share/resolv.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/resolv.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/share/resolv.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_NETWORKING_RESOLV_SUBR" ]; 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/share/routing.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/routing.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/share/routing.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_NETWORKING_ROUTING_SUBR" ]; th # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/networking/share/services.subr ============================================================================== --- head/usr.sbin/bsdconfig/networking/share/services.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/networking/share/services.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_NETWORKING_SERVICES_SUBR" ]; t # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/packages/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/packages/USAGE Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/packages/USAGE Sun Jul 7 18:51:44 2013 (r252987) @@ -11,11 +11,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/packages/packages ============================================================================== --- head/usr.sbin/bsdconfig/packages/packages Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/packages/packages Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/password/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/password/USAGE Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/password/USAGE Sun Jul 7 18:51:44 2013 (r252987) @@ -11,11 +11,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/password/password ============================================================================== --- head/usr.sbin/bsdconfig/password/password Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/password/password Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/security/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/security/USAGE Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/security/USAGE Sun Jul 7 18:51:44 2013 (r252987) @@ -11,11 +11,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/security/security ============================================================================== --- head/usr.sbin/bsdconfig/security/security Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/security/security Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/device.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/device.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/device.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_DEVICE_SUBR" ]; then _DEVICE_S # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/dialog.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_DIALOG_SUBR" ]; then _DIALOG_S # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/any.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/any.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/any.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_ANY_SUBR" ]; then _MEDIA # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/cdrom.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/cdrom.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/cdrom.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_CDROM_SUBR" ]; then _MED # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/common.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/common.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_COMMON_SUBR" ]; then _ME # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/directory.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/directory.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/directory.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_DIRECTORY_SUBR" ]; then # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/dos.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/dos.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/dos.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_DOS_SUBR" ]; then _MEDIA # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/floppy.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/floppy.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/floppy.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_FLOPPY_SUBR" ]; then _ME # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/ftp.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ftp.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/ftp.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_FTP_SUBR" ]; then _MEDIA # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/http.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/http.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/http.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_HTTP_SUBR" ]; then _MEDI # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/httpproxy.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/httpproxy.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/httpproxy.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_HTTPPROXY_SUBR" ]; then # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/network.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/network.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/network.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_NETWORK_SUBR" ]; then _M # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/nfs.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/nfs.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/nfs.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_NFS_SUBR" ]; then _MEDIA # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/options.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/options.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/options.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_OPTIONS_SUBR" ]; then _M # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/tcpip.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/tcpip.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/tcpip.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_TCPIP_SUBR" ]; then _MED # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/ufs.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/ufs.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/ufs.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_UFS_SUBR" ]; then _MEDIA # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/media/usb.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/usb.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/media/usb.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MEDIA_USB_SUBR" ]; then _MEDIA # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/mustberoot.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/mustberoot.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/mustberoot.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_MUSTBEROOT_SUBR" ]; then _MUST # 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 +# 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 (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# 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 Modified: head/usr.sbin/bsdconfig/share/packages/categories.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/categories.subr Sun Jul 7 18:50:26 2013 (r252986) +++ head/usr.sbin/bsdconfig/share/packages/categories.subr Sun Jul 7 18:51:44 2013 (r252987) @@ -13,11 +13,11 @@ if [ ! "$_PACKAGES_CATEGORIES_SUBR" ]; t # 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 +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 18:53:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3D93A4F1; Sun, 7 Jul 2013 18:53:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE7A1060; Sun, 7 Jul 2013 18:53:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67IriZ9097903; Sun, 7 Jul 2013 18:53:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67IriJ4097902; Sun, 7 Jul 2013 18:53:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071853.r67IriJ4097902@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252988 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:53:44 -0000 Author: tuexen Date: Sun Jul 7 18:53:43 2013 New Revision: 252988 URL: http://svnweb.freebsd.org/changeset/base/252988 Log: MFC r250756: Set errno to ETIMEDOUT if an SCTP association times out during setup. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Sun Jul 7 18:51:44 2013 (r252987) +++ stable/8/sys/netinet/sctputil.c Sun Jul 7 18:53:43 2013 (r252988) @@ -2688,8 +2688,14 @@ set_error: stcb->sctp_socket->so_error = ECONNRESET; } } else { - SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNABORTED); - stcb->sctp_socket->so_error = ECONNABORTED; + if ((SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_ECHOED)) { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ETIMEDOUT); + stcb->sctp_socket->so_error = ETIMEDOUT; + } else { + SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ECONNABORTED); + stcb->sctp_socket->so_error = ECONNABORTED; + } } } /* Wake ANY sleepers */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 18:56:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 84F376D0; Sun, 7 Jul 2013 18:56:44 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D2DA107F; Sun, 7 Jul 2013 18:56:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67IuiuE098337; Sun, 7 Jul 2013 18:56:44 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67IuiqH098336; Sun, 7 Jul 2013 18:56:44 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071856.r67IuiqH098336@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252989 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:56:44 -0000 Author: tuexen Date: Sun Jul 7 18:56:43 2013 New Revision: 252989 URL: http://svnweb.freebsd.org/changeset/base/252989 Log: MFC r251054: Remove redundant checks. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Sun Jul 7 18:53:43 2013 (r252988) +++ stable/8/sys/netinet/sctputil.c Sun Jul 7 18:56:43 2013 (r252989) @@ -3536,8 +3536,8 @@ sctp_ulp_notify(uint32_t notification, s if (stcb->sctp_socket->so_rcv.sb_state & SBS_CANTRCVMORE) { return; } - if (stcb && ((stcb->asoc.state & SCTP_STATE_COOKIE_WAIT) || - (stcb->asoc.state & SCTP_STATE_COOKIE_ECHOED))) { + if ((stcb->asoc.state & SCTP_STATE_COOKIE_WAIT) || + (stcb->asoc.state & SCTP_STATE_COOKIE_ECHOED)) { if ((notification == SCTP_NOTIFY_INTERFACE_DOWN) || (notification == SCTP_NOTIFY_INTERFACE_UP) || (notification == SCTP_NOTIFY_INTERFACE_CONFIRMED)) { @@ -3611,16 +3611,16 @@ sctp_ulp_notify(uint32_t notification, s break; } case SCTP_NOTIFY_ASSOC_LOC_ABORTED: - if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || - ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { + if (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || + ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED)) { sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 0, so_locked); } else { sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 0, so_locked); } break; case SCTP_NOTIFY_ASSOC_REM_ABORTED: - if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || - ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) { + if (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) || + ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED)) { sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, data, 1, so_locked); } else { sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, data, 1, so_locked); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 18:58:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 852F98EB; Sun, 7 Jul 2013 18:58:50 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 75D901094; Sun, 7 Jul 2013 18:58:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67Iwopq098614; Sun, 7 Jul 2013 18:58:50 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67IwoeU098613; Sun, 7 Jul 2013 18:58:50 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071858.r67IwoeU098613@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 18:58:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252990 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 18:58:50 -0000 Author: tuexen Date: Sun Jul 7 18:58:49 2013 New Revision: 252990 URL: http://svnweb.freebsd.org/changeset/base/252990 Log: MFC r251248: Use LIST_EMPTY when appropriate. Modified: stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Sun Jul 7 18:56:43 2013 (r252989) +++ stable/8/sys/netinet/sctputil.c Sun Jul 7 18:58:49 2013 (r252990) @@ -3973,7 +3973,7 @@ sctp_abort_an_association(struct sctp_in if (stcb == NULL) { /* Got to have a TCB */ if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { - if (LIST_FIRST(&inp->sctp_asoc_list) == NULL) { + if (LIST_EMPTY(&inp->sctp_asoc_list)) { sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, SCTP_CALLED_DIRECTLY_NOCMPSET); } @@ -4028,7 +4028,7 @@ sctp_handle_ootb(struct mbuf *m, int iph SCTP_STAT_INCR_COUNTER32(sctps_outoftheblue); /* Generate a TO address for future reference */ if (inp && (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE)) { - if (LIST_FIRST(&inp->sctp_asoc_list) == NULL) { + if (LIST_EMPTY(&inp->sctp_asoc_list)) { sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, SCTP_CALLED_DIRECTLY_NOCMPSET); } From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 19:01:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DB71BA6B; Sun, 7 Jul 2013 19:01:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CBDA510AA; Sun, 7 Jul 2013 19:01:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67J1ZeK000907; Sun, 7 Jul 2013 19:01:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67J1Zop000903; Sun, 7 Jul 2013 19:01:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071901.r67J1Zop000903@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 19:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252991 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 19:01:35 -0000 Author: tuexen Date: Sun Jul 7 19:01:34 2013 New Revision: 252991 URL: http://svnweb.freebsd.org/changeset/base/252991 Log: MFC r252585: Code cleanups. Modified: stable/8/sys/netinet/sctp_indata.c stable/8/sys/netinet/sctp_indata.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_pcb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_indata.c ============================================================================== --- stable/8/sys/netinet/sctp_indata.c Sun Jul 7 18:58:49 2013 (r252990) +++ stable/8/sys/netinet/sctp_indata.c Sun Jul 7 19:01:34 2013 (r252991) @@ -1729,7 +1729,6 @@ sctp_process_a_data_chunk(struct sctp_tc sctp_alloc_a_readq(stcb, control); sctp_build_readq_entry_mac(control, stcb, asoc->context, net, tsn, protocol_id, - stcb->asoc.context, strmno, strmseq, chunk_flags, dmbuf); @@ -1857,7 +1856,6 @@ failed_pdapi_express_del: sctp_alloc_a_readq(stcb, control); sctp_build_readq_entry_mac(control, stcb, asoc->context, net, tsn, protocol_id, - stcb->asoc.context, strmno, strmseq, chunk_flags, dmbuf); Modified: stable/8/sys/netinet/sctp_indata.h ============================================================================== --- stable/8/sys/netinet/sctp_indata.h Sun Jul 7 18:58:49 2013 (r252990) +++ stable/8/sys/netinet/sctp_indata.h Sun Jul 7 19:01:34 2013 (r252991) @@ -47,14 +47,14 @@ sctp_build_readq_entry(struct sctp_tcb * struct mbuf *dm); -#define sctp_build_readq_entry_mac(_ctl, in_it, a, net, tsn, ppid, context, stream_no, stream_seq, flags, dm) do { \ +#define sctp_build_readq_entry_mac(_ctl, in_it, context, net, tsn, ppid, stream_no, stream_seq, flags, dm) do { \ if (_ctl) { \ atomic_add_int(&((net)->ref_count), 1); \ (_ctl)->sinfo_stream = stream_no; \ (_ctl)->sinfo_ssn = stream_seq; \ (_ctl)->sinfo_flags = (flags << 8); \ (_ctl)->sinfo_ppid = ppid; \ - (_ctl)->sinfo_context = a; \ + (_ctl)->sinfo_context = context; \ (_ctl)->sinfo_timetolive = 0; \ (_ctl)->sinfo_tsn = tsn; \ (_ctl)->sinfo_cumtsn = tsn; \ Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sun Jul 7 18:58:49 2013 (r252990) +++ stable/8/sys/netinet/sctp_input.c Sun Jul 7 19:01:34 2013 (r252991) @@ -1028,12 +1028,13 @@ sctp_handle_shutdown_ack(struct sctp_shu SCTP_SOCKET_UNLOCK(so, 1); #endif } - /* are the queues empty? */ +#ifdef INVARIANTS if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { - sctp_report_all_outbound(stcb, 0, 0, SCTP_SO_NOT_LOCKED); + panic("Queues are not empty when handling SHUTDOWN-ACK"); } +#endif /* stop the timer */ sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_9); /* send SHUTDOWN-COMPLETE */ @@ -1875,9 +1876,14 @@ sctp_process_cookie_existing(struct mbuf cookie->tie_tag_peer_vtag != 0) { struct sctpasochead *head; +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + struct socket *so; + +#endif + if (asoc->peer_supports_nat) { /* - * This is a gross gross hack. just call the + * This is a gross gross hack. Just call the * cookie_new code since we are allowing a duplicate * association. I hope this works... */ @@ -1939,6 +1945,10 @@ sctp_process_cookie_existing(struct mbuf asoc->mapping_array_size); } SCTP_TCB_UNLOCK(stcb); +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + so = SCTP_INP_SO(stcb->sctp_ep); + SCTP_SOCKET_LOCK(so, 1); +#endif SCTP_INP_INFO_WLOCK(); SCTP_INP_WLOCK(stcb->sctp_ep); SCTP_TCB_LOCK(stcb); @@ -1946,7 +1956,7 @@ sctp_process_cookie_existing(struct mbuf /* send up all the data */ SCTP_TCB_SEND_LOCK(stcb); - sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_NOT_LOCKED); + sctp_report_all_outbound(stcb, 0, 1, SCTP_SO_LOCKED); for (i = 0; i < stcb->asoc.streamoutcnt; i++) { stcb->asoc.strmout[i].chunks_on_queues = 0; stcb->asoc.strmout[i].stream_no = i; @@ -1968,11 +1978,15 @@ sctp_process_cookie_existing(struct mbuf */ LIST_INSERT_HEAD(head, stcb, sctp_asocs); - /* process the INIT info (peer's info) */ SCTP_TCB_SEND_UNLOCK(stcb); SCTP_INP_WUNLOCK(stcb->sctp_ep); SCTP_INP_INFO_WUNLOCK(); - +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) + SCTP_SOCKET_UNLOCK(so, 1); +#endif + asoc->total_flight = 0; + asoc->total_flight_count = 0; + /* process the INIT info (peer's info) */ retval = sctp_process_init(init_cp, stcb); if (retval < 0) { if (how_indx < sizeof(asoc->cookie_how)) @@ -3196,13 +3210,14 @@ sctp_handle_shutdown_complete(struct sct /* notify upper layer protocol */ if (stcb->sctp_socket) { sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); - /* are the queues empty? they should be */ - if (!TAILQ_EMPTY(&asoc->send_queue) || - !TAILQ_EMPTY(&asoc->sent_queue) || - !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { - sctp_report_all_outbound(stcb, 0, 0, SCTP_SO_NOT_LOCKED); - } } +#ifdef INVARIANTS + if (!TAILQ_EMPTY(&asoc->send_queue) || + !TAILQ_EMPTY(&asoc->sent_queue) || + !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { + panic("Queues are not empty when handling SHUTDOWN-COMPLETE"); + } +#endif /* stop the timer */ sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWNACK, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_22); SCTP_STAT_INCR_COUNTER32(sctps_shutdown); @@ -3491,18 +3506,13 @@ sctp_reset_in_stream(struct sctp_tcb *st } static void -sctp_reset_out_streams(struct sctp_tcb *stcb, int number_entries, uint16_t * list) +sctp_reset_out_streams(struct sctp_tcb *stcb, uint32_t number_entries, uint16_t * list) { - int i; + uint32_t i; + uint16_t temp; - if (number_entries == 0) { - for (i = 0; i < stcb->asoc.streamoutcnt; i++) { - stcb->asoc.strmout[i].next_sequence_send = 0; - } - } else if (number_entries) { + if (number_entries > 0) { for (i = 0; i < number_entries; i++) { - uint16_t temp; - temp = ntohs(list[i]); if (temp >= stcb->asoc.streamoutcnt) { /* no such stream */ @@ -3510,6 +3520,10 @@ sctp_reset_out_streams(struct sctp_tcb * } stcb->asoc.strmout[temp].next_sequence_send = 0; } + } else { + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + stcb->asoc.strmout[i].next_sequence_send = 0; + } } sctp_ulp_notify(SCTP_NOTIFY_STR_RESET_SEND, stcb, number_entries, (void *)list, SCTP_SO_NOT_LOCKED); } @@ -3596,7 +3610,7 @@ sctp_handle_stream_reset_response(struct struct sctp_association *asoc = &stcb->asoc; struct sctp_tmit_chunk *chk; struct sctp_stream_reset_out_request *srparam; - int number_entries; + uint32_t number_entries; if (asoc->stream_reset_outstanding == 0) { /* duplicate */ Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Sun Jul 7 18:58:49 2013 (r252990) +++ stable/8/sys/netinet/sctp_pcb.c Sun Jul 7 19:01:34 2013 (r252991) @@ -4451,23 +4451,21 @@ sctp_delete_from_timewait(uint32_t tag, int i; chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; - if (!LIST_EMPTY(chain)) { - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == tag) && - (twait_block->vtag_block[i].lport == lport) && - (twait_block->vtag_block[i].rport == rport)) { - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - found = 1; - break; - } - } - if (found) + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if ((twait_block->vtag_block[i].v_tag == tag) && + (twait_block->vtag_block[i].lport == lport) && + (twait_block->vtag_block[i].rport == rport)) { + twait_block->vtag_block[i].tv_sec_at_expire = 0; + twait_block->vtag_block[i].v_tag = 0; + twait_block->vtag_block[i].lport = 0; + twait_block->vtag_block[i].rport = 0; + found = 1; break; + } } + if (found) + break; } } @@ -4481,19 +4479,17 @@ sctp_is_in_timewait(uint32_t tag, uint16 SCTP_INP_INFO_WLOCK(); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; - if (!LIST_EMPTY(chain)) { - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == tag) && - (twait_block->vtag_block[i].lport == lport) && - (twait_block->vtag_block[i].rport == rport)) { - found = 1; - break; - } - } - if (found) + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if ((twait_block->vtag_block[i].v_tag == tag) && + (twait_block->vtag_block[i].lport == lport) && + (twait_block->vtag_block[i].rport == rport)) { + found = 1; break; + } } + if (found) + break; } SCTP_INP_INFO_WUNLOCK(); return (found); @@ -4515,42 +4511,40 @@ sctp_add_vtag_to_timewait(uint32_t tag, (void)SCTP_GETTIME_TIMEVAL(&now); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; set = 0; - if (!LIST_EMPTY(chain)) { + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { /* Block(s) present, lets find space, and expire on the fly */ - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if ((twait_block->vtag_block[i].v_tag == 0) && - !set) { - twait_block->vtag_block[i].tv_sec_at_expire = - now.tv_sec + time; + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if ((twait_block->vtag_block[i].v_tag == 0) && + !set) { + twait_block->vtag_block[i].tv_sec_at_expire = + now.tv_sec + time; + twait_block->vtag_block[i].v_tag = tag; + twait_block->vtag_block[i].lport = lport; + twait_block->vtag_block[i].rport = rport; + set = 1; + } else if ((twait_block->vtag_block[i].v_tag) && + ((long)twait_block->vtag_block[i].tv_sec_at_expire < now.tv_sec)) { + /* Audit expires this guy */ + twait_block->vtag_block[i].tv_sec_at_expire = 0; + twait_block->vtag_block[i].v_tag = 0; + twait_block->vtag_block[i].lport = 0; + twait_block->vtag_block[i].rport = 0; + if (set == 0) { + /* Reuse it for my new tag */ + twait_block->vtag_block[i].tv_sec_at_expire = now.tv_sec + time; twait_block->vtag_block[i].v_tag = tag; twait_block->vtag_block[i].lport = lport; twait_block->vtag_block[i].rport = rport; set = 1; - } else if ((twait_block->vtag_block[i].v_tag) && - ((long)twait_block->vtag_block[i].tv_sec_at_expire < now.tv_sec)) { - /* Audit expires this guy */ - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - if (set == 0) { - /* Reuse it for my new tag */ - twait_block->vtag_block[i].tv_sec_at_expire = now.tv_sec + time; - twait_block->vtag_block[i].v_tag = tag; - twait_block->vtag_block[i].lport = lport; - twait_block->vtag_block[i].rport = rport; - set = 1; - } } } - if (set) { - /* - * We only do up to the block where we can - * place our tag for audits - */ - break; - } + } + if (set) { + /* + * We only do up to the block where we can place our + * tag for audits + */ + break; } } /* Need to add a new block to chain */ @@ -6700,30 +6694,28 @@ skip_vtag_check: chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; /* Now what about timed wait ? */ - if (!LIST_EMPTY(chain)) { + LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { /* * Block(s) are present, lets see if we have this tag in the * list */ - LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { - for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { - if (twait_block->vtag_block[i].v_tag == 0) { - /* not used */ - continue; - } else if ((long)twait_block->vtag_block[i].tv_sec_at_expire < - now->tv_sec) { - /* Audit expires this guy */ - twait_block->vtag_block[i].tv_sec_at_expire = 0; - twait_block->vtag_block[i].v_tag = 0; - twait_block->vtag_block[i].lport = 0; - twait_block->vtag_block[i].rport = 0; - } else if ((twait_block->vtag_block[i].v_tag == tag) && - (twait_block->vtag_block[i].lport == lport) && - (twait_block->vtag_block[i].rport == rport)) { - /* Bad tag, sorry :< */ - SCTP_INP_INFO_RUNLOCK(); - return (0); - } + for (i = 0; i < SCTP_NUMBER_IN_VTAG_BLOCK; i++) { + if (twait_block->vtag_block[i].v_tag == 0) { + /* not used */ + continue; + } else if ((long)twait_block->vtag_block[i].tv_sec_at_expire < + now->tv_sec) { + /* Audit expires this guy */ + twait_block->vtag_block[i].tv_sec_at_expire = 0; + twait_block->vtag_block[i].v_tag = 0; + twait_block->vtag_block[i].lport = 0; + twait_block->vtag_block[i].rport = 0; + } else if ((twait_block->vtag_block[i].v_tag == tag) && + (twait_block->vtag_block[i].lport == lport) && + (twait_block->vtag_block[i].rport == rport)) { + /* Bad tag, sorry :< */ + SCTP_INP_INFO_RUNLOCK(); + return (0); } } } From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 19:04:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D352EB9B; Sun, 7 Jul 2013 19:04:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C424510B4; Sun, 7 Jul 2013 19:04:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67J4AO2001370; Sun, 7 Jul 2013 19:04:10 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67J4AOt001369; Sun, 7 Jul 2013 19:04:10 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071904.r67J4AOt001369@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 19:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252992 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 19:04:10 -0000 Author: tuexen Date: Sun Jul 7 19:04:10 2013 New Revision: 252992 URL: http://svnweb.freebsd.org/changeset/base/252992 Log: MFC r252718: When processing an incoming ABORT, SHUTDOWN_COMPLETE or ERROR (NAT related) chunk, take always the T-bit into account, when checking the verification tag. Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sun Jul 7 19:01:34 2013 (r252991) +++ stable/8/sys/netinet/sctp_input.c Sun Jul 7 19:04:10 2013 (r252992) @@ -4568,8 +4568,10 @@ __attribute__((noinline)) if ((ch->chunk_type == SCTP_ABORT_ASSOCIATION) || (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) || (ch->chunk_type == SCTP_PACKET_DROPPED)) { - if ((vtag_in == asoc->my_vtag) || - ((ch->chunk_flags & SCTP_HAD_NO_TCB) && + /* Take the T-bit always into account. */ + if ((((ch->chunk_flags & SCTP_HAD_NO_TCB) == 0) && + (vtag_in == asoc->my_vtag)) || + (((ch->chunk_flags & SCTP_HAD_NO_TCB) == SCTP_HAD_NO_TCB) && (vtag_in == asoc->peer_vtag))) { /* this is valid */ } else { From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 19:05:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5F84ACE6; Sun, 7 Jul 2013 19:05:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4FB1D10C9; Sun, 7 Jul 2013 19:05:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67J5bTm001669; Sun, 7 Jul 2013 19:05:37 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67J5aqL001660; Sun, 7 Jul 2013 19:05:36 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307071905.r67J5aqL001660@svn.freebsd.org> From: Dimitry Andric Date: Sun, 7 Jul 2013 19:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252993 - in stable/9/contrib/llvm: include/llvm/CodeGen lib/CodeGen lib/CodeGen/SelectionDAG X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 19:05:37 -0000 Author: dim Date: Sun Jul 7 19:05:35 2013 New Revision: 252993 URL: http://svnweb.freebsd.org/changeset/base/252993 Log: MFC r252720: Pull in r185594 from llvm trunk: Add MachineBasicBlock::addLiveIn(). This function adds a live-in physical register to an MBB and ensures that it is copied to a virtual register immediately. Pull in r185615 from llvm trunk: Live-in copies go *after* EH_LABELs. This will soon be tested by exception handling working at all. Pull in r185617 from llvm trunk: Simplify landing pad lowering. Stop using the ISD::EXCEPTIONADDR and ISD::EHSELECTION when lowering landing pad arguments. These nodes were previously legalized into CopyFromReg nodes, but that never worked properly because the CopyFromReg node weren't guaranteed to be scheduled at the top of the basic block. This meant the exception pointer and selector registers could be clobbered before being copied to a virtual register. This patch copies the two physical registers to virtual registers at the beginning of the basic block, and lowers the landingpad instruction directly to two CopyFromReg nodes reading the *virtual* registers. This is safe because virtual registers don't get clobbered. A future patch will remove the ISD::EXCEPTIONADDR and ISD::EHSELECTION nodes. Together, these changes fix llvm PR 16038 ('qt4 webcore file results in "Bad machine code: Using an undefined physical register"'), and should make it possible again to compile the www/qt4-webkit port again on the i386 arch, without using a CPUTYPE=i686 or higher setting. Modified: stable/9/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h stable/9/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) Modified: stable/9/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h ============================================================================== --- stable/9/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h Sun Jul 7 19:04:10 2013 (r252992) +++ stable/9/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h Sun Jul 7 19:05:35 2013 (r252993) @@ -115,6 +115,11 @@ public: /// there's no other convenient place for it to live right now. std::vector > PHINodesToUpdate; + /// If the current MBB is a landing pad, the exception pointer and exception + /// selector registers are copied into these virtual registers by + /// SelectionDAGISel::PrepareEHLandingPad(). + unsigned ExceptionPointerVirtReg, ExceptionSelectorVirtReg; + explicit FunctionLoweringInfo(const TargetLowering &TLI); /// set - Initialize this FunctionLoweringInfo with the given Function Modified: stable/9/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h ============================================================================== --- stable/9/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h Sun Jul 7 19:04:10 2013 (r252992) +++ stable/9/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h Sun Jul 7 19:05:35 2013 (r252993) @@ -296,6 +296,11 @@ public: /// is an error to add the same register to the same set more than once. void addLiveIn(unsigned Reg) { LiveIns.push_back(Reg); } + /// Add PhysReg as live in to this block, and ensure that there is a copy of + /// PhysReg to a virtual register of class RC. Return the virtual register + /// that is a copy of the live in PhysReg. + unsigned addLiveIn(unsigned PhysReg, const TargetRegisterClass *RC); + /// removeLiveIn - Remove the specified register from the live in set. /// void removeLiveIn(unsigned Reg); Modified: stable/9/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp ============================================================================== --- stable/9/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp Sun Jul 7 19:04:10 2013 (r252992) +++ stable/9/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp Sun Jul 7 19:05:35 2013 (r252993) @@ -19,6 +19,7 @@ #include "llvm/CodeGen/LiveVariables.h" #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/SlotIndexes.h" @@ -341,6 +342,38 @@ bool MachineBasicBlock::isLiveIn(unsigne return I != livein_end(); } +unsigned +MachineBasicBlock::addLiveIn(unsigned PhysReg, const TargetRegisterClass *RC) { + assert(getParent() && "MBB must be inserted in function"); + assert(TargetRegisterInfo::isPhysicalRegister(PhysReg) && "Expected physreg"); + assert(RC && "Register class is required"); + assert((isLandingPad() || this == &getParent()->front()) && + "Only the entry block and landing pads can have physreg live ins"); + + bool LiveIn = isLiveIn(PhysReg); + iterator I = SkipPHIsAndLabels(begin()), E = end(); + MachineRegisterInfo &MRI = getParent()->getRegInfo(); + const TargetInstrInfo &TII = *getParent()->getTarget().getInstrInfo(); + + // Look for an existing copy. + if (LiveIn) + for (;I != E && I->isCopy(); ++I) + if (I->getOperand(1).getReg() == PhysReg) { + unsigned VirtReg = I->getOperand(0).getReg(); + if (!MRI.constrainRegClass(VirtReg, RC)) + llvm_unreachable("Incompatible live-in register class."); + return VirtReg; + } + + // No luck, create a virtual register. + unsigned VirtReg = MRI.createVirtualRegister(RC); + BuildMI(*this, I, DebugLoc(), TII.get(TargetOpcode::COPY), VirtReg) + .addReg(PhysReg, RegState::Kill); + if (!LiveIn) + addLiveIn(PhysReg); + return VirtReg; +} + void MachineBasicBlock::moveBefore(MachineBasicBlock *NewAfter) { getParent()->splice(NewAfter, this); } Modified: stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp ============================================================================== --- stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Sun Jul 7 19:04:10 2013 (r252992) +++ stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Sun Jul 7 19:05:35 2013 (r252993) @@ -1910,33 +1910,25 @@ void SelectionDAGBuilder::visitLandingPa SmallVector ValueVTs; ComputeValueVTs(TLI, LP.getType(), ValueVTs); + assert(ValueVTs.size() == 2 && "Only two-valued landingpads are supported"); - // Insert the EXCEPTIONADDR instruction. - assert(FuncInfo.MBB->isLandingPad() && - "Call to eh.exception not in landing pad!"); - SDVTList VTs = DAG.getVTList(TLI.getPointerTy(), MVT::Other); + // Get the two live-in registers as SDValues. The physregs have already been + // copied into virtual registers. SDValue Ops[2]; - Ops[0] = DAG.getRoot(); - SDValue Op1 = DAG.getNode(ISD::EXCEPTIONADDR, getCurDebugLoc(), VTs, Ops, 1); - SDValue Chain = Op1.getValue(1); - - // Insert the EHSELECTION instruction. - VTs = DAG.getVTList(TLI.getPointerTy(), MVT::Other); - Ops[0] = Op1; - Ops[1] = Chain; - SDValue Op2 = DAG.getNode(ISD::EHSELECTION, getCurDebugLoc(), VTs, Ops, 2); - Chain = Op2.getValue(1); - Op2 = DAG.getSExtOrTrunc(Op2, getCurDebugLoc(), MVT::i32); + Ops[0] = DAG.getZExtOrTrunc( + DAG.getCopyFromReg(DAG.getEntryNode(), getCurDebugLoc(), + FuncInfo.ExceptionPointerVirtReg, TLI.getPointerTy()), + getCurDebugLoc(), ValueVTs[0]); + Ops[1] = DAG.getZExtOrTrunc( + DAG.getCopyFromReg(DAG.getEntryNode(), getCurDebugLoc(), + FuncInfo.ExceptionSelectorVirtReg, TLI.getPointerTy()), + getCurDebugLoc(), ValueVTs[1]); - Ops[0] = Op1; - Ops[1] = Op2; + // Merge into one. SDValue Res = DAG.getNode(ISD::MERGE_VALUES, getCurDebugLoc(), DAG.getVTList(&ValueVTs[0], ValueVTs.size()), &Ops[0], 2); - - std::pair RetPair = std::make_pair(Res, Chain); - setValue(&LP, RetPair.first); - DAG.setRoot(RetPair.second); + setValue(&LP, Res); } /// handleSmallSwitchCaseRange - Emit a series of specific tests (suitable for Modified: stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp ============================================================================== --- stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sun Jul 7 19:04:10 2013 (r252992) +++ stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Sun Jul 7 19:05:35 2013 (r252993) @@ -827,12 +827,13 @@ void SelectionDAGISel::PrepareEHLandingP .addSym(Label); // Mark exception register as live in. - unsigned Reg = TLI.getExceptionPointerRegister(); - if (Reg) MBB->addLiveIn(Reg); + const TargetRegisterClass *PtrRC = TLI.getRegClassFor(TLI.getPointerTy()); + if (unsigned Reg = TLI.getExceptionPointerRegister()) + FuncInfo->ExceptionPointerVirtReg = MBB->addLiveIn(Reg, PtrRC); // Mark exception selector register as live in. - Reg = TLI.getExceptionSelectorRegister(); - if (Reg) MBB->addLiveIn(Reg); + if (unsigned Reg = TLI.getExceptionSelectorRegister()) + FuncInfo->ExceptionSelectorVirtReg = MBB->addLiveIn(Reg, PtrRC); } /// isFoldedOrDeadInstruction - Return true if the specified instruction is @@ -970,6 +971,8 @@ void SelectionDAGISel::SelectAllBasicBlo FuncInfo->InsertPt = FuncInfo->MBB->getFirstNonPHI(); // Setup an EH landing-pad block. + FuncInfo->ExceptionPointerVirtReg = 0; + FuncInfo->ExceptionSelectorVirtReg = 0; if (FuncInfo->MBB->isLandingPad()) PrepareEHLandingPad(); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 19:07:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 56ABBE1A; Sun, 7 Jul 2013 19:07:02 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48A0E10D5; Sun, 7 Jul 2013 19:07:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67J72g1001988; Sun, 7 Jul 2013 19:07:02 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67J71L7001978; Sun, 7 Jul 2013 19:07:01 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307071907.r67J71L7001978@svn.freebsd.org> From: Michael Tuexen Date: Sun, 7 Jul 2013 19:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r252994 - stable/8/sys/netinet X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 19:07:02 -0000 Author: tuexen Date: Sun Jul 7 19:07:00 2013 New Revision: 252994 URL: http://svnweb.freebsd.org/changeset/base/252994 Log: MFC r252779: Fix a bug were only 2048 streams where usable even though more than 2048 streams were negotiated on the wire. While there, remove the hard coded limit of 2048 streams. Modified: stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_sysctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Sun Jul 7 19:05:35 2013 (r252993) +++ stable/8/sys/netinet/sctp_constants.h Sun Jul 7 19:07:00 2013 (r252994) @@ -521,9 +521,6 @@ __FBSDID("$FreeBSD$"); /* How long a cookie lives in milli-seconds */ #define SCTP_DEFAULT_COOKIE_LIFE 60000 -/* resource limit of streams */ -#define MAX_SCTP_STREAMS 2048 - /* Maximum the mapping array will grow to (TSN mapping array) */ #define SCTP_MAPPING_ARRAY 512 @@ -658,6 +655,7 @@ __FBSDID("$FreeBSD$"); /* How many streams I request initally by default */ #define SCTP_OSTREAM_INITIAL 10 +#define SCTP_ISTREAM_INITIAL 2048 /* * How many smallest_mtu's need to increase before a window update sack is Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sun Jul 7 19:05:35 2013 (r252993) +++ stable/8/sys/netinet/sctp_input.c Sun Jul 7 19:07:00 2013 (r252994) @@ -389,9 +389,10 @@ sctp_process_init(struct sctp_init_chunk } SCTP_FREE(asoc->strmin, SCTP_M_STRMI); } - asoc->streamincnt = ntohs(init->num_outbound_streams); - if (asoc->streamincnt > MAX_SCTP_STREAMS) { - asoc->streamincnt = MAX_SCTP_STREAMS; + if (asoc->max_inbound_streams > ntohs(init->num_outbound_streams)) { + asoc->streamincnt = ntohs(init->num_outbound_streams); + } else { + asoc->streamincnt = asoc->max_inbound_streams; } SCTP_MALLOC(asoc->strmin, struct sctp_stream_in *, asoc->streamincnt * sizeof(struct sctp_stream_in), SCTP_M_STRMI); @@ -403,11 +404,6 @@ sctp_process_init(struct sctp_init_chunk for (i = 0; i < asoc->streamincnt; i++) { asoc->strmin[i].stream_no = i; asoc->strmin[i].last_sequence_delivered = 0xffff; - /* - * U-stream ranges will be set when the cookie is unpacked. - * Or for the INIT sender they are un set (if pr-sctp not - * supported) when the INIT-ACK arrives. - */ TAILQ_INIT(&asoc->strmin[i].inqueue); asoc->strmin[i].delivery_started = 0; } Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Sun Jul 7 19:05:35 2013 (r252993) +++ stable/8/sys/netinet/sctp_pcb.c Sun Jul 7 19:07:00 2013 (r252994) @@ -2503,9 +2503,6 @@ sctp_inpcb_alloc(struct socket *so, uint m->initial_rto = SCTP_BASE_SYSCTL(sctp_rto_initial_default); m->initial_init_rto_max = SCTP_BASE_SYSCTL(sctp_init_rto_max_default); m->sctp_sack_freq = SCTP_BASE_SYSCTL(sctp_sack_freq_default); - - m->max_open_streams_intome = MAX_SCTP_STREAMS; - m->max_init_times = SCTP_BASE_SYSCTL(sctp_init_rtx_max_default); m->max_send_times = SCTP_BASE_SYSCTL(sctp_assoc_rtx_max_default); m->def_net_failure = SCTP_BASE_SYSCTL(sctp_path_rtx_max_default); @@ -2517,6 +2514,7 @@ sctp_inpcb_alloc(struct socket *so, uint m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); m->sctp_default_ss_module = SCTP_BASE_SYSCTL(sctp_default_ss_module); + m->max_open_streams_intome = SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default); /* number of streams to pre-open on a association */ m->pre_open_stream_count = SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default); Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Sun Jul 7 19:05:35 2013 (r252993) +++ stable/8/sys/netinet/sctp_sysctl.c Sun Jul 7 19:07:00 2013 (r252994) @@ -81,6 +81,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_path_rtx_max_default) = SCTPCTL_PATH_RTX_MAX_DEFAULT; SCTP_BASE_SYSCTL(sctp_path_pf_threshold) = SCTPCTL_PATH_PF_THRESHOLD_DEFAULT; SCTP_BASE_SYSCTL(sctp_add_more_threshold) = SCTPCTL_ADD_MORE_ON_OUTPUT_DEFAULT; + SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default) = SCTPCTL_INCOMING_STREAMS_DEFAULT; SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default) = SCTPCTL_OUTGOING_STREAMS_DEFAULT; SCTP_BASE_SYSCTL(sctp_cmt_on_off) = SCTPCTL_CMT_ON_OFF_DEFAULT; /* EY */ @@ -623,6 +624,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_path_rtx_max_default), SCTPCTL_PATH_RTX_MAX_MIN, SCTPCTL_PATH_RTX_MAX_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_path_pf_threshold), SCTPCTL_PATH_PF_THRESHOLD_MIN, SCTPCTL_PATH_PF_THRESHOLD_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_add_more_threshold), SCTPCTL_ADD_MORE_ON_OUTPUT_MIN, SCTPCTL_ADD_MORE_ON_OUTPUT_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), SCTPCTL_INCOMING_STREAMS_MIN, SCTPCTL_INCOMING_STREAMS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), SCTPCTL_OUTGOING_STREAMS_MIN, SCTPCTL_OUTGOING_STREAMS_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_cmt_on_off), SCTPCTL_CMT_ON_OFF_MIN, SCTPCTL_CMT_ON_OFF_MAX); /* EY */ @@ -965,6 +967,10 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_add_more_threshold), 0, sysctl_sctp_check, "IU", SCTPCTL_ADD_MORE_ON_OUTPUT_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, incoming_streams, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_nr_incoming_streams_default), 0, sysctl_sctp_check, "IU", + SCTPCTL_INCOMING_STREAMS_DESC); + SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, outgoing_streams, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTGOING_STREAMS_DESC); Modified: stable/8/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.h Sun Jul 7 19:05:35 2013 (r252993) +++ stable/8/sys/netinet/sctp_sysctl.h Sun Jul 7 19:07:00 2013 (r252994) @@ -72,6 +72,7 @@ struct sctp_sysctl { uint32_t sctp_path_rtx_max_default; uint32_t sctp_path_pf_threshold; uint32_t sctp_add_more_threshold; + uint32_t sctp_nr_incoming_streams_default; uint32_t sctp_nr_outgoing_streams_default; uint32_t sctp_cmt_on_off; uint32_t sctp_cmt_use_dac; @@ -322,6 +323,12 @@ struct sctp_sysctl { #define SCTPCTL_ADD_MORE_ON_OUTPUT_MAX 0xFFFFFFFF #define SCTPCTL_ADD_MORE_ON_OUTPUT_DEFAULT SCTP_DEFAULT_ADD_MORE +/* incoming_streams: Default number of incoming streams */ +#define SCTPCTL_INCOMING_STREAMS_DESC "Default number of incoming streams" +#define SCTPCTL_INCOMING_STREAMS_MIN 1 +#define SCTPCTL_INCOMING_STREAMS_MAX 65535 +#define SCTPCTL_INCOMING_STREAMS_DEFAULT SCTP_ISTREAM_INITIAL + /* outgoing_streams: Default number of outgoing streams */ #define SCTPCTL_OUTGOING_STREAMS_DESC "Default number of outgoing streams" #define SCTPCTL_OUTGOING_STREAMS_MIN 1 From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 19:13:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CD250FA5; Sun, 7 Jul 2013 19:13:36 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BABDD1104; Sun, 7 Jul 2013 19:13:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67JDaCL004663; Sun, 7 Jul 2013 19:13:36 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67JDZR1004651; Sun, 7 Jul 2013 19:13:35 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307071913.r67JDZR1004651@svn.freebsd.org> From: Devin Teske Date: Sun, 7 Jul 2013 19:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252995 - in stable/9/usr.sbin: . bsdconfig bsdconfig/console bsdconfig/console/include bsdconfig/diskmgmt bsdconfig/diskmgmt/include bsdconfig/docsinstall bsdconfig/docsinstall/include... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 19:13:36 -0000 Author: dteske Date: Sun Jul 7 19:13:34 2013 New Revision: 252995 URL: http://svnweb.freebsd.org/changeset/base/252995 Log: MFC bsdconfig(8) and sysrc(8) from HEAD. (shazam!) Added: stable/9/usr.sbin/bsdconfig/ stable/9/usr.sbin/bsdconfig/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/USAGE (contents, props changed) stable/9/usr.sbin/bsdconfig/bsdconfig (contents, props changed) stable/9/usr.sbin/bsdconfig/bsdconfig.8 (contents, props changed) stable/9/usr.sbin/bsdconfig/console/ stable/9/usr.sbin/bsdconfig/console/INDEX (contents, props changed) stable/9/usr.sbin/bsdconfig/console/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/console/USAGE (contents, props changed) stable/9/usr.sbin/bsdconfig/console/console (contents, props changed) stable/9/usr.sbin/bsdconfig/console/font (contents, props changed) stable/9/usr.sbin/bsdconfig/console/include/ stable/9/usr.sbin/bsdconfig/console/include/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/console/include/messages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/console/keymap (contents, props changed) stable/9/usr.sbin/bsdconfig/console/repeat (contents, props changed) stable/9/usr.sbin/bsdconfig/console/saver (contents, props changed) stable/9/usr.sbin/bsdconfig/console/screenmap (contents, props changed) stable/9/usr.sbin/bsdconfig/console/ttys (contents, props changed) stable/9/usr.sbin/bsdconfig/diskmgmt/ stable/9/usr.sbin/bsdconfig/diskmgmt/INDEX (contents, props changed) stable/9/usr.sbin/bsdconfig/diskmgmt/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/diskmgmt/USAGE (contents, props changed) stable/9/usr.sbin/bsdconfig/diskmgmt/diskmgmt (contents, props changed) stable/9/usr.sbin/bsdconfig/diskmgmt/include/ stable/9/usr.sbin/bsdconfig/diskmgmt/include/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/diskmgmt/include/messages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/docsinstall/ stable/9/usr.sbin/bsdconfig/docsinstall/INDEX (contents, props changed) stable/9/usr.sbin/bsdconfig/docsinstall/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/docsinstall/USAGE (contents, props changed) stable/9/usr.sbin/bsdconfig/docsinstall/docsinstall (contents, props changed) stable/9/usr.sbin/bsdconfig/docsinstall/include/ stable/9/usr.sbin/bsdconfig/docsinstall/include/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/docsinstall/include/messages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/dot/ stable/9/usr.sbin/bsdconfig/dot/INDEX (contents, props changed) stable/9/usr.sbin/bsdconfig/dot/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/dot/USAGE (contents, props changed) stable/9/usr.sbin/bsdconfig/dot/dot (contents, props changed) stable/9/usr.sbin/bsdconfig/dot/include/ stable/9/usr.sbin/bsdconfig/dot/include/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/dot/include/messages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/examples/ stable/9/usr.sbin/bsdconfig/examples/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/examples/browse_packages.sh (contents, props changed) stable/9/usr.sbin/bsdconfig/examples/bsdconfigrc (contents, props changed) stable/9/usr.sbin/bsdconfig/fdisk/ stable/9/usr.sbin/bsdconfig/include/ stable/9/usr.sbin/bsdconfig/include/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/include/bsdconfig.hlp (contents, props changed) stable/9/usr.sbin/bsdconfig/include/media.hlp (contents, props changed) stable/9/usr.sbin/bsdconfig/include/messages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/include/network_device.hlp (contents, props changed) stable/9/usr.sbin/bsdconfig/include/options.hlp (contents, props changed) stable/9/usr.sbin/bsdconfig/include/tcp.hlp (contents, props changed) stable/9/usr.sbin/bsdconfig/include/usage.hlp (contents, props changed) stable/9/usr.sbin/bsdconfig/mouse/ stable/9/usr.sbin/bsdconfig/mouse/INDEX (contents, props changed) stable/9/usr.sbin/bsdconfig/mouse/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/mouse/USAGE (contents, props changed) stable/9/usr.sbin/bsdconfig/mouse/disable (contents, props changed) stable/9/usr.sbin/bsdconfig/mouse/enable (contents, props changed) stable/9/usr.sbin/bsdconfig/mouse/flags (contents, props changed) stable/9/usr.sbin/bsdconfig/mouse/include/ stable/9/usr.sbin/bsdconfig/mouse/include/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/mouse/include/messages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/mouse/mouse (contents, props changed) stable/9/usr.sbin/bsdconfig/mouse/port (contents, props changed) stable/9/usr.sbin/bsdconfig/mouse/type (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/ stable/9/usr.sbin/bsdconfig/networking/INDEX (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/USAGE (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/defaultrouter (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/devices (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/hostname (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/include/ stable/9/usr.sbin/bsdconfig/networking/include/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/include/messages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/nameservers (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/networking (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/share/ stable/9/usr.sbin/bsdconfig/networking/share/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/share/common.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/share/device.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/share/hostname.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/share/ipaddr.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/share/media.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/share/netmask.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/share/resolv.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/share/routing.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/networking/share/services.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/packages/ stable/9/usr.sbin/bsdconfig/packages/INDEX (contents, props changed) stable/9/usr.sbin/bsdconfig/packages/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/packages/USAGE (contents, props changed) stable/9/usr.sbin/bsdconfig/packages/include/ stable/9/usr.sbin/bsdconfig/packages/include/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/packages/include/messages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/packages/packages (contents, props changed) stable/9/usr.sbin/bsdconfig/password/ stable/9/usr.sbin/bsdconfig/password/INDEX (contents, props changed) stable/9/usr.sbin/bsdconfig/password/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/password/USAGE (contents, props changed) stable/9/usr.sbin/bsdconfig/password/include/ stable/9/usr.sbin/bsdconfig/password/include/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/password/include/messages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/password/password (contents, props changed) stable/9/usr.sbin/bsdconfig/password/share/ stable/9/usr.sbin/bsdconfig/password/share/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/password/share/password.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/security/ stable/9/usr.sbin/bsdconfig/security/INDEX (contents, props changed) stable/9/usr.sbin/bsdconfig/security/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/security/USAGE (contents, props changed) stable/9/usr.sbin/bsdconfig/security/include/ stable/9/usr.sbin/bsdconfig/security/include/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/security/include/messages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/security/include/securelevel.hlp (contents, props changed) stable/9/usr.sbin/bsdconfig/security/kern_securelevel (contents, props changed) stable/9/usr.sbin/bsdconfig/security/security (contents, props changed) stable/9/usr.sbin/bsdconfig/share/ stable/9/usr.sbin/bsdconfig/share/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/share/common.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/device.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/dialog.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/ stable/9/usr.sbin/bsdconfig/share/media/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/any.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/cdrom.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/common.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/directory.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/dos.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/floppy.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/ftp.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/http.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/httpproxy.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/network.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/nfs.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/options.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/tcpip.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/ufs.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/media/usb.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/mustberoot.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/packages/ stable/9/usr.sbin/bsdconfig/share/packages/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/share/packages/categories.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/packages/index.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/packages/packages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/script.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/strings.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/struct.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/sysrc.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/share/variable.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/ stable/9/usr.sbin/bsdconfig/startup/INDEX (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/USAGE (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/include/ stable/9/usr.sbin/bsdconfig/startup/include/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/include/messages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/misc (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/rcadd (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/rcconf (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/rcdelete (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/rcedit (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/rcvar (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/share/ stable/9/usr.sbin/bsdconfig/startup/share/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/share/rcconf.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/share/rcedit.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/share/rcvar.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/startup/startup (contents, props changed) stable/9/usr.sbin/bsdconfig/timezone/ stable/9/usr.sbin/bsdconfig/timezone/INDEX (contents, props changed) stable/9/usr.sbin/bsdconfig/timezone/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/timezone/USAGE (contents, props changed) stable/9/usr.sbin/bsdconfig/timezone/include/ stable/9/usr.sbin/bsdconfig/timezone/include/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/timezone/include/messages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/timezone/share/ stable/9/usr.sbin/bsdconfig/timezone/share/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/timezone/share/continents.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/timezone/share/countries.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/timezone/share/iso3166.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/timezone/share/menus.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/timezone/share/zones.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/timezone/timezone (contents, props changed) stable/9/usr.sbin/bsdconfig/ttys/ stable/9/usr.sbin/bsdconfig/ttys/INDEX (contents, props changed) stable/9/usr.sbin/bsdconfig/ttys/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/ttys/USAGE (contents, props changed) stable/9/usr.sbin/bsdconfig/ttys/include/ stable/9/usr.sbin/bsdconfig/ttys/include/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/ttys/include/messages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/ttys/ttys (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/ stable/9/usr.sbin/bsdconfig/usermgmt/INDEX (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/USAGE (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/groupadd (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/groupdel (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/groupedit (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/groupinput (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/include/ stable/9/usr.sbin/bsdconfig/usermgmt/include/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/include/messages.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/include/usermgmt.hlp (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/share/ stable/9/usr.sbin/bsdconfig/usermgmt/share/Makefile (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/share/group_input.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/share/user_input.subr (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/useradd (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/userdel (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/useredit (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/userinput (contents, props changed) stable/9/usr.sbin/bsdconfig/usermgmt/usermgmt (contents, props changed) stable/9/usr.sbin/sysrc/ stable/9/usr.sbin/sysrc/Makefile (contents, props changed) stable/9/usr.sbin/sysrc/sysrc (contents, props changed) stable/9/usr.sbin/sysrc/sysrc.8 (contents, props changed) Modified: stable/9/usr.sbin/Makefile Modified: stable/9/usr.sbin/Makefile ============================================================================== --- stable/9/usr.sbin/Makefile Sun Jul 7 19:07:00 2013 (r252994) +++ stable/9/usr.sbin/Makefile Sun Jul 7 19:13:34 2013 (r252995) @@ -7,6 +7,7 @@ SUBDIR= adduser \ arp \ bootparamd \ burncd \ + bsdconfig \ bsdinstall \ cdcontrol \ chkgrp \ @@ -80,6 +81,7 @@ SUBDIR= adduser \ snapinfo \ spray \ syslogd \ + sysrc \ tcpdchk \ tcpdmatch \ tcpdrop \ Added: stable/9/usr.sbin/bsdconfig/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/bsdconfig/Makefile Sun Jul 7 19:13:34 2013 (r252995) @@ -0,0 +1,32 @@ +# $FreeBSD$ + +SUBDIR= console \ + diskmgmt \ + docsinstall \ + dot \ + examples \ + include \ + mouse \ + networking \ + packages \ + password \ + security \ + share \ + startup \ + timezone \ + ttys \ + usermgmt + +FILESDIR= ${LIBEXECDIR}/bsdconfig +FILES= USAGE + +SCRIPTS= bsdconfig + +MAN= bsdconfig.8 + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + mkdir -p ${DESTDIR}${SCRIPTSDIR} + mkdir -p ${DESTDIR}${MANDIR}8 + +.include Added: stable/9/usr.sbin/bsdconfig/USAGE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/bsdconfig/USAGE Sun Jul 7 19:13:34 2013 (r252995) @@ -0,0 +1,47 @@ +# Copyright (c) 2012 Ron McDowell +# Copyright (c) 2012-2013 Devin Teske +# 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$ + +Usage: + @PROGRAM_NAME@ [-h] + @PROGRAM_NAME@ command [-h] + @PROGRAM_NAME@ [OPTIONS] [command [OPTIONS]] + +OPTIONS: + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -f file Load file as script and then exit. If multiple occurrences, + program will only exit after last occurrence. If file is a + single dash (`-'), @PROGRAM_NAME@ reads from standard input. + -h Print this usage statement and exit. + -S Secure X11 mode (implies `-X'). As root, always prompt-for + and validate sudo(8) username/password before starting. + -X Use Xdialog(1) in place of dialog(1). + +COMMANDS: +@COMMAND_LIST@ Added: stable/9/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/bsdconfig/bsdconfig Sun Jul 7 19:13:34 2013 (r252995) @@ -0,0 +1,429 @@ +#!/bin/sh +#- +# Copyright (c) 2012 Ron McDowell +# Copyright (c) 2012-2013 Devin Teske +# 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$ +# +############################################################ INCLUDES + +# When common.subr is included, it automatically scans "$@" for `-d' and/or +# `-D file' arguments to conditionally enable debugging. Similarly, when +# dialog.subr is included, it automatically scans "$@" for `-X' and/or `-S'. +# To prevent this scanning from becoming confused by extra options, define +# any/all extra arguments to use in the optstring to getopts when scanning +# for dedicated options such as those described. +# +# NOTE: This needs to be declared before including `common.subr'. +# NOTE: You really only need to list flags that require an argument as unknown +# flags are silently accepted unless they take an argument (in which case +# the following argument will terminate option processing unless it looks +# like a flag). +# +GETOPTS_EXTRA="f:" + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." "$0" +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/strings.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" +f_include_lang $BSDCFG_LIBE/include/messages.subr + +BSDCONFIG_HELPFILE=$BSDCFG_LIBE/include/bsdconfig.hlp +USAGE_HELPFILE=$BSDCFG_LIBE/include/usage.hlp + +############################################################ CONFIGURATION + +# +# Alternate `local' libexec directory for add-on modules (e.g., from ports) +# +BSDCFG_LOCAL_LIBE="/usr/local/libexec/bsdconfig" + +############################################################ FUNCTIONS + +# usage +# +# display usage and exit +# +usage() +{ + local index="INDEX" + local cmd_list # Calculated below + + cd $BSDCFG_LIBE + # No need to preserve CWD (headed toward exit) + + # Test for language-specific indices + f_quietly ls */"$index.${LANG:-$LC_ALL}" && + index="$index.${LANG:-$LC_ALL}" + + cmd_list=$( + awk '/^menu_selection="/ { + sub(/\|.*/, "") + sub(/^menu_selection="/, "") + print + }' */$index | sort + ) + + local alt_cmd_list # Calculated below (if $BSDCFG_LOCAL_LIBE exists) + if f_quietly cd $BSDCFG_LOCAL_LIBE; then + # No need to preserve CWD (headed toward exit) + + # Test for language-specific indices + f_quietly ls */"$index.${LANG:-$LC_ALL}" && + index="$index.${LANG:-$LC_ALL}" + + alt_cmd_list=$( + awk '/^menu_selection="/ { + sub(/\|.*/, "") + sub(/^menu_selection="/, "") + print + }' */$index 2> /dev/null | sort + ) + + # Conflate lists, removing duplicates + cmd_list=$( printf "%s\n%s\n" \ + "$cmd_list" "$alt_cmd_list" | sort -u ) + fi + + # + # Determine the longest command-length (in characters) + # + local longest_cmd + longest_cmd=$( echo "$cmd_list" | f_longest_line_length ) + f_dprintf "longest_cmd=[%s]" "$longest_cmd" + + # + # Determine the maximum width of terminal/console + # + local max_size="$( stty size 2> /dev/null )" + : ${max_size:="24 80"} + local max_width="${max_size#*[$IFS]}" + f_dprintf "max_width=[%s]" "$max_width" + + # + # Using the longest command-length as the width of a single column, + # determine if we can use more than one column to display commands. + # + local x=$longest_cmd ncols=1 + x=$(( $x + 8 )) # Accomodate leading tab character + x=$(( $x + 3 + $longest_cmd )) # Preload end of next column + while [ $x -lt $max_width ]; do + ncols=$(( $ncols + 1 )) + x=$(( $x + 3 + $longest_cmd )) + done + f_dprintf "ncols=[%u] x=[%u]" $ncols $x + + # + # Re-format the command-list into multiple columns + # + cmd_list=$( eval "$( echo "$cmd_list" | + awk -v ncols=$ncols -v size=$longest_cmd ' + BEGIN { + n = 0 + row_item[1] = "" + } + function print_row() + { + fmt = "printf \"\\t%-" size "s" + for (i = 1; i < cur_col; i++) + fmt = fmt " %-" size "s" + fmt = fmt "\\n\"" + printf "%s", fmt + for (i = 1; i <= cur_col; i++) + printf " \"%s\"", row_item[i] + print "" + } + { + n++ + cur_col = (( n - 1 ) % ncols ) + 1 + printf "f_dprintf \"row_item[%u]=[%%s]\" \"%s\"\n", + cur_col, $0 + row_item[cur_col] = $0 + if ( cur_col == ncols ) print_row() + } + END { + if ( cur_col < ncols ) print_row() + }' )" + ) + + f_usage $BSDCFG_LIBE/USAGE \ + "PROGRAM_NAME" "$pgm" \ + "COMMAND_LIST" "$cmd_list" + + # Never reached +} + +# dialog_menu_main +# +# Display the dialog(1)-based application main menu. +# +dialog_menu_main() +{ + local title="$DIALOG_TITLE" + local btitle="$DIALOG_BACKTITLE" + local prompt="$msg_menu_text" + local menu_list=" + 'X' '$msg_exit' '$msg_exit_bsdconfig' + '1' '$msg_usage' '$msg_quick_start_how_to_use_this_menu_system' + " # END-QUOTE + local defaultitem= # Calculated below + local hline= + + # + # Pick up the base modules (directories named `[0-9][0-9][0-9].*') + # + local menuitem menu_title menu_help menu_selection index=2 + for menuitem in $( cd $BSDCFG_LIBE && ls -d [0-9][0-9][0-9].* ); do + [ -f "$BSDCFG_LIBE/$menuitem/INDEX" ] || continue + [ $index -lt ${#DIALOG_MENU_TAGS} ] || break + + menu_program= menu_title= menu_help= + f_include_lang $BSDCFG_LIBE/$menuitem/INDEX + [ "$menu_program" ] || continue + + case "$menu_program" in + /*) : already fully qualified ;; + *) menu_program="$menuitem/$menu_program" + esac + + tag=$( f_substr "$DIALOG_MENU_TAGS" $index 1 ) + setvar "menu_program$tag" "$menu_program" + + f_shell_escape "$menu_title" menu_title + f_shell_escape "$menu_help" menu_help + menu_list="$menu_list '$tag' '$menu_title' '$menu_help'" + + index=$(( $index + 1 )) + done + + # + # Process the `local' libexec sources. + # + # Whereas modules in $BSDCFG_LIBE must be named [0-9][0-9][0-9].* + # modules in $BSDCFG_LOCAL_LIBE should NOT be named this way (making it + # more practical for port-maintainers). + # + # This also has the fortunate side-effect of making the de-duplication + # effort rather simple (because so-called `base' modules must be named + # differently than add-on modules). + # + local separator_added= + for menuitem in $( cd "$BSDCFG_LOCAL_LIBE" 2> /dev/null && ls -d * ) + do + # Skip the module if it looks like a `base' module + case "$menuitem" in [0-9][0-9][0-9].*) continue;; esac + + [ -f "$BSDCFG_LOCAL_LIBE/$menuitem/INDEX" ] || continue + [ $index -lt ${#DIALOG_MENU_TAGS} ] || break + + menu_program= menu_title= menu_help= + f_include_lang $BSDCFG_LOCAL_LIBE/$menuitem/INDEX || continue + [ "$menu_program" ] || continue + + if [ ! "$separator_added" ]; then + menu_list="$menu_list '-' '-' ''" + separator_added=1 + fi + + case "$menu_program" in + /*) : already fully qualified ;; + *) menu_program="$BSDCFG_LOCAL_LIBE/$menuitem/$menu_program" + esac + + tag=$( f_substr "$DIALOG_MENU_TAGS" $index 1 ) + setvar "menu_program$tag" "$menu_program" + + f_shell_escape "$menu_title" menu_title + f_shell_escape "$menu_help" menu_help + menu_list="$menu_list '$tag' '$menu_title' '$menu_help'" + + index=$(( $index + 1 )) + done + + local height width rows + eval f_dialog_menu_with_help_size height width rows \ + \"\$title\" \ + \"\$btitle\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list + + # Obtain default-item from previously stored selection + f_dialog_default_fetch defaultitem + + local menu_choice + menu_choice=$( eval $DIALOG \ + --clear \ + --title \"\$title\" \ + --backtitle \"\$btitle\" \ + --hline \"\$hline\" \ + --item-help \ + --ok-label \"\$msg_ok\" \ + --cancel-label \"\$msg_exit_bsdconfig\" \ + --help-button \ + --help-label \"\$msg_help\" \ + ${USE_XDIALOG:+--help \"\"} \ + --default-item \"\$defaultitem\" \ + --menu \"\$prompt\" \ + $height $width $rows \ + $menu_list \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" + + # Only update default-item on success + [ $retval -eq 0 ] && f_dialog_default_store "$menu_choice" + + return $retval +} + +############################################################ MAIN + +# +# If $0 is not "bsdconfig", interpret it either as a keyword to a menuitem or +# as a valid resword (see script.subr for additional details about reswords). +# +if [ "$pgm" != "bsdconfig" ]; then + if indexfile=$( f_index_file "$pgm" ) && + cmd=$( f_index_menusel_command "$indexfile" "$pgm" ) + then + f_dprintf "pgm=[%s] indexfile=[%s] cmd=[%s]" \ + "$pgm" "$indexfile" "$cmd" + exec "$cmd" "$@" || exit 1 + else + f_include $BSDCFG_SHARE/script.subr + for resword in $RESWORDS; do + [ "$pgm" = "$resword" ] || continue + # Found a match + f_dprintf "pgm=[%s] A valid resWord!" "$pgm" + f_dispatch $resword + exit $? + done + fi +fi + +# +# Process command-line arguments +# +scripts_loaded=0 +while getopts f:h$GETOPTS_STDARGS flag; do + case "$flag" in + f) [ $scripts_loaded -eq 0 ] && f_include $BSDCFG_SHARE/script.subr + f_script_load "$OPTARG" + scripts_loaded=$(( $scripts_loaded + 1 )) ;; + h|\?) usage ;; + esac +done +shift $(( $OPTIND -1 )) + +# If we've loaded any scripts, do not continue any further +[ $scripts_loaded -gt 0 ] && exit + +# +# Initialize +# +f_dialog_title "$msg_main_menu" + +[ "$SECURE" ] && f_mustberoot_init + +# Incorporate rc-file if it exists +[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" + +# +# If a non-option argument was passed, process it as a menuitem selection... +# +if [ "$1" ]; then + # + # ...unless it's a long-option for usage. + # + case "$1" in -help|--help|-\?) + usage + # Not reached + esac + + # + # Find the INDEX (possibly i18n) claiming this keyword and get the + # command to execute from the menu_selection line. + # + if ! { indexfile=$( f_index_file "$1" ) && + cmd=$( f_index_menusel_command "$indexfile" "$1" ) + }; then + # no matches, display usage (which shows valid keywords) + f_err "%s: %s: $msg_not_found\n" "$pgm" "$1" + usage + # Not reached + fi + + shift + exec $cmd ${USE_XDIALOG:+-X} "$@" || exit 1 + # Not reached +fi + +# +# Launch application main menu +# +while :; do + dialog_menu_main + retval=$? + f_dialog_menutag_fetch mtag + f_dprintf "retval=%u mtag=[%s]" $retval "$mtag" + + if [ $retval -eq 2 ]; then + # The Help button was pressed + f_show_help "$BSDCONFIG_HELPFILE" + continue + elif [ $retval -ne 0 ]; then + f_die + fi + + case "$mtag" in + X) break ;; + 1) # Usage + f_show_help "$USAGE_HELPFILE" + continue + esac + + # Anything else is a dynamically loaded menuitem + + f_getvar menu_program$mtag menu_program + case "$menu_program" in + /*) cmd="$menu_program" ;; + *) cmd="$BSDCFG_LIBE/$menu_program" + esac + f_dprintf "cmd=[%s]" "$cmd" + $cmd ${USE_XDIALOG:+-X} +done + +exit $SUCCESS + +################################################################################ +# END +################################################################################ Added: stable/9/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/bsdconfig/bsdconfig.8 Sun Jul 7 19:13:34 2013 (r252995) @@ -0,0 +1,243 @@ +.\" Copyright (c) 2012 Ron McDowell +.\" Copyright (c) 2012-2013 Devin Teske +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Jun 5, 2013 +.Dt BSDCONFIG 8 +.Os +.Sh NAME +.Nm bsdconfig +.Nd system configuration utility +.Sh SYNOPSIS +.Nm +.Op Fl h +.Nm +.Ar command +.Op Fl h +.Nm +.Op OPTIONS +.Op command Op OPTIONS +.Sh DESCRIPTION +.Nm +is used to set up many system configuration settings, both for new systems, as +well as changing configuration settings of existing systems. +.Pp +.Nm +optionally takes a command as an argument. +If invoked with no arguments, it will bring up an interactive menu listing the +available modules. +.Pp +The following options are available: +.Bl -tag -width indent+ +.It Fl d +Provide lots of debugging info on standard-out when running. +.It Fl D Ar file +Send debugging info to file. +If file begins with a plus-sign debug info is sent to both standard-out and +file (minus the leading plus). +.It Fl f Ar file +Load +.Ar file +as script and then exit. +If multiple occurrences, program will only exit after last occurrence. +If +.Ar file +is a single dash +.Pq Sq Fl , +.Nm +reads from standard input. +.It Fl h +Print usage statement and exit. +.It Fl S +Secure X11 mode +.Pq implies Fl X . +As root, always prompt-for and validate +.Xr sudo 8 +username/password before starting. +.It Fl X +Use +.Xr Xdialog 1 +in place of +.Xr dialog 1 . +.El +.Sh COMMANDS +The following commands +.Pq sorted alphabetically +are currently included in the base +.Nm +program, with more to be added soon. +Other commands can be added, as detailed below in the +.Cm ADDING COMMANDS +section, and once added, will appear in the master menu as well as in the +.Cm -h +listing. +.Bl -tag -width ".Cm syscons_screenmap" +.It Cm console +Utilities to customize the behavior of the system console. +.It Cm defaultrouter +Shortcut to the Default Router/Gateway menu under networking. +.It Cm diskmgmt +Manage disk partitions and/or labels. +Executes +.Xr sade 8 . +.It Cm docsinstall +Executes the +.Cm bsdinstall docsinstall +sub-utility to allow installation/re-installation of the FreeBSD Documentation +set(s). +.It Cm dot +Generate a graphviz +.Xr dot 1 +language file +.Pq printed on stdout +visualizing the +.Nm +menu, include, and shortcut structure relationships. +See +.Dq bsdconfig dot -h +for more details. +.It Cm groupadd +Shortcut to the Add Groups menu under groupmgmt. +.It Cm groupdel +Shortcut to the Delete Groups menu under groupmgmt. +.It Cm groupedit +Shortcut to the Edit/View Groups menu under groupmgmt. +.It Cm groupmgmt +Utilities to Add/Change/View/Delete Group Accounts. +.It Cm hostname +Shortcut to the Hostname/Domain menu under networking. +.It Cm kern_securelevel +Shortcut to the kern.securelevel menu under security. +.It Cm mouse +Utilities for configuring, exploring, and enabling console mouse support. +.It Cm mouse_disable +Shortcut to the Disable menu under mouse. +.It Cm mouse_enable +Shortcut to the Enable menu under mouse. +.It Cm mouse_flags +Shortcut to the Flags menu under mouse. +.It Cm mouse_port +Shortcut to the Port menu under mouse. +.It Cm mouse_type +Shortcut to the Type menu under mouse. +.It Cm nameservers +Shortcut to the DNS Nameservers menu under networking. +.It Cm netdev +Shortcut to the Network Interfaces menu under networking. +.It Cm networking +Utilities to set/change Hostname/Domain, Network Interfaces, Default +Router/Gateway, and DNS Nameservers. +.It Cm packages +Browse, install, uninstall, or re-install packaged software. +.It Cm password +Set the system administrator +.Pq root +password. +.It Cm security +Configure various system security settings. +.It Cm startup +Configure various aspects of system startup. +.It Cm startup_misc +Shortcut to the Miscellaneous Startup Services menu under startup. +.It Cm startup_rcadd +Shortcut to the Add New menu under the View/Edit Startup Configuration menu +(startup_rcconf) of startup. +.It Cm startup_rcconf +Shortcut to the View/Edit Startup Configuration menu under startup. +.It Cm startup_rcdelete +Shortcut to the Delete menu under the View/Edit Startup Configuration menu +(startup_rcconf) of startup. +.It Cm startup_rcvar +Shortcut to the Toggle Startup Services menu under startup. +.It Cm syscons_font +Shortcut to the Font menu under console. +.It Cm syscons_keymap +Shortcut to the Keymap menu under console. +.It Cm syscons_repeat +Shortcut to the Repeat menu under console. +.It Cm syscons_saver +Shortcut to the Saver menu under console. +.It Cm syscons_screenmap +Shortcut to the Screenmap menu under console. +.It Cm syscons_ttys +Shortcut to the Ttys menu under console. +.It Cm timezone +Set the regional timezone of the local machine. +.It Cm ttys +Edit the +.Xr ttys 5 +database with your favorite editor. +.It Cm useradd +Shortcut to the Add Users menu under usermgmt. +.It Cm userdel +Shortcut to the Delete Users menu under usermgmt. +.It Cm useredit +Shortcut to the Edit/View Users menu under usermgmt. +.It Cm usermgmt +Utilities to Add/Edit/View/Delete User Accounts. +.El +.Sh INTERNATIONALIZATION +i18n features are built into +.Nm +and language-specific translation files will be added as they become available. +In the absence of language-specific translation files, the default +.Pq en_US.ISO8859-1 +files will be used. +.Sh ADDING COMMANDS +To be documented later. +Document menu_selection="command|*" syntax of INDEX files. +.Sh ENVIRONMENT VARIABLES +The following environment variables affect the execution of +.Nm : +.Bl -tag -width ".Ev LC_ALL" +.It Ev LANG +If LANG is set, messages and index information will be read from files named +messages.$LANG and INDEX.$LANG and fall back to files named messages and INDEX +if messages.$LANG and INDEX.$LANG do not exist. +LANG takes precedence over LC_ALL. +.It Ev LC_ALL +If LC_ALL is set, messages and index information will be read from files named +messages.$LC_ALL and INDEX.$LC_ALL and fall back to files named messages and +INDEX if messages.$LC_ALL and INDEX.$LC_ALL do not exist. +.El +.Sh FILES +/usr/share/examples/bsdconfig/bsdconfigrc can be copied to $HOME/.bsdconfigrc +and customized as needed. +.Sh EXIT STATUS +.Ex -std +.Sh SEE ALSO +.Xr bsdinstall 8 +.Sh HISTORY +.Nm +first appeared in +.Fx 9.2 . +.Sh AUTHORS +.An Ron McDowell +.An Devin Teske Aq dteske@FreeBSD.org +.Sh BUGS +The docsinstall and diskmgmt modules call bsdinstall. +Bugs found in these modules should be considered those of bsdinstall, not +.Nm . Added: stable/9/usr.sbin/bsdconfig/console/INDEX ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/bsdconfig/console/INDEX Sun Jul 7 19:13:34 2013 (r252995) @@ -0,0 +1,63 @@ +# Copyright (c) 2012 Ron McDowell +# Copyright (c) 2012 Devin Teske +# 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$ + +# +# Title that will be shown in the bsdconfig menu. +# +menu_title="Console" + +# +# A short descriptive line shown at the bottom of the bsdconfig menu. keep it +# short because any line longer than the terminal width will be truncated. +# +menu_help="Customize system console behavior" + +# +# Two-part variable that defines an action to take when `keyword' is passed on +# a bsdconfig command line. Variable takes the form "keyword|command" and +# multiple occurrences of the variable (with different `keyword's, or different +# `keyword's AND `command's) are allowed. If `command' begins with a '/' then +# the full path to the program is needed. If `command' begins with anything +# else it is a path relative to the directory this INDEX file is in. `keyword' +# can be i18n'ed but `command' is the name of a script. +# +menu_selection="console|console" +menu_selection="syscons_font|font" +menu_selection="syscons_keymap|keymap" +menu_selection="syscons_repeat|repeat" +menu_selection="syscons_saver|saver" +menu_selection="syscons_screenmap|screenmap" +menu_selection="syscons_ttys|ttys" + +# +# ------------ Items below this line do NOT need i18n translation ------------ +# +# Name of the program to be run when this menu choice is selected. If it begins +# with a '/' then the full path to the program is needed. If it begins with +# anything else it is a path relative to the directory this INDEX file is in. +# +menu_program="console" Added: stable/9/usr.sbin/bsdconfig/console/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/bsdconfig/console/Makefile Sun Jul 7 19:13:34 2013 (r252995) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +NO_OBJ= + +SUBDIR= include + +FILESDIR= ${LIBEXECDIR}/bsdconfig/080.console +FILES= INDEX USAGE + +SCRIPTSDIR= ${FILESDIR} +SCRIPTS= console font keymap repeat saver screenmap ttys + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + +.include Added: stable/9/usr.sbin/bsdconfig/console/USAGE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/bsdconfig/console/USAGE Sun Jul 7 19:13:34 2013 (r252995) @@ -0,0 +1,37 @@ +# Copyright (c) 2012-2013 Devin Teske +# 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$ + +Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] + +OPTIONS: + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. + -S Secure X11 mode (implies `-X'). As root, always prompt-for + and validate sudo(8) username/password before starting. + -X Use Xdialog(1) in place of dialog(1). Added: stable/9/usr.sbin/bsdconfig/console/console ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/bsdconfig/console/console Sun Jul 7 19:13:34 2013 (r252995) @@ -0,0 +1,146 @@ +#!/bin/sh +#- +# Copyright (c) 2012-2013 Devin Teske +# 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$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." "$0" +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" +f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr + +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" + +############################################################ FUNCTIONS + +# dialog_menu_main +# +# Display the dialog(1)-based application main menu. +# +dialog_menu_main() +{ + local prompt="$msg_console_menu_text" + local menu_list=" + 'X $msg_exit' '$msg_exit_this_menu' + '2 $msg_font' '$msg_choose_alternate_screen_font' + '3 $msg_keymap' '$msg_choose_alternate_keyboard_map' + '4 $msg_repeat' '$msg_set_repeat_rate' + '5 $msg_saver' '$msg_configure_screen_saver' + '6 $msg_screenmap' '$msg_choose_alternate_screenmap' + '7 $msg_ttys' '$msg_choose_console_terminal_type' + " # END-QUOTE + local defaultitem= # Calculated below + local hline="$hline_configure_system_console_settings" + + local height width rows + eval f_dialog_menu_size height width rows \ + \"\$DIALOG_TITLE\" \ + \"\$DIALOG_BACKTITLE\" \ + \"\$prompt\" \ + \"\$hline\" \ + $menu_list + + # Obtain default-item from previously stored selection + f_dialog_default_fetch defaultitem + + local menu_choice + menu_choice=$( eval $DIALOG \ + --title \"\$DIALOG_TITLE\" \ + --backtitle \"\$DIALOG_BACKTITLE\" \ + --hline \"\$hline\" \ + --ok-label \"\$msg_ok\" \ + --cancel-label \"\$msg_cancel\" \ + --default-item \"\$defaultitem\" \ + --menu \"\$prompt\" \ + $height $width $rows \ + $menu_list \ + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + f_dialog_data_sanitize menu_choice + f_dialog_menutag_store "$menu_choice" + f_dialog_default_store "$menu_choice" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 19:19:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CC4711F6; Sun, 7 Jul 2013 19:19:18 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BF368112E; Sun, 7 Jul 2013 19:19:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67JJI9s005390; Sun, 7 Jul 2013 19:19:18 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67JJI4x005389; Sun, 7 Jul 2013 19:19:18 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307071919.r67JJI4x005389@svn.freebsd.org> From: Rui Paulo Date: Sun, 7 Jul 2013 19:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252996 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 19:19:18 -0000 Author: rpaulo Date: Sun Jul 7 19:19:18 2013 New Revision: 252996 URL: http://svnweb.freebsd.org/changeset/base/252996 Log: Fix all the compiler warnings in elf_trampoline.c. Modified: head/sys/arm/arm/elf_trampoline.c Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Sun Jul 7 19:13:34 2013 (r252995) +++ head/sys/arm/arm/elf_trampoline.c Sun Jul 7 19:19:18 2013 (r252996) @@ -49,51 +49,67 @@ void _start(void); void __start(void); void __startC(void); +extern unsigned int cpufunc_id(void); +extern void armv6_idcache_wbinv_all(void); +extern void do_call(void *, void *, void *, int); + #define GZ_HEAD 0xa #ifdef CPU_ARM7TDMI #define cpu_idcache_wbinv_all arm7tdmi_cache_flushID +extern void arm7tdmi_cache_flushID(void); #elif defined(CPU_ARM8) #define cpu_idcache_wbinv_all arm8_cache_purgeID +extern void arm8_cache_purgeID(void); #elif defined(CPU_ARM9) #define cpu_idcache_wbinv_all arm9_idcache_wbinv_all +extern void arm9_idcache_wbinv_all(void); #elif defined(CPU_FA526) || defined(CPU_FA626TE) #define cpu_idcache_wbinv_all fa526_idcache_wbinv_all +extern void fa526_idcache_wbinv_all(void); #elif defined(CPU_ARM9E) #define cpu_idcache_wbinv_all armv5_ec_idcache_wbinv_all +extern void armv5_ec_idcache_wbinv_all(void); #elif defined(CPU_ARM10) #define cpu_idcache_wbinv_all arm10_idcache_wbinv_all +extern void arm10_idcache_wbinv_all(void); #elif defined(CPU_ARM1136) || defined(CPU_ARM1176) #define cpu_idcache_wbinv_all armv6_idcache_wbinv_all #elif defined(CPU_SA110) || defined(CPU_SA1110) || defined(CPU_SA1100) || \ defined(CPU_IXP12X0) #define cpu_idcache_wbinv_all sa1_cache_purgeID +extern void sa1_cache_purgeID(void); #elif defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ defined(CPU_XSCALE_80219) #define cpu_idcache_wbinv_all xscale_cache_purgeID +extern void xscale_cache_purgeID(void); #elif defined(CPU_XSCALE_81342) #define cpu_idcache_wbinv_all xscalec3_cache_purgeID +extern void xscalec3_cache_purgeID(void); #elif defined(CPU_MV_PJ4B) #if !defined(SOC_MV_ARMADAXP) #define cpu_idcache_wbinv_all armv6_idcache_wbinv_all +extern void armv6_idcache_wbinv_all(void); #else #define cpu_idcache_wbinv_all() armadaxp_idcache_wbinv_all +extern void armadaxp_idcache_wbinv_all(void); #endif #endif /* CPU_MV_PJ4B */ #ifdef CPU_XSCALE_81342 #define cpu_l2cache_wbinv_all xscalec3_l2cache_purge +extern void xscalec3_l2cache_purge(void); #elif defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY) #define cpu_l2cache_wbinv_all sheeva_l2cache_wbinv_all +extern void sheeva_l2cache_wbinv_all(void); #elif defined(CPU_CORTEXA) #define cpu_idcache_wbinv_all armv7_idcache_wbinv_all +extern void armv7_idcache_wbinv_all(void); #define cpu_l2cache_wbinv_all() #else #define cpu_l2cache_wbinv_all() #endif -static void armadaxp_idcache_wbinv_all(void); - int arm_picache_size; int arm_picache_line_size; int arm_picache_ways; @@ -434,11 +450,11 @@ static void * inflate_kernel(void *kernel, void *startaddr) { struct inflate infl; - char slide[GZ_WSIZE]; + unsigned char slide[GZ_WSIZE]; orig_input = kernel; memcnt = memtot = 0; - i_input = (char *)kernel + GZ_HEAD; + i_input = (unsigned char *)kernel + GZ_HEAD; if (((char *)kernel)[3] & 0x18) { while (*i_input) i_input++; @@ -590,6 +606,8 @@ load_kernel(unsigned int kstart, unsigne __asm __volatile(".globl func_end\n" "func_end:"); + /* NOTREACHED */ + return NULL; } extern char func_end[]; From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 19:22:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3E051362; Sun, 7 Jul 2013 19:22:32 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 304D11144; Sun, 7 Jul 2013 19:22:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67JMWWI007529; Sun, 7 Jul 2013 19:22:32 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67JMWrG007528; Sun, 7 Jul 2013 19:22:32 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307071922.r67JMWrG007528@svn.freebsd.org> From: Rui Paulo Date: Sun, 7 Jul 2013 19:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252997 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 19:22:32 -0000 Author: rpaulo Date: Sun Jul 7 19:22:31 2013 New Revision: 252997 URL: http://svnweb.freebsd.org/changeset/base/252997 Log: armadaxp_idcache_wbinv_all() is in this file. Modified: head/sys/arm/arm/elf_trampoline.c Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Sun Jul 7 19:19:18 2013 (r252996) +++ head/sys/arm/arm/elf_trampoline.c Sun Jul 7 19:22:31 2013 (r252997) @@ -93,7 +93,6 @@ extern void xscalec3_cache_purgeID(void) extern void armv6_idcache_wbinv_all(void); #else #define cpu_idcache_wbinv_all() armadaxp_idcache_wbinv_all -extern void armadaxp_idcache_wbinv_all(void); #endif #endif /* CPU_MV_PJ4B */ #ifdef CPU_XSCALE_81342 @@ -110,6 +109,8 @@ extern void armv7_idcache_wbinv_all(void #define cpu_l2cache_wbinv_all() #endif +static void armadaxp_idcache_wbinv_all(void); + int arm_picache_size; int arm_picache_line_size; int arm_picache_ways; From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 19:47:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C693686D; Sun, 7 Jul 2013 19:47:23 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9FB0D1205; Sun, 7 Jul 2013 19:47:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67JlNqW013810; Sun, 7 Jul 2013 19:47:23 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67JlNZ6013809; Sun, 7 Jul 2013 19:47:23 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307071947.r67JlNZ6013809@svn.freebsd.org> From: Rui Paulo Date: Sun, 7 Jul 2013 19:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252998 - head/sys/dev/mbox X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 19:47:23 -0000 Author: rpaulo Date: Sun Jul 7 19:47:22 2013 New Revision: 252998 URL: http://svnweb.freebsd.org/changeset/base/252998 Log: Add a mailbox interface. Mailboxes are an IPC mechanism found on several ARM architectures, namely OMAP4, BCM2385, Sitara, etc. Reviewed by: gonzo Added: head/sys/dev/mbox/ head/sys/dev/mbox/mbox_if.m (contents, props changed) Added: head/sys/dev/mbox/mbox_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mbox/mbox_if.m Sun Jul 7 19:47:22 2013 (r252998) @@ -0,0 +1,46 @@ +#- +# Copyright (c) 2013 Rui Paulo +# 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$ +# +# Mailboxes are used as an IPC mechanism that allows subsystems to +# communicate with each other. +# A system can have multiple mailboxes (e.g. OMAP4) but there's usually a +# system wide mailbox. +# + +INTERFACE mbox; + +METHOD int read { + device_t dev; + int channel; + uint32_t *data; +}; + +METHOD int write { + device_t dev; + int channel; + uint32_t data; +}; From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 19:48:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6A4679B2; Sun, 7 Jul 2013 19:48:26 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from felyko.com (felyko.com [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 57DD31210; Sun, 7 Jul 2013 19:48:26 +0000 (UTC) Received: from [IPv6:2601:9:4d00:119:b446:8df4:1336:11e1] (unknown [IPv6:2601:9:4d00:119:b446:8df4:1336:11e1]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 7E5A63982B; Sun, 7 Jul 2013 12:48:25 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: svn commit: r252998 - head/sys/dev/mbox From: Rui Paulo In-Reply-To: <201307071947.r67JlNZ6013809@svn.freebsd.org> Date: Sun, 7 Jul 2013 12:48:24 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201307071947.r67JlNZ6013809@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.1508) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 19:48:26 -0000 On 7 Jul 2013, at 12:47, Rui Paulo wrote: > Author: rpaulo > Date: Sun Jul 7 19:47:22 2013 > New Revision: 252998 > URL: http://svnweb.freebsd.org/changeset/base/252998 >=20 > Log: > Add a mailbox interface. >=20 > Mailboxes are an IPC mechanism found on several ARM architectures, = namely > OMAP4, BCM2385, Sitara, etc. Although currently only specific to ARM, Mailboxes can be used by = multiple architectures and that's why I committed it to sys/dev. -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 20:39:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7C7C9B6F; Sun, 7 Jul 2013 20:39:12 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6E46115C4; Sun, 7 Jul 2013 20:39:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67KdCQu028909; Sun, 7 Jul 2013 20:39:12 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67KdCdR028908; Sun, 7 Jul 2013 20:39:12 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201307072039.r67KdCdR028908@svn.freebsd.org> From: Alfred Perlstein Date: Sun, 7 Jul 2013 20:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253002 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 20:39:12 -0000 Author: alfred Date: Sun Jul 7 20:39:11 2013 New Revision: 253002 URL: http://svnweb.freebsd.org/changeset/base/253002 Log: Document tip on how to build all kernels quickly. Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sun Jul 7 19:58:14 2013 (r253001) +++ head/Makefile Sun Jul 7 20:39:11 2013 (r253002) @@ -32,6 +32,12 @@ # targets - Print a list of supported TARGET/TARGET_ARCH pairs # for world and kernel targets. # toolchains - Build a toolchain for all world and kernel targets. +# +# "quick" way to test all kernel builds: +# _jflag=`sysctl -n hw.ncpu` +# _jflag=$(($_jflag * 2)) +# [ $_jflag -gt 12 ] && _jflag=12 +# make universe -DMAKE_JUST_KERNELS JFLAG=${jflag} # # This makefile is simple by design. The FreeBSD make automatically reads # the /usr/share/mk/sys.mk unless the -m argument is specified on the From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 20:44:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1DBCDCE2; Sun, 7 Jul 2013 20:44:05 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 100AF15E9; Sun, 7 Jul 2013 20:44:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67Ki4qm031147; Sun, 7 Jul 2013 20:44:04 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67Ki4Mk031146; Sun, 7 Jul 2013 20:44:04 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201307072044.r67Ki4Mk031146@svn.freebsd.org> From: Alfred Perlstein Date: Sun, 7 Jul 2013 20:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253003 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 20:44:05 -0000 Author: alfred Date: Sun Jul 7 20:44:04 2013 New Revision: 253003 URL: http://svnweb.freebsd.org/changeset/base/253003 Log: Correct typo specifying jflags. Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sun Jul 7 20:39:11 2013 (r253002) +++ head/Makefile Sun Jul 7 20:44:04 2013 (r253003) @@ -37,7 +37,7 @@ # _jflag=`sysctl -n hw.ncpu` # _jflag=$(($_jflag * 2)) # [ $_jflag -gt 12 ] && _jflag=12 -# make universe -DMAKE_JUST_KERNELS JFLAG=${jflag} +# make universe -DMAKE_JUST_KERNELS JFLAG=-j${_jflag} # # This makefile is simple by design. The FreeBSD make automatically reads # the /usr/share/mk/sys.mk unless the -m argument is specified on the From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 21:01:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 20C6E14B; Sun, 7 Jul 2013 21:01:08 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ye0-x22f.google.com (mail-ye0-x22f.google.com [IPv6:2607:f8b0:4002:c04::22f]) by mx1.freebsd.org (Postfix) with ESMTP id ACC38167D; Sun, 7 Jul 2013 21:01:07 +0000 (UTC) Received: by mail-ye0-f175.google.com with SMTP id q8so1451012yen.34 for ; Sun, 07 Jul 2013 14:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=ub32QaFqIo58U6Xr1+9aH+gInBfH8XEW1C0Yz3hk4aI=; b=m6AOlX3yGMsuuuziLJzVXCG7MuIaMt1ngGV47cGkfdUZLQW7H0OxpLkBeXP6kZzPub M967xP25ryCHGVPqCLqJzDQhc3qByHAVbyDh2+CWqZ4Xb/nNRhkR9F0pB8qXovCLeavq O7kPbfpNcEyRNsaX8VOovu/lDSnc9EPITEQ9+wxXoBZsqDnPNgPm+w6xOlDW3KrKyUre R7oc1aA0j27jTNQcrdjH27jIEEgr7pdxvBaPCXBSjb914oYAi106Nt9VWgNkikJ4UmPg 6AJ5PBYxegsK4Sxxz7G392+XmbaZYwnNVN4Qv1l7Ot2/JTMdXfuQwYdup4hwXLhos8/t g2Iw== X-Received: by 10.236.6.138 with SMTP id 10mr10652637yhn.137.1373230867237; Sun, 07 Jul 2013 14:01:07 -0700 (PDT) Received: from [10.81.248.182] (mobile-166-147-109-067.mycingular.net. [166.147.109.67]) by mx.google.com with ESMTPSA id a62sm31688910yhk.4.2013.07.07.14.01.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 07 Jul 2013 14:01:06 -0700 (PDT) References: <201307072039.r67KdCdR028908@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201307072039.r67KdCdR028908@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <9D4C7540-A3B0-45E5-8219-6A455D41DF70@gmail.com> X-Mailer: iPhone Mail (10B329) From: Garrett Cooper Subject: Re: svn commit: r253002 - head Date: Sun, 7 Jul 2013 14:01:01 -0700 To: Alfred Perlstein Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 21:01:08 -0000 Why the magic number 12? Sent from my iPhone On Jul 7, 2013, at 1:39 PM, Alfred Perlstein wrote: > Author: alfred > Date: Sun Jul 7 20:39:11 2013 > New Revision: 253002 > URL: http://svnweb.freebsd.org/changeset/base/253002 >=20 > Log: > Document tip on how to build all kernels quickly. >=20 > Modified: > head/Makefile >=20 > Modified: head/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/Makefile Sun Jul 7 19:58:14 2013 (r253001) > +++ head/Makefile Sun Jul 7 20:39:11 2013 (r253002) > @@ -32,6 +32,12 @@ > # targets - Print a list of supported TARGET/TARGET_ARCH pairs= > # for world and kernel targets. > # toolchains - Build a toolchain for all world and kernel targets= . > +#=20 > +# "quick" way to test all kernel builds: > +# _jflag=3D`sysctl -n hw.ncpu` > +# _jflag=3D$(($_jflag * 2)) > +# [ $_jflag -gt 12 ] && _jflag=3D12 > +# make universe -DMAKE_JUST_KERNELS JFLAG=3D${jflag} > # > # This makefile is simple by design. The FreeBSD make automatically reads > # the /usr/share/mk/sys.mk unless the -m argument is specified on the > _______________________________________________ > 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" From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 21:15:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1312F39A; Sun, 7 Jul 2013 21:15:03 +0000 (UTC) (envelope-from alfred@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 00C0616E5; Sun, 7 Jul 2013 21:15:02 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id F235E1A3C1A; Sun, 7 Jul 2013 14:15:01 -0700 (PDT) Message-ID: <51D9DA55.2090808@freebsd.org> Date: Sun, 07 Jul 2013 14:15:01 -0700 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Garrett Cooper Subject: Re: svn commit: r253002 - head References: <201307072039.r67KdCdR028908@svn.freebsd.org> <9D4C7540-A3B0-45E5-8219-6A455D41DF70@gmail.com> In-Reply-To: <9D4C7540-A3B0-45E5-8219-6A455D41DF70@gmail.com> 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" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 21:15:03 -0000 On 7/7/13 2:01 PM, Garrett Cooper wrote: > Why the magic number 12? Numbers higher seem to result in worse performance as reported by some members of my team. -Alfred > > Sent from my iPhone > > On Jul 7, 2013, at 1:39 PM, Alfred Perlstein wrote: > >> Author: alfred >> Date: Sun Jul 7 20:39:11 2013 >> New Revision: 253002 >> URL: http://svnweb.freebsd.org/changeset/base/253002 >> >> Log: >> Document tip on how to build all kernels quickly. >> >> Modified: >> head/Makefile >> >> Modified: head/Makefile >> ============================================================================== >> --- head/Makefile Sun Jul 7 19:58:14 2013 (r253001) >> +++ head/Makefile Sun Jul 7 20:39:11 2013 (r253002) >> @@ -32,6 +32,12 @@ >> # targets - Print a list of supported TARGET/TARGET_ARCH pairs >> # for world and kernel targets. >> # toolchains - Build a toolchain for all world and kernel targets. >> +# >> +# "quick" way to test all kernel builds: >> +# _jflag=`sysctl -n hw.ncpu` >> +# _jflag=$(($_jflag * 2)) >> +# [ $_jflag -gt 12 ] && _jflag=12 >> +# make universe -DMAKE_JUST_KERNELS JFLAG=${jflag} >> # >> # This makefile is simple by design. The FreeBSD make automatically reads >> # the /usr/share/mk/sys.mk unless the -m argument is specified on the >> _______________________________________________ >> 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" From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 21:19:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 341C4529; Sun, 7 Jul 2013 21:19:54 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 14F05170C; Sun, 7 Jul 2013 21:19:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67LJru0040766; Sun, 7 Jul 2013 21:19:53 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67LJrBS040765; Sun, 7 Jul 2013 21:19:53 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201307072119.r67LJrBS040765@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 7 Jul 2013 21:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253004 - head/contrib/tcpdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 21:19:54 -0000 Author: pjd Date: Sun Jul 7 21:19:53 2013 New Revision: 253004 URL: http://svnweb.freebsd.org/changeset/base/253004 Log: Sandbox tcpdump(8) using Capsicum's capability mode and capabilities. For now, sandboxing is done only if -n option was specified and neither -z nor -V options were given. Because it is very common to run tcpdump(8) with the -n option for speed, I decided to commit sandboxing now. To also support sandboxing when -n option wasn't specified, we need Casper daemon and its services that are not available in FreeBSD yet. - Limit file descriptors of a file specified by -r option or files specified via -V option to CAP_READ only. - If neither -r nor -V options were specified, we operate on /dev/bpf. Limit its descriptor to CAP_READ and CAP_IOCTL plus limit allowed ioctls to BIOCGSTATS only. - Limit file descriptor of a file specified by -w option to CAP_SEEK and CAP_WRITE. - If either -C or -G options were specified, we open directory containing destination file and we limit directory descriptor to CAP_CREATE, CAP_FCNTL, CAP_FTRUNCATE, CAP_LOOKUP, CAP_SEEK and CAP_WRITE. Newly opened/created files are limited to CAP_SEEK and CAP_WRITE only. - Enter capability mode if -n option was specified and neither -z nor -V options were specified. Approved by: delphij, wxs Sponsored by: The FreeBSD Foundation Modified: head/contrib/tcpdump/tcpdump.c Modified: head/contrib/tcpdump/tcpdump.c ============================================================================== --- head/contrib/tcpdump/tcpdump.c Sun Jul 7 20:44:04 2013 (r253003) +++ head/contrib/tcpdump/tcpdump.c Sun Jul 7 21:19:53 2013 (r253004) @@ -68,6 +68,13 @@ extern int SIZE_BUF; #include #include #include +#ifdef __FreeBSD__ +#include +#include +#include +#include +#include +#endif /* __FreeBSD__ */ #ifndef WIN32 #include #include @@ -384,6 +391,9 @@ struct dump_info { char *CurrentFileName; pcap_t *pd; pcap_dumper_t *p; +#ifdef __FreeBSD__ + int dirfd; +#endif }; #ifdef HAVE_PCAP_SET_TSTAMP_TYPE @@ -702,6 +712,10 @@ main(int argc, char **argv) #endif int status; FILE *VFile; +#ifdef __FreeBSD__ + int cansandbox; +#endif + #ifdef WIN32 if(wsockinit() != 0) return 1; #endif /* WIN32 */ @@ -1189,6 +1203,12 @@ main(int argc, char **argv) pd = pcap_open_offline(RFileName, ebuf); if (pd == NULL) error("%s", ebuf); +#ifdef __FreeBSD__ + if (cap_rights_limit(fileno(pcap_file(pd)), CAP_READ) < 0 && + errno != ENOSYS) { + error("unable to limit pcap descriptor"); + } +#endif dlt = pcap_datalink(pd); dlt_name = pcap_datalink_val_to_name(dlt); if (dlt_name == NULL) { @@ -1437,6 +1457,20 @@ main(int argc, char **argv) if (pcap_setfilter(pd, &fcode) < 0) error("%s", pcap_geterr(pd)); +#ifdef __FreeBSD__ + if (RFileName == NULL && VFileName == NULL) { + static const unsigned long cmds[] = { BIOCGSTATS }; + + if (cap_rights_limit(pcap_fileno(pd), + CAP_IOCTL | CAP_READ) < 0 && errno != ENOSYS) { + error("unable to limit pcap descriptor"); + } + if (cap_ioctls_limit(pcap_fileno(pd), cmds, + sizeof(cmds) / sizeof(cmds[0])) < 0 && errno != ENOSYS) { + error("unable to limit ioctls on pcap descriptor"); + } + } +#endif if (WFileName) { pcap_dumper_t *p; /* Do not exceed the default PATH_MAX for files. */ @@ -1458,9 +1492,30 @@ main(int argc, char **argv) #endif if (p == NULL) error("%s", pcap_geterr(pd)); +#ifdef __FreeBSD__ + if (cap_rights_limit(fileno(pcap_dump_file(p)), + CAP_SEEK | CAP_WRITE) < 0 && errno != ENOSYS) { + error("unable to limit dump descriptor"); + } +#endif if (Cflag != 0 || Gflag != 0) { - callback = dump_packet_and_trunc; +#ifdef __FreeBSD__ + dumpinfo.WFileName = strdup(basename(WFileName)); + dumpinfo.dirfd = open(dirname(WFileName), + O_DIRECTORY | O_RDONLY); + if (dumpinfo.dirfd < 0) { + error("unable to open directory %s", + dirname(WFileName)); + } + if (cap_rights_limit(dumpinfo.dirfd, CAP_CREATE | + CAP_FCNTL | CAP_FTRUNCATE | CAP_LOOKUP | CAP_SEEK | + CAP_WRITE) < 0 && errno != ENOSYS) { + error("unable to limit directory rights"); + } +#else /* !__FreeBSD__ */ dumpinfo.WFileName = WFileName; +#endif + callback = dump_packet_and_trunc; dumpinfo.pd = pd; dumpinfo.p = p; pcap_userdata = (u_char *)&dumpinfo; @@ -1530,6 +1585,15 @@ main(int argc, char **argv) (void)fflush(stderr); } #endif /* WIN32 */ + +#ifdef __FreeBSD__ + cansandbox = (nflag && VFileName == NULL && zflag == NULL); + if (cansandbox && cap_enter() < 0 && errno != ENOSYS) + error("unable to enter the capability mode"); + if (cap_sandboxed()) + fprintf(stderr, "capability mode sandbox enabled\n"); +#endif + do { status = pcap_loop(pd, cnt, callback, pcap_userdata); if (WFileName == NULL) { @@ -1569,6 +1633,12 @@ main(int argc, char **argv) pd = pcap_open_offline(RFileName, ebuf); if (pd == NULL) error("%s", ebuf); +#ifdef __FreeBSD__ + if (cap_rights_limit(fileno(pcap_file(pd)), + CAP_READ) < 0 && errno != ENOSYS) { + error("unable to limit pcap descriptor"); + } +#endif new_dlt = pcap_datalink(pd); if (WFileName && new_dlt != dlt) error("%s: new dlt does not match original", RFileName); @@ -1765,6 +1835,11 @@ dump_packet_and_trunc(u_char *user, cons /* If the time is greater than the specified window, rotate */ if (t - Gflag_time >= Gflag) { +#ifdef __FreeBSD__ + FILE *fp; + int fd; +#endif + /* Update the Gflag_time */ Gflag_time = t; /* Update Gflag_count */ @@ -1811,13 +1886,35 @@ dump_packet_and_trunc(u_char *user, cons capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE); capng_apply(CAPNG_EFFECTIVE); #endif /* HAVE_CAP_NG_H */ +#ifdef __FreeBSD__ + fd = openat(dump_info->dirfd, + dump_info->CurrentFileName, + O_CREAT | O_WRONLY | O_TRUNC, 0644); + if (fd < 0) { + error("unable to open file %s", + dump_info->CurrentFileName); + } + fp = fdopen(fd, "w"); + if (fp == NULL) { + error("unable to fdopen file %s", + dump_info->CurrentFileName); + } + dump_info->p = pcap_dump_fopen(dump_info->pd, fp); +#else /* !__FreeBSD__ */ dump_info->p = pcap_dump_open(dump_info->pd, dump_info->CurrentFileName); +#endif #ifdef HAVE_CAP_NG_H capng_update(CAPNG_DROP, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE); capng_apply(CAPNG_EFFECTIVE); #endif /* HAVE_CAP_NG_H */ if (dump_info->p == NULL) error("%s", pcap_geterr(pd)); +#ifdef __FreeBSD__ + if (cap_rights_limit(fileno(pcap_dump_file(dump_info->p)), + CAP_SEEK | CAP_WRITE) < 0 && errno != ENOSYS) { + error("unable to limit dump descriptor"); + } +#endif } } @@ -1827,6 +1924,11 @@ dump_packet_and_trunc(u_char *user, cons * file could put it over Cflag. */ if (Cflag != 0 && pcap_dump_ftell(dump_info->p) > Cflag) { +#ifdef __FreeBSD__ + FILE *fp; + int fd; +#endif + /* * Close the current file and open a new one. */ @@ -1849,9 +1951,30 @@ dump_packet_and_trunc(u_char *user, cons if (dump_info->CurrentFileName == NULL) error("dump_packet_and_trunc: malloc"); MakeFilename(dump_info->CurrentFileName, dump_info->WFileName, Cflag_count, WflagChars); +#ifdef __FreeBSD__ + fd = openat(dump_info->dirfd, dump_info->CurrentFileName, + O_CREAT | O_WRONLY | O_TRUNC, 0644); + if (fd < 0) { + error("unable to open file %s", + dump_info->CurrentFileName); + } + fp = fdopen(fd, "w"); + if (fp == NULL) { + error("unable to fdopen file %s", + dump_info->CurrentFileName); + } + dump_info->p = pcap_dump_fopen(dump_info->pd, fp); +#else /* !__FreeBSD__ */ dump_info->p = pcap_dump_open(dump_info->pd, dump_info->CurrentFileName); +#endif if (dump_info->p == NULL) error("%s", pcap_geterr(pd)); +#ifdef __FreeBSD__ + if (cap_rights_limit(fileno(pcap_dump_file(dump_info->p)), + CAP_SEEK | CAP_WRITE) < 0 && errno != ENOSYS) { + error("unable to limit dump descriptor"); + } +#endif } pcap_dump((u_char *)dump_info->p, h, sp); From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 21:20:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0708B673; Sun, 7 Jul 2013 21:20:53 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ECA66171B; Sun, 7 Jul 2013 21:20:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67LKqk3042543; Sun, 7 Jul 2013 21:20:52 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67LKqwP042542; Sun, 7 Jul 2013 21:20:52 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307072120.r67LKqwP042542@svn.freebsd.org> From: Rui Paulo Date: Sun, 7 Jul 2013 21:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253005 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 21:20:53 -0000 Author: rpaulo Date: Sun Jul 7 21:20:52 2013 New Revision: 253005 URL: http://svnweb.freebsd.org/changeset/base/253005 Log: Another warning. Modified: head/sys/arm/arm/elf_trampoline.c Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Sun Jul 7 21:19:53 2013 (r253004) +++ head/sys/arm/arm/elf_trampoline.c Sun Jul 7 21:20:52 2013 (r253005) @@ -51,6 +51,7 @@ void __startC(void); extern unsigned int cpufunc_id(void); extern void armv6_idcache_wbinv_all(void); +extern void armv7_idcache_wbinv_all(void); extern void do_call(void *, void *, void *, int); #define GZ_HEAD 0xa @@ -103,7 +104,6 @@ extern void xscalec3_l2cache_purge(void) extern void sheeva_l2cache_wbinv_all(void); #elif defined(CPU_CORTEXA) #define cpu_idcache_wbinv_all armv7_idcache_wbinv_all -extern void armv7_idcache_wbinv_all(void); #define cpu_l2cache_wbinv_all() #else #define cpu_l2cache_wbinv_all() From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 21:23:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A6B5A7C6; Sun, 7 Jul 2013 21:23:59 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 97C18172F; Sun, 7 Jul 2013 21:23:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67LNxOM042965; Sun, 7 Jul 2013 21:23:59 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67LNwUb042958; Sun, 7 Jul 2013 21:23:58 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307072123.r67LNwUb042958@svn.freebsd.org> From: Rui Paulo Date: Sun, 7 Jul 2013 21:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253006 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 21:23:59 -0000 Author: rpaulo Date: Sun Jul 7 21:23:58 2013 New Revision: 253006 URL: http://svnweb.freebsd.org/changeset/base/253006 Log: Convert bcm2835_mbox to the new mbox interface. Reviewed by: gonzo Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c head/sys/arm/broadcom/bcm2835/bcm2835_mbox.h head/sys/arm/broadcom/bcm2835/files.bcm2835 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Sun Jul 7 21:20:52 2013 (r253005) +++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c Sun Jul 7 21:23:58 2013 (r253006) @@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "mbox_if.h" + #define BCMFB_FONT_HEIGHT 16 struct argb { @@ -173,6 +175,7 @@ bcm_fb_init(void *arg) volatile struct bcm_fb_config* fb_config = sc->fb_config; phandle_t node; pcell_t cell; + device_t mbox; node = ofw_bus_get_node(sc->dev); @@ -205,8 +208,12 @@ bcm_fb_init(void *arg) bus_dmamap_sync(sc->dma_tag, sc->dma_map, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); - bcm_mbox_write(BCM2835_MBOX_CHAN_FB, sc->fb_config_phys); - bcm_mbox_read(BCM2835_MBOX_CHAN_FB, &err); + + mbox = devclass_get_device(devclass_find("mbox"), 0); + if (mbox) { + MBOX_WRITE(mbox, BCM2835_MBOX_CHAN_FB, sc->fb_config_phys); + MBOX_READ(mbox, BCM2835_MBOX_CHAN_FB, &err); + } bus_dmamap_sync(sc->dma_tag, sc->dma_map, BUS_DMASYNC_POSTREAD); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Sun Jul 7 21:20:52 2013 (r253005) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Sun Jul 7 21:23:58 2013 (r253006) @@ -49,8 +49,11 @@ __FBSDID("$FreeBSD$"); #include #include + #include +#include "mbox_if.h" + #define REG_READ 0x00 #define REG_POL 0x10 #define REG_SENDER 0x14 @@ -65,12 +68,12 @@ __FBSDID("$FreeBSD$"); #define MBOX_CHAN(msg) ((msg) & 0xf) #define MBOX_DATA(msg) ((msg) & ~0xf) -#define MBOX_LOCK do { \ - mtx_lock(&bcm_mbox_sc->lock); \ +#define MBOX_LOCK(sc) do { \ + mtx_lock(&(sc)->lock); \ } while(0) -#define MBOX_UNLOCK do { \ - mtx_unlock(&bcm_mbox_sc->lock); \ +#define MBOX_UNLOCK(sc) do { \ + mtx_unlock(&(sc)->lock); \ } while(0) #ifdef DEBUG @@ -90,12 +93,10 @@ struct bcm_mbox_softc { int msg[BCM2835_MBOX_CHANS]; }; -static struct bcm_mbox_softc *bcm_mbox_sc = NULL; - -#define mbox_read_4(reg) \ - bus_space_read_4(bcm_mbox_sc->bst, bcm_mbox_sc->bsh, reg) -#define mbox_write_4(reg, val) \ - bus_space_write_4(bcm_mbox_sc->bst, bcm_mbox_sc->bsh, reg, val) +#define mbox_read_4(sc, reg) \ + bus_space_read_4((sc)->bst, (sc)->bsh, reg) +#define mbox_write_4(sc, reg, val) \ + bus_space_write_4((sc)->bst, (sc)->bsh, reg, val) static void bcm_mbox_intr(void *arg) @@ -105,9 +106,9 @@ bcm_mbox_intr(void *arg) uint32_t data; uint32_t msg; - MBOX_LOCK; - while (!(mbox_read_4(REG_STATUS) & STATUS_EMPTY)) { - msg = mbox_read_4(REG_READ); + MBOX_LOCK(sc); + while (!(mbox_read_4(sc, REG_STATUS) & STATUS_EMPTY)) { + msg = mbox_read_4(sc, REG_READ); dprintf("bcm_mbox_intr: raw data %08x\n", msg); chan = MBOX_CHAN(msg); data = MBOX_DATA(msg); @@ -121,7 +122,7 @@ bcm_mbox_intr(void *arg) wakeup(&sc->msg[chan]); } - MBOX_UNLOCK; + MBOX_UNLOCK(sc); } static int @@ -143,9 +144,6 @@ bcm_mbox_attach(device_t dev) int i; int rid = 0; - if (bcm_mbox_sc != NULL) - return (EINVAL); - sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->mem_res == NULL) { device_printf(dev, "could not allocate memory resource\n"); @@ -176,72 +174,76 @@ bcm_mbox_attach(device_t dev) sc->msg[0] = 0; } - bcm_mbox_sc = sc; /* Read all pending messages */ bcm_mbox_intr(sc); - /* Should be called after bcm_mbox_sc initialization */ - mbox_write_4(REG_CONFIG, CONFIG_DATA_IRQ); + mbox_write_4(sc, REG_CONFIG, CONFIG_DATA_IRQ); return (0); } -static device_method_t bcm_mbox_methods[] = { - DEVMETHOD(device_probe, bcm_mbox_probe), - DEVMETHOD(device_attach, bcm_mbox_attach), - { 0, 0 } -}; - -static driver_t bcm_mbox_driver = { - "mbox", - bcm_mbox_methods, - sizeof(struct bcm_mbox_softc), -}; - -static devclass_t bcm_mbox_devclass; - -DRIVER_MODULE(mbox, simplebus, bcm_mbox_driver, bcm_mbox_devclass, 0, 0); - /* * Mailbox API */ -int -bcm_mbox_write(int chan, uint32_t data) +static int +bcm_mbox_write(device_t dev, int chan, uint32_t data) { int limit = 20000; + struct bcm_mbox_softc *sc = device_get_softc(dev); dprintf("bcm_mbox_write: chan %d, data %08x\n", chan, data); - MBOX_LOCK; + MBOX_LOCK(sc); - while ((mbox_read_4(REG_STATUS) & STATUS_FULL) && limit--) { + while ((mbox_read_4(sc, REG_STATUS) & STATUS_FULL) && limit--) { DELAY(2); } if (limit == 0) { printf("bcm_mbox_write: STATUS_FULL stuck"); - MBOX_UNLOCK; + MBOX_UNLOCK(sc); return (EAGAIN); } - mbox_write_4(REG_WRITE, MBOX_MSG(chan, data)); + mbox_write_4(sc, REG_WRITE, MBOX_MSG(chan, data)); - MBOX_UNLOCK; + MBOX_UNLOCK(sc); return (0); } -int -bcm_mbox_read(int chan, uint32_t *data) +static int +bcm_mbox_read(device_t dev, int chan, uint32_t *data) { - struct bcm_mbox_softc *sc = bcm_mbox_sc; + struct bcm_mbox_softc *sc = device_get_softc(dev); dprintf("bcm_mbox_read: chan %d\n", chan); - MBOX_LOCK; + MBOX_LOCK(sc); while (!sc->valid[chan]) msleep(&sc->msg[chan], &sc->lock, PZERO, "vcio mbox read", 0); - *data = bcm_mbox_sc->msg[chan]; - bcm_mbox_sc->valid[chan] = 0; - MBOX_UNLOCK; + *data = sc->msg[chan]; + sc->valid[chan] = 0; + MBOX_UNLOCK(sc); dprintf("bcm_mbox_read: chan %d, data %08x\n", chan, *data); return (0); } + +static device_method_t bcm_mbox_methods[] = { + DEVMETHOD(device_probe, bcm_mbox_probe), + DEVMETHOD(device_attach, bcm_mbox_attach), + + DEVMETHOD(mbox_read, bcm_mbox_read), + DEVMETHOD(mbox_write, bcm_mbox_write), + + DEVMETHOD_END +}; + +static driver_t bcm_mbox_driver = { + "mbox", + bcm_mbox_methods, + sizeof(struct bcm_mbox_softc), +}; + +static devclass_t bcm_mbox_devclass; + +DRIVER_MODULE(mbox, simplebus, bcm_mbox_driver, bcm_mbox_devclass, 0, 0); + Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.h Sun Jul 7 21:20:52 2013 (r253005) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.h Sun Jul 7 21:23:58 2013 (r253006) @@ -38,7 +38,4 @@ #define BCM2835_MBOX_CHAN_TS 6 #define BCM2835_MBOX_CHANS 7 -int bcm_mbox_write(int chan, uint32_t data); -int bcm_mbox_read(int chan, uint32_t *data); - #endif /* _BCM2835_MBOX_H_ */ Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2835 Sun Jul 7 21:20:52 2013 (r253005) +++ head/sys/arm/broadcom/bcm2835/files.bcm2835 Sun Jul 7 21:23:58 2013 (r253006) @@ -22,3 +22,5 @@ arm/arm/cpufunc_asm_armv6.S arm/arm/irq_dispatch.S standard kern/kern_clocksource.c standard + +dev/mbox/mbox_if.m standard From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 21:39:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 49973A4C; Sun, 7 Jul 2013 21:39:38 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8E617AD; Sun, 7 Jul 2013 21:39:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67Ldcfl046412; Sun, 7 Jul 2013 21:39:38 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67Ldb6u046408; Sun, 7 Jul 2013 21:39:37 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201307072139.r67Ldb6u046408@svn.freebsd.org> From: Alfred Perlstein Date: Sun, 7 Jul 2013 21:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253007 - in head/sys: kern net80211 sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 21:39:38 -0000 Author: alfred Date: Sun Jul 7 21:39:37 2013 New Revision: 253007 URL: http://svnweb.freebsd.org/changeset/base/253007 Log: Make kassert_printf use __printflike. Fix associated errors/warnings while I'm here. Requested by: avg Modified: head/sys/kern/subr_witness.c head/sys/kern/vfs_bio.c head/sys/net80211/ieee80211_output.c head/sys/sys/systm.h Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Sun Jul 7 21:23:58 2013 (r253006) +++ head/sys/kern/subr_witness.c Sun Jul 7 21:39:37 2013 (r253007) @@ -1138,12 +1138,16 @@ witness_checkorder(struct lock_object *l iclass = LOCK_CLASS(interlock); lock1 = find_instance(lock_list, interlock); if (lock1 == NULL) - kassert_panic("interlock (%s) %s not locked @ %s:%d", + kassert_panic( + "interlock (%s) %s not locked while locking" + " %s @ %s:%d", iclass->lc_name, interlock->lo_name, flags & LOP_EXCLUSIVE ? "exclusive" : "shared", fixup_filename(file), line); else if ((lock1->li_flags & LI_RECURSEMASK) != 0) - kassert_panic("interlock (%s) %s recursed @ %s:%d", + kassert_panic( + "interlock (%s) %s recursed while locking %s" + " @ %s:%d", iclass->lc_name, interlock->lo_name, flags & LOP_EXCLUSIVE ? "exclusive" : "shared", fixup_filename(file), line); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Jul 7 21:23:58 2013 (r253006) +++ head/sys/kern/vfs_bio.c Sun Jul 7 21:39:37 2013 (r253007) @@ -4485,8 +4485,8 @@ bdata2bio(struct buf *bp, struct bio *bi bip->bio_flags |= BIO_UNMAPPED; KASSERT(round_page(bip->bio_ma_offset + bip->bio_length) / PAGE_SIZE == bp->b_npages, - ("Buffer %p too short: %d %d %d", bp, bip->bio_ma_offset, - bip->bio_length, bip->bio_ma_n)); + ("Buffer %p too short: %d %lld %d", bp, bip->bio_ma_offset, + (long long)bip->bio_length, bip->bio_ma_n)); } else { bip->bio_data = bp->b_data; bip->bio_ma = NULL; Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sun Jul 7 21:23:58 2013 (r253006) +++ head/sys/net80211/ieee80211_output.c Sun Jul 7 21:39:37 2013 (r253007) @@ -1022,7 +1022,7 @@ ieee80211_mbuf_adjust(struct ieee80211va return NULL; } KASSERT(needed_space <= MHLEN, - ("not enough room, need %u got %zu\n", needed_space, MHLEN)); + ("not enough room, need %u got %d\n", needed_space, MHLEN)); /* * Setup new mbuf to have leading space to prepend the * 802.11 header and any crypto header bits that are Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sun Jul 7 21:23:58 2013 (r253006) +++ head/sys/sys/systm.h Sun Jul 7 21:39:37 2013 (r253007) @@ -74,7 +74,7 @@ extern int vm_guest; /* Running as virt enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN }; #if defined(WITNESS) || defined(INVARIANTS) -void kassert_panic(const char *fmt, ...); +void kassert_panic(const char *fmt, ...) __printflike(1, 2); #endif #ifdef INVARIANTS /* The option is always available */ From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 21:41:55 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 674C6CB2; Sun, 7 Jul 2013 21:41:55 +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 14D7917CB; Sun, 7 Jul 2013 21:41:53 +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 AAA27318; Mon, 08 Jul 2013 00:41:52 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1UvwiN-0004B1-Qs; Mon, 08 Jul 2013 00:41:51 +0300 Message-ID: <51D9E069.5060300@FreeBSD.org> Date: Mon, 08 Jul 2013 00:40:57 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130405 Thunderbird/17.0.5 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r253002 - head References: <201307072039.r67KdCdR028908@svn.freebsd.org> <9D4C7540-A3B0-45E5-8219-6A455D41DF70@gmail.com> <51D9DA55.2090808@freebsd.org> In-Reply-To: <51D9DA55.2090808@freebsd.org> X-Enigmail-Version: 1.5.1 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" , Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 21:41:55 -0000 on 08/07/2013 00:15 Alfred Perlstein said the following: > On 7/7/13 2:01 PM, Garrett Cooper wrote: >> Why the magic number 12? > > Numbers higher seem to result in worse performance as reported by some members > of my team. Should we really commit all "notes to self" or "my team's knowledge base" to FreeBSD source code like this? >> >> On Jul 7, 2013, at 1:39 PM, Alfred Perlstein wrote: >> >>> Author: alfred >>> Date: Sun Jul 7 20:39:11 2013 >>> New Revision: 253002 >>> URL: http://svnweb.freebsd.org/changeset/base/253002 >>> >>> Log: >>> Document tip on how to build all kernels quickly. >>> >>> Modified: >>> head/Makefile >>> >>> Modified: head/Makefile >>> ============================================================================== >>> --- head/Makefile Sun Jul 7 19:58:14 2013 (r253001) >>> +++ head/Makefile Sun Jul 7 20:39:11 2013 (r253002) >>> @@ -32,6 +32,12 @@ >>> # targets - Print a list of supported TARGET/TARGET_ARCH pairs >>> # for world and kernel targets. >>> # toolchains - Build a toolchain for all world and kernel targets. >>> +# >>> +# "quick" way to test all kernel builds: >>> +# _jflag=`sysctl -n hw.ncpu` >>> +# _jflag=$(($_jflag * 2)) >>> +# [ $_jflag -gt 12 ] && _jflag=12 >>> +# make universe -DMAKE_JUST_KERNELS JFLAG=${jflag} >>> # >>> # This makefile is simple by design. The FreeBSD make automatically reads >>> # the /usr/share/mk/sys.mk unless the -m argument is specified on the >>> _______________________________________________ >>> 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" > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 21:50:58 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 15D33E75; Sun, 7 Jul 2013 21:50:58 +0000 (UTC) (envelope-from alfred@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 027621804; Sun, 7 Jul 2013 21:50:57 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 07F361A3C61; Sun, 7 Jul 2013 14:50:57 -0700 (PDT) Message-ID: <51D9E2C0.6060603@freebsd.org> Date: Sun, 07 Jul 2013 14:50:56 -0700 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: Andriy Gapon Subject: Re: svn commit: r253002 - head References: <201307072039.r67KdCdR028908@svn.freebsd.org> <9D4C7540-A3B0-45E5-8219-6A455D41DF70@gmail.com> <51D9DA55.2090808@freebsd.org> <51D9E069.5060300@FreeBSD.org> In-Reply-To: <51D9E069.5060300@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 21:50:58 -0000 On 7/7/13 2:40 PM, Andriy Gapon wrote: > on 08/07/2013 00:15 Alfred Perlstein said the following: >> On 7/7/13 2:01 PM, Garrett Cooper wrote: >>> Why the magic number 12? >> Numbers higher seem to result in worse performance as reported by some members >> of my team. > Should we really commit all "notes to self" or "my team's knowledge base" to > FreeBSD source code like this? I would hope so! At least in comments, that way we can all help each other. Otherwise each time another person comes along they are subject to having to discover the same things that I did. What is the point of listing 10+ make targets if someone coming in doesn't know which ones to run and how to run them optimally in order to ensure a safe build? Do you not agree that more of this sort of documentation should be in the code instead of having to ask on IRC? For the record I checked multiple pages in developer primer and scoured makefiles for a while before giving up and asking on IRC. I figured it would be helpful for the next clueless goon that came in and tried to make things better if I recorded my experience to guide them. I hold no strong feelings towards the comments, other than they should be preserved in some form, or maybe even turned into a workable target for people that don't want or can not hold all that context in their brains. -Alfred > >>> On Jul 7, 2013, at 1:39 PM, Alfred Perlstein wrote: >>> >>>> Author: alfred >>>> Date: Sun Jul 7 20:39:11 2013 >>>> New Revision: 253002 >>>> URL: http://svnweb.freebsd.org/changeset/base/253002 >>>> >>>> Log: >>>> Document tip on how to build all kernels quickly. >>>> >>>> Modified: >>>> head/Makefile >>>> >>>> Modified: head/Makefile >>>> ============================================================================== >>>> --- head/Makefile Sun Jul 7 19:58:14 2013 (r253001) >>>> +++ head/Makefile Sun Jul 7 20:39:11 2013 (r253002) >>>> @@ -32,6 +32,12 @@ >>>> # targets - Print a list of supported TARGET/TARGET_ARCH pairs >>>> # for world and kernel targets. >>>> # toolchains - Build a toolchain for all world and kernel targets. >>>> +# >>>> +# "quick" way to test all kernel builds: >>>> +# _jflag=`sysctl -n hw.ncpu` >>>> +# _jflag=$(($_jflag * 2)) >>>> +# [ $_jflag -gt 12 ] && _jflag=12 >>>> +# make universe -DMAKE_JUST_KERNELS JFLAG=${jflag} >>>> # >>>> # This makefile is simple by design. The FreeBSD make automatically reads >>>> # the /usr/share/mk/sys.mk unless the -m argument is specified on the >>>> _______________________________________________ >>>> 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" > From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 22:03:36 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DAF476FE; Sun, 7 Jul 2013 22:03:36 +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 1E95218BA; Sun, 7 Jul 2013 22:03:34 +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 BAA27620; Mon, 08 Jul 2013 01:03:32 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Uvx3M-0004Cz-D4; Mon, 08 Jul 2013 01:03:32 +0300 Message-ID: <51D9E57F.3090803@FreeBSD.org> Date: Mon, 08 Jul 2013 01:02:39 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130405 Thunderbird/17.0.5 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r253002 - head References: <201307072039.r67KdCdR028908@svn.freebsd.org> <9D4C7540-A3B0-45E5-8219-6A455D41DF70@gmail.com> <51D9DA55.2090808@freebsd.org> <51D9E069.5060300@FreeBSD.org> <51D9E2C0.6060603@freebsd.org> In-Reply-To: <51D9E2C0.6060603@freebsd.org> X-Enigmail-Version: 1.5.1 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" , Garrett Cooper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 22:03:36 -0000 on 08/07/2013 00:50 Alfred Perlstein said the following: > On 7/7/13 2:40 PM, Andriy Gapon wrote: >> on 08/07/2013 00:15 Alfred Perlstein said the following: >>> On 7/7/13 2:01 PM, Garrett Cooper wrote: >>>> Why the magic number 12? >>> Numbers higher seem to result in worse performance as reported by some members >>> of my team. >> Should we really commit all "notes to self" or "my team's knowledge base" to >> FreeBSD source code like this? > > I would hope so! I hope not ;) > At least in comments, that way we can all help each other. > > Otherwise each time another person comes along they are subject to having to > discover the same things that I did. > > What is the point of listing 10+ make targets if someone coming in doesn't know > which ones to run and how to run them optimally in order to ensure a safe > build? Do you not agree that more of this sort of documentation should be in > the code instead of having to ask on IRC? > > For the record I checked multiple pages in developer primer and scoured > makefiles for a while before giving up and asking on IRC. I figured it would be > helpful for the next clueless goon that came in and tried to make things better > if I recorded my experience to guide them. > > I hold no strong feelings towards the comments, other than they should be > preserved in some form, or maybe even turned into a workable target for people > that don't want or can not hold all that context in their brains. I am sure that the next time you need to run the same thing you'll remember where you put the comment and you'll copy/paste from it. I am sure that if any other developer runs into the same situation, then he will: - google - ask on irc - ask on mailing lists - perhaps even read build(7) I am sure that looking through the Makefile would be one of the last things on his mind. So, I am all in favor of documenting things but that should be done properly. What you did was not commenting the code (such comments usually appear near the code and describe the code), it was putting a mini-how-to at an obscure place. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sun Jul 7 22:18:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 20C48B5B; Sun, 7 Jul 2013 22:18:10 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 02D841927; Sun, 7 Jul 2013 22:18:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67MI9Rt058341; Sun, 7 Jul 2013 22:18:09 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67MI8SZ058332; Sun, 7 Jul 2013 22:18:08 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201307072218.r67MI8SZ058332@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 7 Jul 2013 22:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r253008 - vendor/tzdata/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 22:18:10 -0000 Author: edwin Date: Sun Jul 7 22:18:08 2013 New Revision: 253008 URL: http://svnweb.freebsd.org/changeset/base/253008 Log: Vendor import of tzdata2013d: - Morocco: announced that the year's Ramadan daylight-savings transitions would be 2013-07-07 and 2013-08-10. - Israel: As of 2013, DST starts at 02:00 on the Friday before the last Sunday in March. DST ends at 02:00 on the first Sunday after October 1, unless it occurs on the second day of the Jewish Rosh Hashana holiday, in which case DST ends a day later (i.e. at 02:00 the first Monday after October 2). [Rosh Hashana holidays are factored in until 2100.] Obtained from: ftp://ftp.iana.org/tz/releases/ Modified: vendor/tzdata/dist/africa vendor/tzdata/dist/asia vendor/tzdata/dist/australasia vendor/tzdata/dist/europe vendor/tzdata/dist/iso3166.tab vendor/tzdata/dist/southamerica vendor/tzdata/dist/zone.tab Modified: vendor/tzdata/dist/africa ============================================================================== --- vendor/tzdata/dist/africa Sun Jul 7 21:39:37 2013 (r253007) +++ vendor/tzdata/dist/africa Sun Jul 7 22:18:08 2013 (r253008) @@ -852,12 +852,18 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 J # announced that year's Ramadan daylight-saving transitions would be # 2012-07-20 and 2012-08-20; see # . -# + +# From Andrew Paprocki (2013-07-02): +# Morocco announced that the year's Ramadan daylight-savings +# transitions would be 2013-07-07 and 2013-08-10; see: +# http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10 + +# From Paul Eggert (2013-07-03): # To estimate what the Moroccan government will do in future years, -# transition dates for 2013 through 2021 were determined by running +# transition dates for 2014 through 2021 were determined by running # the following program under GNU Emacs 24.3: # -# (let ((islamic-year 1434)) +# (let ((islamic-year 1435)) # (while (< islamic-year 1444) # (let ((a # (calendar-gregorian-from-absolute @@ -910,8 +916,8 @@ Rule Morocco 2012 2019 - Apr lastSun 2: Rule Morocco 2012 max - Sep lastSun 3:00 0 - Rule Morocco 2012 only - Jul 20 3:00 0 - Rule Morocco 2012 only - Aug 20 2:00 1:00 S -Rule Morocco 2013 only - Jul 9 3:00 0 - -Rule Morocco 2013 only - Aug 8 2:00 1:00 S +Rule Morocco 2013 only - Jul 7 3:00 0 - +Rule Morocco 2013 only - Aug 10 2:00 1:00 S Rule Morocco 2014 only - Jun 29 3:00 0 - Rule Morocco 2014 only - Jul 29 2:00 1:00 S Rule Morocco 2015 only - Jun 18 3:00 0 - Modified: vendor/tzdata/dist/asia ============================================================================== --- vendor/tzdata/dist/asia Sun Jul 7 21:39:37 2013 (r253007) +++ vendor/tzdata/dist/asia Sun Jul 7 22:18:08 2013 (r253008) @@ -1212,39 +1212,21 @@ Rule Zion 2011 only - Oct 2 2:00 0 S Rule Zion 2012 only - Mar Fri>=26 2:00 1:00 D Rule Zion 2012 only - Sep 23 2:00 0 S -# From Ephraim Silverberg (2012-10-18): -# Yesterday, the Interior Ministry Committee, after more than a year -# past, approved sending the proposed June 2011 changes to the Time -# Decree Law back to the Knesset for second and third (final) votes -# before the upcoming elections on Jan. 22, 2013. Hence, although the -# changes are not yet law, they are expected to be so before February 2013. -# -# As of 2013, DST starts at 02:00 on the Friday before the last Sunday in March. -# DST ends at 02:00 on the first Sunday after October 1, unless it occurs on the -# second day of the Jewish Rosh Hashana holiday, in which case DST ends a day -# later (i.e. at 02:00 the first Monday after October 2). -# [Rosh Hashana holidays are factored in until 2100.] - -# From Ephraim Silverberg (2012-11-05): -# The Knesset passed today (in second and final readings) the amendment to the -# Time Decree Law making the changes ... law. +# From Ephraim Silverberg (2013-06-27): +# On June 23, 2013, the Israeli government approved changes to the +# Time Decree Law. The next day, the changes passed the First Reading +# in the Knesset. The law is expected to pass the Second and Third +# (final) Readings by the beginning of September 2013. +# +# As of 2013, DST starts at 02:00 on the Friday before the last Sunday +# in March. DST ends at 02:00 on the last Sunday of October. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D -Rule Zion 2013 2026 - Oct Sun>=2 2:00 0 S -Rule Zion 2027 only - Oct Mon>=3 2:00 0 S -Rule Zion 2028 max - Oct Sun>=2 2:00 0 S -# The following rules are commented out for now, as they break older -# versions of zic that support only signed 32-bit timestamps, i.e., -# through 2038-01-19 03:14:07 UTC. -#Rule Zion 2028 2053 - Oct Sun>=2 2:00 0 S -#Rule Zion 2054 only - Oct Mon>=3 2:00 0 S -#Rule Zion 2055 2080 - Oct Sun>=2 2:00 0 S -#Rule Zion 2081 only - Oct Mon>=3 2:00 0 S -#Rule Zion 2082 max - Oct Sun>=2 2:00 0 S +Rule Zion 2013 max - Oct lastSun 2:00 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Jerusalem 2:20:56 - LMT 1880 +Zone Asia/Jerusalem 2:20:54 - LMT 1880 2:20:40 - JMT 1918 # Jerusalem Mean Time? 2:00 Zion I%sT @@ -2547,8 +2529,8 @@ Rule Syria 2006 only - Sep 22 0:00 0 - Rule Syria 2007 only - Mar lastFri 0:00 1:00 S # From Jesper Norgard (2007-10-27): # The sister center ICARDA of my work CIMMYT is confirming that Syria DST will -# not take place 1.st November at 0:00 o'clock but 1.st November at 24:00 or -# rather Midnight between Thursday and Friday. This does make more sence than +# not take place 1st November at 0:00 o'clock but 1st November at 24:00 or +# rather Midnight between Thursday and Friday. This does make more sense than # having it between Wednesday and Thursday (two workdays in Syria) since the # weekend in Syria is not Saturday and Sunday, but Friday and Saturday. So now # it is implemented at midnight of the last workday before weekend... Modified: vendor/tzdata/dist/australasia ============================================================================== --- vendor/tzdata/dist/australasia Sun Jul 7 21:39:37 2013 (r253007) +++ vendor/tzdata/dist/australasia Sun Jul 7 22:18:08 2013 (r253008) @@ -230,10 +230,16 @@ Zone Australia/Lord_Howe 10:36:20 - LMT # - Macquarie Island will stay on UTC+11 for winter and therefore not # switch back from daylight savings time when other parts of Australia do # on 4 April. +# +# From Arthur David Olson (2013-05-23): +# The 1919 transition is overspecified below so pre-2013 zics +# will produce a binary file with an EST-type as the first 32-bit type; +# this is required for correct handling of times before 1916 by +# pre-2013 versions of localtime. Zone Antarctica/Macquarie 0 - zzz 1899 Nov 10:00 - EST 1916 Oct 1 2:00 10:00 1:00 EST 1917 Feb - 10:00 Aus EST 1919 Apr + 10:00 Aus EST 1919 Apr 1 0:00s 0 - zzz 1948 Mar 25 10:00 Aus EST 1967 10:00 AT EST 2010 Apr 4 3:00 @@ -1475,12 +1481,12 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # From Paul Eggert (2000-01-08): # IATA SSIM (1999-09) says DST ends 0100 local time. Go with McDow. -# From the BBC World Service (1998-10-31 11:32 UTC): +# From the BBC World Service in +# http://news.bbc.co.uk/2/hi/asia-pacific/205226.stm (1998-10-31 16:03 UTC): # The Fijiian government says the main reasons for the time change is to -# improve productivity and reduce road accidents. But correspondents say it -# also hopes the move will boost Fiji's ability to compete with other pacific -# islands in the effort to attract tourists to witness the dawning of the new -# millenium. +# improve productivity and reduce road accidents.... [T]he move is also +# intended to boost Fiji's ability to attract tourists to witness the dawning +# of the new millennium. # http://www.fiji.gov.fj/press/2000_09/2000_09_13-05.shtml (2000-09-13) # reports that Fiji has discontinued DST. @@ -1625,7 +1631,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # Shanks & Pottenger say the transition was on 1968-10-01; go with Mundell. # From Eric Ulevik (1999-05-03): -# Tonga's director of tourism, who is also secretary of the National Millenium +# Tonga's director of tourism, who is also secretary of the National Millennium # Committee, has a plan to get Tonga back in front. # He has proposed a one-off move to tropical daylight saving for Tonga from # October to March, which has won approval in principle from the Tongan Modified: vendor/tzdata/dist/europe ============================================================================== --- vendor/tzdata/dist/europe Sun Jul 7 21:39:37 2013 (r253007) +++ vendor/tzdata/dist/europe Sun Jul 7 22:18:08 2013 (r253008) @@ -523,7 +523,7 @@ Rule C-Eur 1944 only - Oct 2 2:00s 0 - # It seems that Paris, Monaco, Rule France, Rule Belgium all agree on # 2:00 standard time, e.g. 3:00 local time. However there are no # countries that use C-Eur rules in September 1945, so the only items -# affected are apparently these ficticious zones that translates acronyms +# affected are apparently these fictitious zones that translate acronyms # CET and MET: # # Zone CET 1:00 C-Eur CE%sT @@ -2779,9 +2779,9 @@ Link Europe/Istanbul Asia/Istanbul # Ist # Ukraine # -# From Igor Karpov, who works for the Ukranian Ministry of Justice, +# From Igor Karpov, who works for the Ukrainian Ministry of Justice, # via Garrett Wollman (2003-01-27): -# BTW, I've found the official document on this matter. It's goverment +# BTW, I've found the official document on this matter. It's government # regulations number 509, May 13, 1996. In my poor translation it says: # "Time in Ukraine is set to second timezone (Kiev time). Each last Sunday # of March at 3am the time is changing to 4am and each last Sunday of @@ -2815,7 +2815,7 @@ Link Europe/Istanbul Asia/Istanbul # Ist # time this year after all. # # From Udo Schwedt (2011-10-18): -# As far as I understand, the recent change to the Ukranian time zone +# As far as I understand, the recent change to the Ukrainian time zone # (Europe/Kiev) to introduce permanent daylight saving time (similar # to Russia) was reverted today: # Modified: vendor/tzdata/dist/iso3166.tab ============================================================================== --- vendor/tzdata/dist/iso3166.tab Sun Jul 7 21:39:37 2013 (r253007) +++ vendor/tzdata/dist/iso3166.tab Sun Jul 7 22:18:08 2013 (r253008) @@ -1,16 +1,14 @@ -#
+# ISO 3166 alpha-2 country codes
+#
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
-# ISO 3166 alpha-2 country codes
 #
-# From Paul Eggert (2006-09-27):
+# From Paul Eggert (2013-05-27):
 #
 # This file contains a table with the following columns:
 # 1.  ISO 3166-1 alpha-2 country code, current as of
-#     ISO 3166-1 Newsletter VI-1 (2007-09-21).  See:
-#     
-#     ISO 3166 Maintenance agency (ISO 3166/MA)
-#     .
+#     ISO 3166-1 Newsletter VI-15 (2013-05-10).  See: Updates on ISO 3166
+#   http://www.iso.org/iso/home/standards/country_codes/updates_on_iso_3166.htm
 # 2.  The usual English name for the country,
 #     chosen so that alphabetic sorting of subsets produces helpful lists.
 #     This is not the same as the English name in the ISO 3166 tables.
@@ -20,8 +18,9 @@
 #
 # Lines beginning with `#' are comments.
 #
-# From Arthur David Olson (2011-08-17):
-# Resynchronized today with the ISO 3166 site (adding SS for South Sudan).
+# This table is intended as an aid for users, to help them select time
+# zone data appropriate for their practical needs.  It is not intended
+# to take or endorse any position on legal or territorial claims.
 #
 #country-
 #code	country name
@@ -54,7 +53,7 @@ BL	St Barthelemy
 BM	Bermuda
 BN	Brunei
 BO	Bolivia
-BQ	Bonaire Sint Eustatius & Saba
+BQ	Bonaire, St Eustatius & Saba
 BR	Brazil
 BS	Bahamas
 BT	Bhutan
@@ -235,7 +234,7 @@ SR	Suriname
 SS	South Sudan
 ST	Sao Tome & Principe
 SV	El Salvador
-SX	Sint Maarten
+SX	St Maarten (Dutch part)
 SY	Syria
 SZ	Swaziland
 TC	Turks & Caicos Is

Modified: vendor/tzdata/dist/southamerica
==============================================================================
--- vendor/tzdata/dist/southamerica	Sun Jul  7 21:39:37 2013	(r253007)
+++ vendor/tzdata/dist/southamerica	Sun Jul  7 22:18:08 2013	(r253008)
@@ -971,7 +971,7 @@ Rule	Brazil	2007	only	-	Feb	25	 0:00	0	-
 # adopted by the same states as before.
 Rule	Brazil	2007	only	-	Oct	Sun>=8	 0:00	1:00	S
 # From Frederico A. C. Neves (2008-09-10):
-# Acording to this decree
+# According to this decree
 # 
 # http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm
 # 
@@ -1203,7 +1203,7 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
 # 
 #
-# This is not yet reflected in the offical "cambio de hora" site, but
+# This is not yet reflected in the official "cambio de hora" site, but
 # probably will be soon:
 # 
 # http://www.horaoficial.cl/cambio.htm

Modified: vendor/tzdata/dist/zone.tab
==============================================================================
--- vendor/tzdata/dist/zone.tab	Sun Jul  7 21:39:37 2013	(r253007)
+++ vendor/tzdata/dist/zone.tab	Sun Jul  7 22:18:08 2013	(r253008)
@@ -1,18 +1,21 @@
-# 
+# TZ zone descriptions
+#
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
-# TZ zone descriptions
-#
-# From Paul Eggert (1996-08-05):
+# From Paul Eggert (2013-05-27):
 #
 # This file contains a table with the following columns:
 # 1.  ISO 3166 2-character country code.  See the file `iso3166.tab'.
+#     This identifies a country that overlaps the zone.  The country may
+#     overlap other zones and the zone may overlap other countries.
 # 2.  Latitude and longitude of the zone's principal location
 #     in ISO 6709 sign-degrees-minutes-seconds format,
 #     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
 #     first latitude (+ is north), then longitude (+ is east).
+#     This location need not lie within the column-1 country.
 # 3.  Zone name used in value of TZ environment variable.
+#     Please see the 'Theory' file for how zone names are chosen.
 # 4.  Comments; present if and only if the country has multiple rows.
 #
 # Columns are separated by a single tab.
@@ -22,6 +25,10 @@
 #
 # Lines beginning with `#' are comments.
 #
+# This table is intended as an aid for users, to help them select time
+# zone data appropriate for their practical needs.  It is not intended
+# to take or endorse any position on legal or territorial claims.
+#
 #country-
 #code	coordinates	TZ			comments
 AD	+4230+00131	Europe/Andorra
@@ -216,7 +223,7 @@ ID	-0002+10920	Asia/Pontianak	west & cen
 ID	-0507+11924	Asia/Makassar	east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
 ID	-0232+14042	Asia/Jayapura	west New Guinea (Irian Jaya) & Malukus (Moluccas)
 IE	+5320-00615	Europe/Dublin
-IL	+3146+03514	Asia/Jerusalem
+IL	+314650+0351326	Asia/Jerusalem
 IM	+5409-00428	Europe/Isle_of_Man
 IN	+2232+08822	Asia/Kolkata
 IO	-0720+07225	Indian/Chagos

From owner-svn-src-all@FreeBSD.ORG  Sun Jul  7 22:24:00 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id A8B25D28;
 Sun,  7 Jul 2013 22:24:00 +0000 (UTC)
 (envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 990741955;
 Sun,  7 Jul 2013 22:24:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67MO0HK060688;
 Sun, 7 Jul 2013 22:24:00 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67MNxQT060673;
 Sun, 7 Jul 2013 22:23:59 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201307072223.r67MNxQT060673@svn.freebsd.org>
From: Edwin Groothuis 
Date: Sun, 7 Jul 2013 22:23:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253009 - head/contrib/tzdata
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 07 Jul 2013 22:24:00 -0000

Author: edwin
Date: Sun Jul  7 22:23:59 2013
New Revision: 253009
URL: http://svnweb.freebsd.org/changeset/base/253009

Log:
  MFV of tzdata2013d, 253008
  
  - Morocco:
    announced that the year's Ramadan daylight-savings transitions
    would be 2013-07-07 and 2013-08-10.
  
  - Israel:
    As of 2013, DST starts at 02:00 on the Friday before the last
    Sunday in March.  DST ends at 02:00 on the first Sunday after
    October 1, unless it occurs on the second day of the Jewish Rosh
    Hashana holiday, in which case DST ends a day later (i.e. at 02:00
    the first Monday after October 2).  [Rosh Hashana holidays are
    factored in until 2100.]

Modified:
  head/contrib/tzdata/africa
  head/contrib/tzdata/asia
  head/contrib/tzdata/australasia
  head/contrib/tzdata/europe
  head/contrib/tzdata/southamerica
  head/contrib/tzdata/zone.tab
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/africa
==============================================================================
--- head/contrib/tzdata/africa	Sun Jul  7 22:18:08 2013	(r253008)
+++ head/contrib/tzdata/africa	Sun Jul  7 22:23:59 2013	(r253009)
@@ -852,12 +852,18 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # announced that year's Ramadan daylight-saving transitions would be
 # 2012-07-20 and 2012-08-20; see
 # .
-#
+
+# From Andrew Paprocki (2013-07-02):
+# Morocco announced that the year's Ramadan daylight-savings
+# transitions would be 2013-07-07 and 2013-08-10; see:
+# http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10
+
+# From Paul Eggert (2013-07-03):
 # To estimate what the Moroccan government will do in future years,
-# transition dates for 2013 through 2021 were determined by running
+# transition dates for 2014 through 2021 were determined by running
 # the following program under GNU Emacs 24.3:
 #
-# (let ((islamic-year 1434))
+# (let ((islamic-year 1435))
 #   (while (< islamic-year 1444)
 #     (let ((a
 #	     (calendar-gregorian-from-absolute
@@ -910,8 +916,8 @@ Rule	Morocco	2012	2019	-	Apr	 lastSun 2:
 Rule	Morocco	2012	max	-	Sep	 lastSun 3:00	0	-
 Rule	Morocco	2012	only	-	Jul	 20	 3:00	0	-
 Rule	Morocco	2012	only	-	Aug	 20	 2:00	1:00	S
-Rule	Morocco	2013	only	-	Jul	  9	 3:00	0	-
-Rule	Morocco	2013	only	-	Aug	  8	 2:00	1:00	S
+Rule	Morocco	2013	only	-	Jul	  7	 3:00	0	-
+Rule	Morocco	2013	only	-	Aug	 10	 2:00	1:00	S
 Rule	Morocco	2014	only	-	Jun	 29	 3:00	0	-
 Rule	Morocco	2014	only	-	Jul	 29	 2:00	1:00	S
 Rule	Morocco	2015	only	-	Jun	 18	 3:00	0	-

Modified: head/contrib/tzdata/asia
==============================================================================
--- head/contrib/tzdata/asia	Sun Jul  7 22:18:08 2013	(r253008)
+++ head/contrib/tzdata/asia	Sun Jul  7 22:23:59 2013	(r253009)
@@ -1212,39 +1212,21 @@ Rule	Zion	2011	only	-	Oct	 2	2:00	0	S
 Rule	Zion	2012	only	-	Mar	Fri>=26	2:00	1:00	D
 Rule	Zion	2012	only	-	Sep	23	2:00	0	S
 
-# From Ephraim Silverberg (2012-10-18):
-# Yesterday, the Interior Ministry Committee, after more than a year
-# past, approved sending the proposed June 2011 changes to the Time
-# Decree Law back to the Knesset for second and third (final) votes
-# before the upcoming elections on Jan. 22, 2013.  Hence, although the
-# changes are not yet law, they are expected to be so before February 2013.
-#
-# As of 2013, DST starts at 02:00 on the Friday before the last Sunday in March.
-# DST ends at 02:00 on the first Sunday after October 1, unless it occurs on the
-# second day of the Jewish Rosh Hashana holiday, in which case DST ends a day
-# later (i.e. at 02:00 the first Monday after October 2).
-# [Rosh Hashana holidays are factored in until 2100.]
-
-# From Ephraim Silverberg (2012-11-05):
-# The Knesset passed today (in second and final readings) the amendment to the
-# Time Decree Law making the changes ... law.
+# From Ephraim Silverberg (2013-06-27):
+# On June 23, 2013, the Israeli government approved changes to the
+# Time Decree Law.  The next day, the changes passed the First Reading
+# in the Knesset.  The law is expected to pass the Second and Third
+# (final) Readings by the beginning of September 2013.
+#
+# As of 2013, DST starts at 02:00 on the Friday before the last Sunday
+# in March.  DST ends at 02:00 on the last Sunday of October.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Zion	2013	max	-	Mar	Fri>=23	2:00	1:00	D
-Rule	Zion	2013	2026	-	Oct	Sun>=2	2:00	0	S
-Rule	Zion	2027	only	-	Oct	Mon>=3	2:00	0	S
-Rule	Zion	2028	max	-	Oct	Sun>=2	2:00	0	S
-# The following rules are commented out for now, as they break older
-# versions of zic that support only signed 32-bit timestamps, i.e.,
-# through 2038-01-19 03:14:07 UTC.
-#Rule	Zion	2028	2053	-	Oct	Sun>=2	2:00	0	S
-#Rule	Zion	2054	only	-	Oct	Mon>=3	2:00	0	S
-#Rule	Zion	2055	2080	-	Oct	Sun>=2	2:00	0	S
-#Rule	Zion	2081	only	-	Oct	Mon>=3	2:00	0	S
-#Rule	Zion	2082	max	-	Oct	Sun>=2	2:00	0	S
+Rule	Zion	2013	max	-	Oct	lastSun	2:00	0	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Jerusalem	2:20:56 -	LMT	1880
+Zone	Asia/Jerusalem	2:20:54 -	LMT	1880
 			2:20:40	-	JMT	1918	# Jerusalem Mean Time?
 			2:00	Zion	I%sT
 
@@ -2547,8 +2529,8 @@ Rule	Syria	2006	only	-	Sep	22	0:00	0	-
 Rule	Syria	2007	only	-	Mar	lastFri	0:00	1:00	S
 # From Jesper Norgard (2007-10-27):
 # The sister center ICARDA of my work CIMMYT is confirming that Syria DST will
-# not take place 1.st November at 0:00 o'clock but 1.st November at 24:00 or
-# rather Midnight between Thursday and Friday. This does make more sence than
+# not take place 1st November at 0:00 o'clock but 1st November at 24:00 or
+# rather Midnight between Thursday and Friday. This does make more sense than
 # having it between Wednesday and Thursday (two workdays in Syria) since the
 # weekend in Syria is not Saturday and Sunday, but Friday and Saturday. So now
 # it is implemented at midnight of the last workday before weekend...

Modified: head/contrib/tzdata/australasia
==============================================================================
--- head/contrib/tzdata/australasia	Sun Jul  7 22:18:08 2013	(r253008)
+++ head/contrib/tzdata/australasia	Sun Jul  7 22:23:59 2013	(r253009)
@@ -230,10 +230,16 @@ Zone Australia/Lord_Howe 10:36:20 -	LMT	
 # - Macquarie Island will stay on UTC+11 for winter and therefore not
 # switch back from daylight savings time when other parts of Australia do
 # on 4 April.
+#
+# From Arthur David Olson (2013-05-23):
+# The 1919 transition is overspecified below so pre-2013 zics
+# will produce a binary file with an EST-type as the first 32-bit type;
+# this is required for correct handling of times before 1916 by
+# pre-2013 versions of localtime.
 Zone Antarctica/Macquarie 0	-	zzz	1899 Nov
 			10:00	-	EST	1916 Oct 1 2:00
 			10:00	1:00	EST	1917 Feb
-			10:00	Aus	EST	1919 Apr
+			10:00	Aus	EST	1919 Apr 1 0:00s
 			0	-	zzz	1948 Mar 25
 			10:00	Aus	EST	1967
 			10:00	AT	EST	2010 Apr 4 3:00
@@ -1475,12 +1481,12 @@ Zone	Pacific/Wallis	12:15:20 -	LMT	1901
 # From Paul Eggert (2000-01-08):
 # IATA SSIM (1999-09) says DST ends 0100 local time.  Go with McDow.
 
-# From the BBC World Service (1998-10-31 11:32 UTC):
+# From the BBC World Service in
+# http://news.bbc.co.uk/2/hi/asia-pacific/205226.stm (1998-10-31 16:03 UTC):
 # The Fijiian government says the main reasons for the time change is to
-# improve productivity and reduce road accidents.  But correspondents say it
-# also hopes the move will boost Fiji's ability to compete with other pacific
-# islands in the effort to attract tourists to witness the dawning of the new
-# millenium.
+# improve productivity and reduce road accidents.... [T]he move is also
+# intended to boost Fiji's ability to attract tourists to witness the dawning
+# of the new millennium.
 
 # http://www.fiji.gov.fj/press/2000_09/2000_09_13-05.shtml (2000-09-13)
 # reports that Fiji has discontinued DST.
@@ -1625,7 +1631,7 @@ Zone	Pacific/Wallis	12:15:20 -	LMT	1901
 # Shanks & Pottenger say the transition was on 1968-10-01; go with Mundell.
 
 # From Eric Ulevik (1999-05-03):
-# Tonga's director of tourism, who is also secretary of the National Millenium
+# Tonga's director of tourism, who is also secretary of the National Millennium
 # Committee, has a plan to get Tonga back in front.
 # He has proposed a one-off move to tropical daylight saving for Tonga from
 # October to March, which has won approval in principle from the Tongan

Modified: head/contrib/tzdata/europe
==============================================================================
--- head/contrib/tzdata/europe	Sun Jul  7 22:18:08 2013	(r253008)
+++ head/contrib/tzdata/europe	Sun Jul  7 22:23:59 2013	(r253009)
@@ -523,7 +523,7 @@ Rule	C-Eur	1944	only	-	Oct	 2	 2:00s	0	-
 # It seems that Paris, Monaco, Rule France, Rule Belgium all agree on
 # 2:00 standard time, e.g. 3:00 local time.  However there are no
 # countries that use C-Eur rules in September 1945, so the only items
-# affected are apparently these ficticious zones that translates acronyms
+# affected are apparently these fictitious zones that translate acronyms
 # CET and MET:
 #
 # Zone CET  1:00 C-Eur CE%sT
@@ -2779,9 +2779,9 @@ Link	Europe/Istanbul	Asia/Istanbul	# Ist
 
 # Ukraine
 #
-# From Igor Karpov, who works for the Ukranian Ministry of Justice,
+# From Igor Karpov, who works for the Ukrainian Ministry of Justice,
 # via Garrett Wollman (2003-01-27):
-# BTW, I've found the official document on this matter. It's goverment
+# BTW, I've found the official document on this matter. It's government
 # regulations number 509, May 13, 1996. In my poor translation it says:
 # "Time in Ukraine is set to second timezone (Kiev time). Each last Sunday
 # of March at 3am the time is changing to 4am and each last Sunday of
@@ -2815,7 +2815,7 @@ Link	Europe/Istanbul	Asia/Istanbul	# Ist
 # time this year after all.
 #
 # From Udo Schwedt (2011-10-18):
-# As far as I understand, the recent change to the Ukranian time zone
+# As far as I understand, the recent change to the Ukrainian time zone
 # (Europe/Kiev) to introduce permanent daylight saving time (similar
 # to Russia) was reverted today:
 #

Modified: head/contrib/tzdata/southamerica
==============================================================================
--- head/contrib/tzdata/southamerica	Sun Jul  7 22:18:08 2013	(r253008)
+++ head/contrib/tzdata/southamerica	Sun Jul  7 22:23:59 2013	(r253009)
@@ -971,7 +971,7 @@ Rule	Brazil	2007	only	-	Feb	25	 0:00	0	-
 # adopted by the same states as before.
 Rule	Brazil	2007	only	-	Oct	Sun>=8	 0:00	1:00	S
 # From Frederico A. C. Neves (2008-09-10):
-# Acording to this decree
+# According to this decree
 # 
 # http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm
 # 
@@ -1203,7 +1203,7 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
 # 
 #
-# This is not yet reflected in the offical "cambio de hora" site, but
+# This is not yet reflected in the official "cambio de hora" site, but
 # probably will be soon:
 # 
 # http://www.horaoficial.cl/cambio.htm

Modified: head/contrib/tzdata/zone.tab
==============================================================================
--- head/contrib/tzdata/zone.tab	Sun Jul  7 22:18:08 2013	(r253008)
+++ head/contrib/tzdata/zone.tab	Sun Jul  7 22:23:59 2013	(r253009)
@@ -1,18 +1,21 @@
-# 
+# TZ zone descriptions
+#
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
-# TZ zone descriptions
-#
-# From Paul Eggert (1996-08-05):
+# From Paul Eggert (2013-05-27):
 #
 # This file contains a table with the following columns:
 # 1.  ISO 3166 2-character country code.  See /usr/share/misc/iso3166.
+#     This identifies a country that overlaps the zone.  The country may
+#     overlap other zones and the zone may overlap other countries.
 # 2.  Latitude and longitude of the zone's principal location
 #     in ISO 6709 sign-degrees-minutes-seconds format,
 #     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
 #     first latitude (+ is north), then longitude (+ is east).
+#     This location need not lie within the column-1 country.
 # 3.  Zone name used in value of TZ environment variable.
+#     Please see the 'Theory' file for how zone names are chosen.
 # 4.  Comments; present if and only if the country has multiple rows.
 #
 # Columns are separated by a single tab.
@@ -22,6 +25,10 @@
 #
 # Lines beginning with `#' are comments.
 #
+# This table is intended as an aid for users, to help them select time
+# zone data appropriate for their practical needs.  It is not intended
+# to take or endorse any position on legal or territorial claims.
+#
 #country-
 #code	coordinates	TZ			comments
 AD	+4230+00131	Europe/Andorra
@@ -216,7 +223,7 @@ ID	-0002+10920	Asia/Pontianak	west & cen
 ID	-0507+11924	Asia/Makassar	east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
 ID	-0232+14042	Asia/Jayapura	west New Guinea (Irian Jaya) & Malukus (Moluccas)
 IE	+5320-00615	Europe/Dublin
-IL	+3146+03514	Asia/Jerusalem
+IL	+314650+0351326	Asia/Jerusalem
 IM	+5409-00428	Europe/Isle_of_Man
 IN	+2232+08822	Asia/Kolkata
 IO	-0720+07225	Indian/Chagos

From owner-svn-src-all@FreeBSD.ORG  Sun Jul  7 22:27:38 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 1C33418E;
 Sun,  7 Jul 2013 22:27:38 +0000 (UTC)
 (envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 0D4741996;
 Sun,  7 Jul 2013 22:27:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67MRbig061196;
 Sun, 7 Jul 2013 22:27:37 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67MRaIh061187;
 Sun, 7 Jul 2013 22:27:36 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201307072227.r67MRaIh061187@svn.freebsd.org>
From: Edwin Groothuis 
Date: Sun, 7 Jul 2013 22:27:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253010 - stable/9/contrib/tzdata
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 07 Jul 2013 22:27:38 -0000

Author: edwin
Date: Sun Jul  7 22:27:36 2013
New Revision: 253010
URL: http://svnweb.freebsd.org/changeset/base/253010

Log:
  MFC of tzdata2013d, 253009
  
  - Morocco:
    announced that the year's Ramadan daylight-savings transitions
    would be 2013-07-07 and 2013-08-10.
  
  - Israel:
    As of 2013, DST starts at 02:00 on the Friday before the last
    Sunday in March.  DST ends at 02:00 on the first Sunday after
    October 1, unless it occurs on the second day of the Jewish Rosh
    Hashana holiday, in which case DST ends a day later (i.e. at 02:00
    the first Monday after October 2).  [Rosh Hashana holidays are
    factored in until 2100.]

Modified:
  stable/9/contrib/tzdata/africa
  stable/9/contrib/tzdata/asia
  stable/9/contrib/tzdata/australasia
  stable/9/contrib/tzdata/europe
  stable/9/contrib/tzdata/southamerica
  stable/9/contrib/tzdata/zone.tab
Directory Properties:
  stable/9/contrib/tzdata/   (props changed)

Modified: stable/9/contrib/tzdata/africa
==============================================================================
--- stable/9/contrib/tzdata/africa	Sun Jul  7 22:23:59 2013	(r253009)
+++ stable/9/contrib/tzdata/africa	Sun Jul  7 22:27:36 2013	(r253010)
@@ -852,12 +852,18 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # announced that year's Ramadan daylight-saving transitions would be
 # 2012-07-20 and 2012-08-20; see
 # .
-#
+
+# From Andrew Paprocki (2013-07-02):
+# Morocco announced that the year's Ramadan daylight-savings
+# transitions would be 2013-07-07 and 2013-08-10; see:
+# http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10
+
+# From Paul Eggert (2013-07-03):
 # To estimate what the Moroccan government will do in future years,
-# transition dates for 2013 through 2021 were determined by running
+# transition dates for 2014 through 2021 were determined by running
 # the following program under GNU Emacs 24.3:
 #
-# (let ((islamic-year 1434))
+# (let ((islamic-year 1435))
 #   (while (< islamic-year 1444)
 #     (let ((a
 #	     (calendar-gregorian-from-absolute
@@ -910,8 +916,8 @@ Rule	Morocco	2012	2019	-	Apr	 lastSun 2:
 Rule	Morocco	2012	max	-	Sep	 lastSun 3:00	0	-
 Rule	Morocco	2012	only	-	Jul	 20	 3:00	0	-
 Rule	Morocco	2012	only	-	Aug	 20	 2:00	1:00	S
-Rule	Morocco	2013	only	-	Jul	  9	 3:00	0	-
-Rule	Morocco	2013	only	-	Aug	  8	 2:00	1:00	S
+Rule	Morocco	2013	only	-	Jul	  7	 3:00	0	-
+Rule	Morocco	2013	only	-	Aug	 10	 2:00	1:00	S
 Rule	Morocco	2014	only	-	Jun	 29	 3:00	0	-
 Rule	Morocco	2014	only	-	Jul	 29	 2:00	1:00	S
 Rule	Morocco	2015	only	-	Jun	 18	 3:00	0	-

Modified: stable/9/contrib/tzdata/asia
==============================================================================
--- stable/9/contrib/tzdata/asia	Sun Jul  7 22:23:59 2013	(r253009)
+++ stable/9/contrib/tzdata/asia	Sun Jul  7 22:27:36 2013	(r253010)
@@ -1212,39 +1212,21 @@ Rule	Zion	2011	only	-	Oct	 2	2:00	0	S
 Rule	Zion	2012	only	-	Mar	Fri>=26	2:00	1:00	D
 Rule	Zion	2012	only	-	Sep	23	2:00	0	S
 
-# From Ephraim Silverberg (2012-10-18):
-# Yesterday, the Interior Ministry Committee, after more than a year
-# past, approved sending the proposed June 2011 changes to the Time
-# Decree Law back to the Knesset for second and third (final) votes
-# before the upcoming elections on Jan. 22, 2013.  Hence, although the
-# changes are not yet law, they are expected to be so before February 2013.
-#
-# As of 2013, DST starts at 02:00 on the Friday before the last Sunday in March.
-# DST ends at 02:00 on the first Sunday after October 1, unless it occurs on the
-# second day of the Jewish Rosh Hashana holiday, in which case DST ends a day
-# later (i.e. at 02:00 the first Monday after October 2).
-# [Rosh Hashana holidays are factored in until 2100.]
-
-# From Ephraim Silverberg (2012-11-05):
-# The Knesset passed today (in second and final readings) the amendment to the
-# Time Decree Law making the changes ... law.
+# From Ephraim Silverberg (2013-06-27):
+# On June 23, 2013, the Israeli government approved changes to the
+# Time Decree Law.  The next day, the changes passed the First Reading
+# in the Knesset.  The law is expected to pass the Second and Third
+# (final) Readings by the beginning of September 2013.
+#
+# As of 2013, DST starts at 02:00 on the Friday before the last Sunday
+# in March.  DST ends at 02:00 on the last Sunday of October.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Zion	2013	max	-	Mar	Fri>=23	2:00	1:00	D
-Rule	Zion	2013	2026	-	Oct	Sun>=2	2:00	0	S
-Rule	Zion	2027	only	-	Oct	Mon>=3	2:00	0	S
-Rule	Zion	2028	max	-	Oct	Sun>=2	2:00	0	S
-# The following rules are commented out for now, as they break older
-# versions of zic that support only signed 32-bit timestamps, i.e.,
-# through 2038-01-19 03:14:07 UTC.
-#Rule	Zion	2028	2053	-	Oct	Sun>=2	2:00	0	S
-#Rule	Zion	2054	only	-	Oct	Mon>=3	2:00	0	S
-#Rule	Zion	2055	2080	-	Oct	Sun>=2	2:00	0	S
-#Rule	Zion	2081	only	-	Oct	Mon>=3	2:00	0	S
-#Rule	Zion	2082	max	-	Oct	Sun>=2	2:00	0	S
+Rule	Zion	2013	max	-	Oct	lastSun	2:00	0	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Jerusalem	2:20:56 -	LMT	1880
+Zone	Asia/Jerusalem	2:20:54 -	LMT	1880
 			2:20:40	-	JMT	1918	# Jerusalem Mean Time?
 			2:00	Zion	I%sT
 
@@ -2547,8 +2529,8 @@ Rule	Syria	2006	only	-	Sep	22	0:00	0	-
 Rule	Syria	2007	only	-	Mar	lastFri	0:00	1:00	S
 # From Jesper Norgard (2007-10-27):
 # The sister center ICARDA of my work CIMMYT is confirming that Syria DST will
-# not take place 1.st November at 0:00 o'clock but 1.st November at 24:00 or
-# rather Midnight between Thursday and Friday. This does make more sence than
+# not take place 1st November at 0:00 o'clock but 1st November at 24:00 or
+# rather Midnight between Thursday and Friday. This does make more sense than
 # having it between Wednesday and Thursday (two workdays in Syria) since the
 # weekend in Syria is not Saturday and Sunday, but Friday and Saturday. So now
 # it is implemented at midnight of the last workday before weekend...

Modified: stable/9/contrib/tzdata/australasia
==============================================================================
--- stable/9/contrib/tzdata/australasia	Sun Jul  7 22:23:59 2013	(r253009)
+++ stable/9/contrib/tzdata/australasia	Sun Jul  7 22:27:36 2013	(r253010)
@@ -230,10 +230,16 @@ Zone Australia/Lord_Howe 10:36:20 -	LMT	
 # - Macquarie Island will stay on UTC+11 for winter and therefore not
 # switch back from daylight savings time when other parts of Australia do
 # on 4 April.
+#
+# From Arthur David Olson (2013-05-23):
+# The 1919 transition is overspecified below so pre-2013 zics
+# will produce a binary file with an EST-type as the first 32-bit type;
+# this is required for correct handling of times before 1916 by
+# pre-2013 versions of localtime.
 Zone Antarctica/Macquarie 0	-	zzz	1899 Nov
 			10:00	-	EST	1916 Oct 1 2:00
 			10:00	1:00	EST	1917 Feb
-			10:00	Aus	EST	1919 Apr
+			10:00	Aus	EST	1919 Apr 1 0:00s
 			0	-	zzz	1948 Mar 25
 			10:00	Aus	EST	1967
 			10:00	AT	EST	2010 Apr 4 3:00
@@ -1475,12 +1481,12 @@ Zone	Pacific/Wallis	12:15:20 -	LMT	1901
 # From Paul Eggert (2000-01-08):
 # IATA SSIM (1999-09) says DST ends 0100 local time.  Go with McDow.
 
-# From the BBC World Service (1998-10-31 11:32 UTC):
+# From the BBC World Service in
+# http://news.bbc.co.uk/2/hi/asia-pacific/205226.stm (1998-10-31 16:03 UTC):
 # The Fijiian government says the main reasons for the time change is to
-# improve productivity and reduce road accidents.  But correspondents say it
-# also hopes the move will boost Fiji's ability to compete with other pacific
-# islands in the effort to attract tourists to witness the dawning of the new
-# millenium.
+# improve productivity and reduce road accidents.... [T]he move is also
+# intended to boost Fiji's ability to attract tourists to witness the dawning
+# of the new millennium.
 
 # http://www.fiji.gov.fj/press/2000_09/2000_09_13-05.shtml (2000-09-13)
 # reports that Fiji has discontinued DST.
@@ -1625,7 +1631,7 @@ Zone	Pacific/Wallis	12:15:20 -	LMT	1901
 # Shanks & Pottenger say the transition was on 1968-10-01; go with Mundell.
 
 # From Eric Ulevik (1999-05-03):
-# Tonga's director of tourism, who is also secretary of the National Millenium
+# Tonga's director of tourism, who is also secretary of the National Millennium
 # Committee, has a plan to get Tonga back in front.
 # He has proposed a one-off move to tropical daylight saving for Tonga from
 # October to March, which has won approval in principle from the Tongan

Modified: stable/9/contrib/tzdata/europe
==============================================================================
--- stable/9/contrib/tzdata/europe	Sun Jul  7 22:23:59 2013	(r253009)
+++ stable/9/contrib/tzdata/europe	Sun Jul  7 22:27:36 2013	(r253010)
@@ -523,7 +523,7 @@ Rule	C-Eur	1944	only	-	Oct	 2	 2:00s	0	-
 # It seems that Paris, Monaco, Rule France, Rule Belgium all agree on
 # 2:00 standard time, e.g. 3:00 local time.  However there are no
 # countries that use C-Eur rules in September 1945, so the only items
-# affected are apparently these ficticious zones that translates acronyms
+# affected are apparently these fictitious zones that translate acronyms
 # CET and MET:
 #
 # Zone CET  1:00 C-Eur CE%sT
@@ -2779,9 +2779,9 @@ Link	Europe/Istanbul	Asia/Istanbul	# Ist
 
 # Ukraine
 #
-# From Igor Karpov, who works for the Ukranian Ministry of Justice,
+# From Igor Karpov, who works for the Ukrainian Ministry of Justice,
 # via Garrett Wollman (2003-01-27):
-# BTW, I've found the official document on this matter. It's goverment
+# BTW, I've found the official document on this matter. It's government
 # regulations number 509, May 13, 1996. In my poor translation it says:
 # "Time in Ukraine is set to second timezone (Kiev time). Each last Sunday
 # of March at 3am the time is changing to 4am and each last Sunday of
@@ -2815,7 +2815,7 @@ Link	Europe/Istanbul	Asia/Istanbul	# Ist
 # time this year after all.
 #
 # From Udo Schwedt (2011-10-18):
-# As far as I understand, the recent change to the Ukranian time zone
+# As far as I understand, the recent change to the Ukrainian time zone
 # (Europe/Kiev) to introduce permanent daylight saving time (similar
 # to Russia) was reverted today:
 #

Modified: stable/9/contrib/tzdata/southamerica
==============================================================================
--- stable/9/contrib/tzdata/southamerica	Sun Jul  7 22:23:59 2013	(r253009)
+++ stable/9/contrib/tzdata/southamerica	Sun Jul  7 22:27:36 2013	(r253010)
@@ -971,7 +971,7 @@ Rule	Brazil	2007	only	-	Feb	25	 0:00	0	-
 # adopted by the same states as before.
 Rule	Brazil	2007	only	-	Oct	Sun>=8	 0:00	1:00	S
 # From Frederico A. C. Neves (2008-09-10):
-# Acording to this decree
+# According to this decree
 # 
 # http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm
 # 
@@ -1203,7 +1203,7 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
 # 
 #
-# This is not yet reflected in the offical "cambio de hora" site, but
+# This is not yet reflected in the official "cambio de hora" site, but
 # probably will be soon:
 # 
 # http://www.horaoficial.cl/cambio.htm

Modified: stable/9/contrib/tzdata/zone.tab
==============================================================================
--- stable/9/contrib/tzdata/zone.tab	Sun Jul  7 22:23:59 2013	(r253009)
+++ stable/9/contrib/tzdata/zone.tab	Sun Jul  7 22:27:36 2013	(r253010)
@@ -1,18 +1,21 @@
-# 
+# TZ zone descriptions
+#
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
-# TZ zone descriptions
-#
-# From Paul Eggert (1996-08-05):
+# From Paul Eggert (2013-05-27):
 #
 # This file contains a table with the following columns:
 # 1.  ISO 3166 2-character country code.  See /usr/share/misc/iso3166.
+#     This identifies a country that overlaps the zone.  The country may
+#     overlap other zones and the zone may overlap other countries.
 # 2.  Latitude and longitude of the zone's principal location
 #     in ISO 6709 sign-degrees-minutes-seconds format,
 #     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
 #     first latitude (+ is north), then longitude (+ is east).
+#     This location need not lie within the column-1 country.
 # 3.  Zone name used in value of TZ environment variable.
+#     Please see the 'Theory' file for how zone names are chosen.
 # 4.  Comments; present if and only if the country has multiple rows.
 #
 # Columns are separated by a single tab.
@@ -22,6 +25,10 @@
 #
 # Lines beginning with `#' are comments.
 #
+# This table is intended as an aid for users, to help them select time
+# zone data appropriate for their practical needs.  It is not intended
+# to take or endorse any position on legal or territorial claims.
+#
 #country-
 #code	coordinates	TZ			comments
 AD	+4230+00131	Europe/Andorra
@@ -216,7 +223,7 @@ ID	-0002+10920	Asia/Pontianak	west & cen
 ID	-0507+11924	Asia/Makassar	east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
 ID	-0232+14042	Asia/Jayapura	west New Guinea (Irian Jaya) & Malukus (Moluccas)
 IE	+5320-00615	Europe/Dublin
-IL	+3146+03514	Asia/Jerusalem
+IL	+314650+0351326	Asia/Jerusalem
 IM	+5409-00428	Europe/Isle_of_Man
 IN	+2232+08822	Asia/Kolkata
 IO	-0720+07225	Indian/Chagos

From owner-svn-src-all@FreeBSD.ORG  Sun Jul  7 22:27:49 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id A7CF32A3;
 Sun,  7 Jul 2013 22:27:49 +0000 (UTC)
 (envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 0B29A199A;
 Sun,  7 Jul 2013 22:27:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67MRmA1061277;
 Sun, 7 Jul 2013 22:27:48 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67MRlNM061251;
 Sun, 7 Jul 2013 22:27:47 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201307072227.r67MRlNM061251@svn.freebsd.org>
From: Edwin Groothuis 
Date: Sun, 7 Jul 2013 22:27:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253011 - stable/8/share/zoneinfo
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 07 Jul 2013 22:27:49 -0000

Author: edwin
Date: Sun Jul  7 22:27:47 2013
New Revision: 253011
URL: http://svnweb.freebsd.org/changeset/base/253011

Log:
  MFC of tzdata2013d, 253009
  
  - Morocco:
    announced that the year's Ramadan daylight-savings transitions
    would be 2013-07-07 and 2013-08-10.
  
  - Israel:
    As of 2013, DST starts at 02:00 on the Friday before the last
    Sunday in March.  DST ends at 02:00 on the first Sunday after
    October 1, unless it occurs on the second day of the Jewish Rosh
    Hashana holiday, in which case DST ends a day later (i.e. at 02:00
    the first Monday after October 2).  [Rosh Hashana holidays are
    factored in until 2100.]

Modified:
  stable/8/share/zoneinfo/africa
  stable/8/share/zoneinfo/asia
  stable/8/share/zoneinfo/australasia
  stable/8/share/zoneinfo/europe
  stable/8/share/zoneinfo/southamerica
  stable/8/share/zoneinfo/zone.tab
Directory Properties:
  stable/8/share/zoneinfo/   (props changed)

Modified: stable/8/share/zoneinfo/africa
==============================================================================
--- stable/8/share/zoneinfo/africa	Sun Jul  7 22:27:36 2013	(r253010)
+++ stable/8/share/zoneinfo/africa	Sun Jul  7 22:27:47 2013	(r253011)
@@ -852,12 +852,18 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # announced that year's Ramadan daylight-saving transitions would be
 # 2012-07-20 and 2012-08-20; see
 # .
-#
+
+# From Andrew Paprocki (2013-07-02):
+# Morocco announced that the year's Ramadan daylight-savings
+# transitions would be 2013-07-07 and 2013-08-10; see:
+# http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10
+
+# From Paul Eggert (2013-07-03):
 # To estimate what the Moroccan government will do in future years,
-# transition dates for 2013 through 2021 were determined by running
+# transition dates for 2014 through 2021 were determined by running
 # the following program under GNU Emacs 24.3:
 #
-# (let ((islamic-year 1434))
+# (let ((islamic-year 1435))
 #   (while (< islamic-year 1444)
 #     (let ((a
 #	     (calendar-gregorian-from-absolute
@@ -910,8 +916,8 @@ Rule	Morocco	2012	2019	-	Apr	 lastSun 2:
 Rule	Morocco	2012	max	-	Sep	 lastSun 3:00	0	-
 Rule	Morocco	2012	only	-	Jul	 20	 3:00	0	-
 Rule	Morocco	2012	only	-	Aug	 20	 2:00	1:00	S
-Rule	Morocco	2013	only	-	Jul	  9	 3:00	0	-
-Rule	Morocco	2013	only	-	Aug	  8	 2:00	1:00	S
+Rule	Morocco	2013	only	-	Jul	  7	 3:00	0	-
+Rule	Morocco	2013	only	-	Aug	 10	 2:00	1:00	S
 Rule	Morocco	2014	only	-	Jun	 29	 3:00	0	-
 Rule	Morocco	2014	only	-	Jul	 29	 2:00	1:00	S
 Rule	Morocco	2015	only	-	Jun	 18	 3:00	0	-

Modified: stable/8/share/zoneinfo/asia
==============================================================================
--- stable/8/share/zoneinfo/asia	Sun Jul  7 22:27:36 2013	(r253010)
+++ stable/8/share/zoneinfo/asia	Sun Jul  7 22:27:47 2013	(r253011)
@@ -1212,39 +1212,21 @@ Rule	Zion	2011	only	-	Oct	 2	2:00	0	S
 Rule	Zion	2012	only	-	Mar	Fri>=26	2:00	1:00	D
 Rule	Zion	2012	only	-	Sep	23	2:00	0	S
 
-# From Ephraim Silverberg (2012-10-18):
-# Yesterday, the Interior Ministry Committee, after more than a year
-# past, approved sending the proposed June 2011 changes to the Time
-# Decree Law back to the Knesset for second and third (final) votes
-# before the upcoming elections on Jan. 22, 2013.  Hence, although the
-# changes are not yet law, they are expected to be so before February 2013.
-#
-# As of 2013, DST starts at 02:00 on the Friday before the last Sunday in March.
-# DST ends at 02:00 on the first Sunday after October 1, unless it occurs on the
-# second day of the Jewish Rosh Hashana holiday, in which case DST ends a day
-# later (i.e. at 02:00 the first Monday after October 2).
-# [Rosh Hashana holidays are factored in until 2100.]
-
-# From Ephraim Silverberg (2012-11-05):
-# The Knesset passed today (in second and final readings) the amendment to the
-# Time Decree Law making the changes ... law.
+# From Ephraim Silverberg (2013-06-27):
+# On June 23, 2013, the Israeli government approved changes to the
+# Time Decree Law.  The next day, the changes passed the First Reading
+# in the Knesset.  The law is expected to pass the Second and Third
+# (final) Readings by the beginning of September 2013.
+#
+# As of 2013, DST starts at 02:00 on the Friday before the last Sunday
+# in March.  DST ends at 02:00 on the last Sunday of October.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Zion	2013	max	-	Mar	Fri>=23	2:00	1:00	D
-Rule	Zion	2013	2026	-	Oct	Sun>=2	2:00	0	S
-Rule	Zion	2027	only	-	Oct	Mon>=3	2:00	0	S
-Rule	Zion	2028	max	-	Oct	Sun>=2	2:00	0	S
-# The following rules are commented out for now, as they break older
-# versions of zic that support only signed 32-bit timestamps, i.e.,
-# through 2038-01-19 03:14:07 UTC.
-#Rule	Zion	2028	2053	-	Oct	Sun>=2	2:00	0	S
-#Rule	Zion	2054	only	-	Oct	Mon>=3	2:00	0	S
-#Rule	Zion	2055	2080	-	Oct	Sun>=2	2:00	0	S
-#Rule	Zion	2081	only	-	Oct	Mon>=3	2:00	0	S
-#Rule	Zion	2082	max	-	Oct	Sun>=2	2:00	0	S
+Rule	Zion	2013	max	-	Oct	lastSun	2:00	0	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Jerusalem	2:20:56 -	LMT	1880
+Zone	Asia/Jerusalem	2:20:54 -	LMT	1880
 			2:20:40	-	JMT	1918	# Jerusalem Mean Time?
 			2:00	Zion	I%sT
 
@@ -2547,8 +2529,8 @@ Rule	Syria	2006	only	-	Sep	22	0:00	0	-
 Rule	Syria	2007	only	-	Mar	lastFri	0:00	1:00	S
 # From Jesper Norgard (2007-10-27):
 # The sister center ICARDA of my work CIMMYT is confirming that Syria DST will
-# not take place 1.st November at 0:00 o'clock but 1.st November at 24:00 or
-# rather Midnight between Thursday and Friday. This does make more sence than
+# not take place 1st November at 0:00 o'clock but 1st November at 24:00 or
+# rather Midnight between Thursday and Friday. This does make more sense than
 # having it between Wednesday and Thursday (two workdays in Syria) since the
 # weekend in Syria is not Saturday and Sunday, but Friday and Saturday. So now
 # it is implemented at midnight of the last workday before weekend...

Modified: stable/8/share/zoneinfo/australasia
==============================================================================
--- stable/8/share/zoneinfo/australasia	Sun Jul  7 22:27:36 2013	(r253010)
+++ stable/8/share/zoneinfo/australasia	Sun Jul  7 22:27:47 2013	(r253011)
@@ -230,10 +230,16 @@ Zone Australia/Lord_Howe 10:36:20 -	LMT	
 # - Macquarie Island will stay on UTC+11 for winter and therefore not
 # switch back from daylight savings time when other parts of Australia do
 # on 4 April.
+#
+# From Arthur David Olson (2013-05-23):
+# The 1919 transition is overspecified below so pre-2013 zics
+# will produce a binary file with an EST-type as the first 32-bit type;
+# this is required for correct handling of times before 1916 by
+# pre-2013 versions of localtime.
 Zone Antarctica/Macquarie 0	-	zzz	1899 Nov
 			10:00	-	EST	1916 Oct 1 2:00
 			10:00	1:00	EST	1917 Feb
-			10:00	Aus	EST	1919 Apr
+			10:00	Aus	EST	1919 Apr 1 0:00s
 			0	-	zzz	1948 Mar 25
 			10:00	Aus	EST	1967
 			10:00	AT	EST	2010 Apr 4 3:00
@@ -1475,12 +1481,12 @@ Zone	Pacific/Wallis	12:15:20 -	LMT	1901
 # From Paul Eggert (2000-01-08):
 # IATA SSIM (1999-09) says DST ends 0100 local time.  Go with McDow.
 
-# From the BBC World Service (1998-10-31 11:32 UTC):
+# From the BBC World Service in
+# http://news.bbc.co.uk/2/hi/asia-pacific/205226.stm (1998-10-31 16:03 UTC):
 # The Fijiian government says the main reasons for the time change is to
-# improve productivity and reduce road accidents.  But correspondents say it
-# also hopes the move will boost Fiji's ability to compete with other pacific
-# islands in the effort to attract tourists to witness the dawning of the new
-# millenium.
+# improve productivity and reduce road accidents.... [T]he move is also
+# intended to boost Fiji's ability to attract tourists to witness the dawning
+# of the new millennium.
 
 # http://www.fiji.gov.fj/press/2000_09/2000_09_13-05.shtml (2000-09-13)
 # reports that Fiji has discontinued DST.
@@ -1625,7 +1631,7 @@ Zone	Pacific/Wallis	12:15:20 -	LMT	1901
 # Shanks & Pottenger say the transition was on 1968-10-01; go with Mundell.
 
 # From Eric Ulevik (1999-05-03):
-# Tonga's director of tourism, who is also secretary of the National Millenium
+# Tonga's director of tourism, who is also secretary of the National Millennium
 # Committee, has a plan to get Tonga back in front.
 # He has proposed a one-off move to tropical daylight saving for Tonga from
 # October to March, which has won approval in principle from the Tongan

Modified: stable/8/share/zoneinfo/europe
==============================================================================
--- stable/8/share/zoneinfo/europe	Sun Jul  7 22:27:36 2013	(r253010)
+++ stable/8/share/zoneinfo/europe	Sun Jul  7 22:27:47 2013	(r253011)
@@ -523,7 +523,7 @@ Rule	C-Eur	1944	only	-	Oct	 2	 2:00s	0	-
 # It seems that Paris, Monaco, Rule France, Rule Belgium all agree on
 # 2:00 standard time, e.g. 3:00 local time.  However there are no
 # countries that use C-Eur rules in September 1945, so the only items
-# affected are apparently these ficticious zones that translates acronyms
+# affected are apparently these fictitious zones that translate acronyms
 # CET and MET:
 #
 # Zone CET  1:00 C-Eur CE%sT
@@ -2779,9 +2779,9 @@ Link	Europe/Istanbul	Asia/Istanbul	# Ist
 
 # Ukraine
 #
-# From Igor Karpov, who works for the Ukranian Ministry of Justice,
+# From Igor Karpov, who works for the Ukrainian Ministry of Justice,
 # via Garrett Wollman (2003-01-27):
-# BTW, I've found the official document on this matter. It's goverment
+# BTW, I've found the official document on this matter. It's government
 # regulations number 509, May 13, 1996. In my poor translation it says:
 # "Time in Ukraine is set to second timezone (Kiev time). Each last Sunday
 # of March at 3am the time is changing to 4am and each last Sunday of
@@ -2815,7 +2815,7 @@ Link	Europe/Istanbul	Asia/Istanbul	# Ist
 # time this year after all.
 #
 # From Udo Schwedt (2011-10-18):
-# As far as I understand, the recent change to the Ukranian time zone
+# As far as I understand, the recent change to the Ukrainian time zone
 # (Europe/Kiev) to introduce permanent daylight saving time (similar
 # to Russia) was reverted today:
 #

Modified: stable/8/share/zoneinfo/southamerica
==============================================================================
--- stable/8/share/zoneinfo/southamerica	Sun Jul  7 22:27:36 2013	(r253010)
+++ stable/8/share/zoneinfo/southamerica	Sun Jul  7 22:27:47 2013	(r253011)
@@ -971,7 +971,7 @@ Rule	Brazil	2007	only	-	Feb	25	 0:00	0	-
 # adopted by the same states as before.
 Rule	Brazil	2007	only	-	Oct	Sun>=8	 0:00	1:00	S
 # From Frederico A. C. Neves (2008-09-10):
-# Acording to this decree
+# According to this decree
 # 
 # http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm
 # 
@@ -1203,7 +1203,7 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
 # 
 #
-# This is not yet reflected in the offical "cambio de hora" site, but
+# This is not yet reflected in the official "cambio de hora" site, but
 # probably will be soon:
 # 
 # http://www.horaoficial.cl/cambio.htm

Modified: stable/8/share/zoneinfo/zone.tab
==============================================================================
--- stable/8/share/zoneinfo/zone.tab	Sun Jul  7 22:27:36 2013	(r253010)
+++ stable/8/share/zoneinfo/zone.tab	Sun Jul  7 22:27:47 2013	(r253011)
@@ -1,18 +1,21 @@
-# 
+# TZ zone descriptions
+#
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
-# TZ zone descriptions
-#
-# From Paul Eggert (1996-08-05):
+# From Paul Eggert (2013-05-27):
 #
 # This file contains a table with the following columns:
 # 1.  ISO 3166 2-character country code.  See /usr/share/misc/iso3166.
+#     This identifies a country that overlaps the zone.  The country may
+#     overlap other zones and the zone may overlap other countries.
 # 2.  Latitude and longitude of the zone's principal location
 #     in ISO 6709 sign-degrees-minutes-seconds format,
 #     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
 #     first latitude (+ is north), then longitude (+ is east).
+#     This location need not lie within the column-1 country.
 # 3.  Zone name used in value of TZ environment variable.
+#     Please see the 'Theory' file for how zone names are chosen.
 # 4.  Comments; present if and only if the country has multiple rows.
 #
 # Columns are separated by a single tab.
@@ -22,6 +25,10 @@
 #
 # Lines beginning with `#' are comments.
 #
+# This table is intended as an aid for users, to help them select time
+# zone data appropriate for their practical needs.  It is not intended
+# to take or endorse any position on legal or territorial claims.
+#
 #country-
 #code	coordinates	TZ			comments
 AD	+4230+00131	Europe/Andorra
@@ -216,7 +223,7 @@ ID	-0002+10920	Asia/Pontianak	west & cen
 ID	-0507+11924	Asia/Makassar	east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
 ID	-0232+14042	Asia/Jayapura	west New Guinea (Irian Jaya) & Malukus (Moluccas)
 IE	+5320-00615	Europe/Dublin
-IL	+3146+03514	Asia/Jerusalem
+IL	+314650+0351326	Asia/Jerusalem
 IM	+5409-00428	Europe/Isle_of_Man
 IN	+2232+08822	Asia/Kolkata
 IO	-0720+07225	Indian/Chagos

From owner-svn-src-all@FreeBSD.ORG  Sun Jul  7 22:27:50 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 3EA822A5;
 Sun,  7 Jul 2013 22:27:50 +0000 (UTC)
 (envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 2EE3E199C;
 Sun,  7 Jul 2013 22:27:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67MRo9C061300;
 Sun, 7 Jul 2013 22:27:50 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67MRmkk061291;
 Sun, 7 Jul 2013 22:27:48 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201307072227.r67MRmkk061291@svn.freebsd.org>
From: Edwin Groothuis 
Date: Sun, 7 Jul 2013 22:27:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
Subject: svn commit: r253012 - stable/6/share/zoneinfo
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 07 Jul 2013 22:27:50 -0000

Author: edwin
Date: Sun Jul  7 22:27:48 2013
New Revision: 253012
URL: http://svnweb.freebsd.org/changeset/base/253012

Log:
  MFC of tzdata2013d, 253009
  
  - Morocco:
    announced that the year's Ramadan daylight-savings transitions
    would be 2013-07-07 and 2013-08-10.
  
  - Israel:
    As of 2013, DST starts at 02:00 on the Friday before the last
    Sunday in March.  DST ends at 02:00 on the first Sunday after
    October 1, unless it occurs on the second day of the Jewish Rosh
    Hashana holiday, in which case DST ends a day later (i.e. at 02:00
    the first Monday after October 2).  [Rosh Hashana holidays are
    factored in until 2100.]

Modified:
  stable/6/share/zoneinfo/africa
  stable/6/share/zoneinfo/asia
  stable/6/share/zoneinfo/australasia
  stable/6/share/zoneinfo/europe
  stable/6/share/zoneinfo/southamerica
  stable/6/share/zoneinfo/zone.tab
Directory Properties:
  stable/6/share/zoneinfo/   (props changed)

Modified: stable/6/share/zoneinfo/africa
==============================================================================
--- stable/6/share/zoneinfo/africa	Sun Jul  7 22:27:47 2013	(r253011)
+++ stable/6/share/zoneinfo/africa	Sun Jul  7 22:27:48 2013	(r253012)
@@ -852,12 +852,18 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # announced that year's Ramadan daylight-saving transitions would be
 # 2012-07-20 and 2012-08-20; see
 # .
-#
+
+# From Andrew Paprocki (2013-07-02):
+# Morocco announced that the year's Ramadan daylight-savings
+# transitions would be 2013-07-07 and 2013-08-10; see:
+# http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10
+
+# From Paul Eggert (2013-07-03):
 # To estimate what the Moroccan government will do in future years,
-# transition dates for 2013 through 2021 were determined by running
+# transition dates for 2014 through 2021 were determined by running
 # the following program under GNU Emacs 24.3:
 #
-# (let ((islamic-year 1434))
+# (let ((islamic-year 1435))
 #   (while (< islamic-year 1444)
 #     (let ((a
 #	     (calendar-gregorian-from-absolute
@@ -910,8 +916,8 @@ Rule	Morocco	2012	2019	-	Apr	 lastSun 2:
 Rule	Morocco	2012	max	-	Sep	 lastSun 3:00	0	-
 Rule	Morocco	2012	only	-	Jul	 20	 3:00	0	-
 Rule	Morocco	2012	only	-	Aug	 20	 2:00	1:00	S
-Rule	Morocco	2013	only	-	Jul	  9	 3:00	0	-
-Rule	Morocco	2013	only	-	Aug	  8	 2:00	1:00	S
+Rule	Morocco	2013	only	-	Jul	  7	 3:00	0	-
+Rule	Morocco	2013	only	-	Aug	 10	 2:00	1:00	S
 Rule	Morocco	2014	only	-	Jun	 29	 3:00	0	-
 Rule	Morocco	2014	only	-	Jul	 29	 2:00	1:00	S
 Rule	Morocco	2015	only	-	Jun	 18	 3:00	0	-

Modified: stable/6/share/zoneinfo/asia
==============================================================================
--- stable/6/share/zoneinfo/asia	Sun Jul  7 22:27:47 2013	(r253011)
+++ stable/6/share/zoneinfo/asia	Sun Jul  7 22:27:48 2013	(r253012)
@@ -1212,39 +1212,21 @@ Rule	Zion	2011	only	-	Oct	 2	2:00	0	S
 Rule	Zion	2012	only	-	Mar	Fri>=26	2:00	1:00	D
 Rule	Zion	2012	only	-	Sep	23	2:00	0	S
 
-# From Ephraim Silverberg (2012-10-18):
-# Yesterday, the Interior Ministry Committee, after more than a year
-# past, approved sending the proposed June 2011 changes to the Time
-# Decree Law back to the Knesset for second and third (final) votes
-# before the upcoming elections on Jan. 22, 2013.  Hence, although the
-# changes are not yet law, they are expected to be so before February 2013.
-#
-# As of 2013, DST starts at 02:00 on the Friday before the last Sunday in March.
-# DST ends at 02:00 on the first Sunday after October 1, unless it occurs on the
-# second day of the Jewish Rosh Hashana holiday, in which case DST ends a day
-# later (i.e. at 02:00 the first Monday after October 2).
-# [Rosh Hashana holidays are factored in until 2100.]
-
-# From Ephraim Silverberg (2012-11-05):
-# The Knesset passed today (in second and final readings) the amendment to the
-# Time Decree Law making the changes ... law.
+# From Ephraim Silverberg (2013-06-27):
+# On June 23, 2013, the Israeli government approved changes to the
+# Time Decree Law.  The next day, the changes passed the First Reading
+# in the Knesset.  The law is expected to pass the Second and Third
+# (final) Readings by the beginning of September 2013.
+#
+# As of 2013, DST starts at 02:00 on the Friday before the last Sunday
+# in March.  DST ends at 02:00 on the last Sunday of October.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Zion	2013	max	-	Mar	Fri>=23	2:00	1:00	D
-Rule	Zion	2013	2026	-	Oct	Sun>=2	2:00	0	S
-Rule	Zion	2027	only	-	Oct	Mon>=3	2:00	0	S
-Rule	Zion	2028	max	-	Oct	Sun>=2	2:00	0	S
-# The following rules are commented out for now, as they break older
-# versions of zic that support only signed 32-bit timestamps, i.e.,
-# through 2038-01-19 03:14:07 UTC.
-#Rule	Zion	2028	2053	-	Oct	Sun>=2	2:00	0	S
-#Rule	Zion	2054	only	-	Oct	Mon>=3	2:00	0	S
-#Rule	Zion	2055	2080	-	Oct	Sun>=2	2:00	0	S
-#Rule	Zion	2081	only	-	Oct	Mon>=3	2:00	0	S
-#Rule	Zion	2082	max	-	Oct	Sun>=2	2:00	0	S
+Rule	Zion	2013	max	-	Oct	lastSun	2:00	0	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Jerusalem	2:20:56 -	LMT	1880
+Zone	Asia/Jerusalem	2:20:54 -	LMT	1880
 			2:20:40	-	JMT	1918	# Jerusalem Mean Time?
 			2:00	Zion	I%sT
 
@@ -2547,8 +2529,8 @@ Rule	Syria	2006	only	-	Sep	22	0:00	0	-
 Rule	Syria	2007	only	-	Mar	lastFri	0:00	1:00	S
 # From Jesper Norgard (2007-10-27):
 # The sister center ICARDA of my work CIMMYT is confirming that Syria DST will
-# not take place 1.st November at 0:00 o'clock but 1.st November at 24:00 or
-# rather Midnight between Thursday and Friday. This does make more sence than
+# not take place 1st November at 0:00 o'clock but 1st November at 24:00 or
+# rather Midnight between Thursday and Friday. This does make more sense than
 # having it between Wednesday and Thursday (two workdays in Syria) since the
 # weekend in Syria is not Saturday and Sunday, but Friday and Saturday. So now
 # it is implemented at midnight of the last workday before weekend...

Modified: stable/6/share/zoneinfo/australasia
==============================================================================
--- stable/6/share/zoneinfo/australasia	Sun Jul  7 22:27:47 2013	(r253011)
+++ stable/6/share/zoneinfo/australasia	Sun Jul  7 22:27:48 2013	(r253012)
@@ -230,10 +230,16 @@ Zone Australia/Lord_Howe 10:36:20 -	LMT	
 # - Macquarie Island will stay on UTC+11 for winter and therefore not
 # switch back from daylight savings time when other parts of Australia do
 # on 4 April.
+#
+# From Arthur David Olson (2013-05-23):
+# The 1919 transition is overspecified below so pre-2013 zics
+# will produce a binary file with an EST-type as the first 32-bit type;
+# this is required for correct handling of times before 1916 by
+# pre-2013 versions of localtime.
 Zone Antarctica/Macquarie 0	-	zzz	1899 Nov
 			10:00	-	EST	1916 Oct 1 2:00
 			10:00	1:00	EST	1917 Feb
-			10:00	Aus	EST	1919 Apr
+			10:00	Aus	EST	1919 Apr 1 0:00s
 			0	-	zzz	1948 Mar 25
 			10:00	Aus	EST	1967
 			10:00	AT	EST	2010 Apr 4 3:00
@@ -1475,12 +1481,12 @@ Zone	Pacific/Wallis	12:15:20 -	LMT	1901
 # From Paul Eggert (2000-01-08):
 # IATA SSIM (1999-09) says DST ends 0100 local time.  Go with McDow.
 
-# From the BBC World Service (1998-10-31 11:32 UTC):
+# From the BBC World Service in
+# http://news.bbc.co.uk/2/hi/asia-pacific/205226.stm (1998-10-31 16:03 UTC):
 # The Fijiian government says the main reasons for the time change is to
-# improve productivity and reduce road accidents.  But correspondents say it
-# also hopes the move will boost Fiji's ability to compete with other pacific
-# islands in the effort to attract tourists to witness the dawning of the new
-# millenium.
+# improve productivity and reduce road accidents.... [T]he move is also
+# intended to boost Fiji's ability to attract tourists to witness the dawning
+# of the new millennium.
 
 # http://www.fiji.gov.fj/press/2000_09/2000_09_13-05.shtml (2000-09-13)
 # reports that Fiji has discontinued DST.
@@ -1625,7 +1631,7 @@ Zone	Pacific/Wallis	12:15:20 -	LMT	1901
 # Shanks & Pottenger say the transition was on 1968-10-01; go with Mundell.
 
 # From Eric Ulevik (1999-05-03):
-# Tonga's director of tourism, who is also secretary of the National Millenium
+# Tonga's director of tourism, who is also secretary of the National Millennium
 # Committee, has a plan to get Tonga back in front.
 # He has proposed a one-off move to tropical daylight saving for Tonga from
 # October to March, which has won approval in principle from the Tongan

Modified: stable/6/share/zoneinfo/europe
==============================================================================
--- stable/6/share/zoneinfo/europe	Sun Jul  7 22:27:47 2013	(r253011)
+++ stable/6/share/zoneinfo/europe	Sun Jul  7 22:27:48 2013	(r253012)
@@ -523,7 +523,7 @@ Rule	C-Eur	1944	only	-	Oct	 2	 2:00s	0	-
 # It seems that Paris, Monaco, Rule France, Rule Belgium all agree on
 # 2:00 standard time, e.g. 3:00 local time.  However there are no
 # countries that use C-Eur rules in September 1945, so the only items
-# affected are apparently these ficticious zones that translates acronyms
+# affected are apparently these fictitious zones that translate acronyms
 # CET and MET:
 #
 # Zone CET  1:00 C-Eur CE%sT
@@ -2779,9 +2779,9 @@ Link	Europe/Istanbul	Asia/Istanbul	# Ist
 
 # Ukraine
 #
-# From Igor Karpov, who works for the Ukranian Ministry of Justice,
+# From Igor Karpov, who works for the Ukrainian Ministry of Justice,
 # via Garrett Wollman (2003-01-27):
-# BTW, I've found the official document on this matter. It's goverment
+# BTW, I've found the official document on this matter. It's government
 # regulations number 509, May 13, 1996. In my poor translation it says:
 # "Time in Ukraine is set to second timezone (Kiev time). Each last Sunday
 # of March at 3am the time is changing to 4am and each last Sunday of
@@ -2815,7 +2815,7 @@ Link	Europe/Istanbul	Asia/Istanbul	# Ist
 # time this year after all.
 #
 # From Udo Schwedt (2011-10-18):
-# As far as I understand, the recent change to the Ukranian time zone
+# As far as I understand, the recent change to the Ukrainian time zone
 # (Europe/Kiev) to introduce permanent daylight saving time (similar
 # to Russia) was reverted today:
 #

Modified: stable/6/share/zoneinfo/southamerica
==============================================================================
--- stable/6/share/zoneinfo/southamerica	Sun Jul  7 22:27:47 2013	(r253011)
+++ stable/6/share/zoneinfo/southamerica	Sun Jul  7 22:27:48 2013	(r253012)
@@ -971,7 +971,7 @@ Rule	Brazil	2007	only	-	Feb	25	 0:00	0	-
 # adopted by the same states as before.
 Rule	Brazil	2007	only	-	Oct	Sun>=8	 0:00	1:00	S
 # From Frederico A. C. Neves (2008-09-10):
-# Acording to this decree
+# According to this decree
 # 
 # http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm
 # 
@@ -1203,7 +1203,7 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
 # 
 #
-# This is not yet reflected in the offical "cambio de hora" site, but
+# This is not yet reflected in the official "cambio de hora" site, but
 # probably will be soon:
 # 
 # http://www.horaoficial.cl/cambio.htm

Modified: stable/6/share/zoneinfo/zone.tab
==============================================================================
--- stable/6/share/zoneinfo/zone.tab	Sun Jul  7 22:27:47 2013	(r253011)
+++ stable/6/share/zoneinfo/zone.tab	Sun Jul  7 22:27:48 2013	(r253012)
@@ -1,18 +1,21 @@
-# 
+# TZ zone descriptions
+#
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
-# TZ zone descriptions
-#
-# From Paul Eggert (1996-08-05):
+# From Paul Eggert (2013-05-27):
 #
 # This file contains a table with the following columns:
 # 1.  ISO 3166 2-character country code.  See /usr/share/misc/iso3166.
+#     This identifies a country that overlaps the zone.  The country may
+#     overlap other zones and the zone may overlap other countries.
 # 2.  Latitude and longitude of the zone's principal location
 #     in ISO 6709 sign-degrees-minutes-seconds format,
 #     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
 #     first latitude (+ is north), then longitude (+ is east).
+#     This location need not lie within the column-1 country.
 # 3.  Zone name used in value of TZ environment variable.
+#     Please see the 'Theory' file for how zone names are chosen.
 # 4.  Comments; present if and only if the country has multiple rows.
 #
 # Columns are separated by a single tab.
@@ -22,6 +25,10 @@
 #
 # Lines beginning with `#' are comments.
 #
+# This table is intended as an aid for users, to help them select time
+# zone data appropriate for their practical needs.  It is not intended
+# to take or endorse any position on legal or territorial claims.
+#
 #country-
 #code	coordinates	TZ			comments
 AD	+4230+00131	Europe/Andorra
@@ -216,7 +223,7 @@ ID	-0002+10920	Asia/Pontianak	west & cen
 ID	-0507+11924	Asia/Makassar	east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
 ID	-0232+14042	Asia/Jayapura	west New Guinea (Irian Jaya) & Malukus (Moluccas)
 IE	+5320-00615	Europe/Dublin
-IL	+3146+03514	Asia/Jerusalem
+IL	+314650+0351326	Asia/Jerusalem
 IM	+5409-00428	Europe/Isle_of_Man
 IN	+2232+08822	Asia/Kolkata
 IO	-0720+07225	Indian/Chagos

From owner-svn-src-all@FreeBSD.ORG  Sun Jul  7 22:28:00 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 8301C390;
 Sun,  7 Jul 2013 22:28:00 +0000 (UTC)
 (envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 6CAA319A3;
 Sun,  7 Jul 2013 22:28:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67MS0P2061365;
 Sun, 7 Jul 2013 22:28:00 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67MRx6O061352;
 Sun, 7 Jul 2013 22:27:59 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201307072227.r67MRx6O061352@svn.freebsd.org>
From: Edwin Groothuis 
Date: Sun, 7 Jul 2013 22:27:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject: svn commit: r253013 - stable/7/share/zoneinfo
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sun, 07 Jul 2013 22:28:00 -0000

Author: edwin
Date: Sun Jul  7 22:27:58 2013
New Revision: 253013
URL: http://svnweb.freebsd.org/changeset/base/253013

Log:
  MFC of tzdata2013d, 253009
  
  - Morocco:
    announced that the year's Ramadan daylight-savings transitions
    would be 2013-07-07 and 2013-08-10.
  
  - Israel:
    As of 2013, DST starts at 02:00 on the Friday before the last
    Sunday in March.  DST ends at 02:00 on the first Sunday after
    October 1, unless it occurs on the second day of the Jewish Rosh
    Hashana holiday, in which case DST ends a day later (i.e. at 02:00
    the first Monday after October 2).  [Rosh Hashana holidays are
    factored in until 2100.]

Modified:
  stable/7/share/zoneinfo/africa
  stable/7/share/zoneinfo/asia
  stable/7/share/zoneinfo/australasia
  stable/7/share/zoneinfo/europe
  stable/7/share/zoneinfo/southamerica
  stable/7/share/zoneinfo/zone.tab
Directory Properties:
  stable/7/share/zoneinfo/   (props changed)

Modified: stable/7/share/zoneinfo/africa
==============================================================================
--- stable/7/share/zoneinfo/africa	Sun Jul  7 22:27:48 2013	(r253012)
+++ stable/7/share/zoneinfo/africa	Sun Jul  7 22:27:58 2013	(r253013)
@@ -852,12 +852,18 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # announced that year's Ramadan daylight-saving transitions would be
 # 2012-07-20 and 2012-08-20; see
 # .
-#
+
+# From Andrew Paprocki (2013-07-02):
+# Morocco announced that the year's Ramadan daylight-savings
+# transitions would be 2013-07-07 and 2013-08-10; see:
+# http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10
+
+# From Paul Eggert (2013-07-03):
 # To estimate what the Moroccan government will do in future years,
-# transition dates for 2013 through 2021 were determined by running
+# transition dates for 2014 through 2021 were determined by running
 # the following program under GNU Emacs 24.3:
 #
-# (let ((islamic-year 1434))
+# (let ((islamic-year 1435))
 #   (while (< islamic-year 1444)
 #     (let ((a
 #	     (calendar-gregorian-from-absolute
@@ -910,8 +916,8 @@ Rule	Morocco	2012	2019	-	Apr	 lastSun 2:
 Rule	Morocco	2012	max	-	Sep	 lastSun 3:00	0	-
 Rule	Morocco	2012	only	-	Jul	 20	 3:00	0	-
 Rule	Morocco	2012	only	-	Aug	 20	 2:00	1:00	S
-Rule	Morocco	2013	only	-	Jul	  9	 3:00	0	-
-Rule	Morocco	2013	only	-	Aug	  8	 2:00	1:00	S
+Rule	Morocco	2013	only	-	Jul	  7	 3:00	0	-
+Rule	Morocco	2013	only	-	Aug	 10	 2:00	1:00	S
 Rule	Morocco	2014	only	-	Jun	 29	 3:00	0	-
 Rule	Morocco	2014	only	-	Jul	 29	 2:00	1:00	S
 Rule	Morocco	2015	only	-	Jun	 18	 3:00	0	-

Modified: stable/7/share/zoneinfo/asia
==============================================================================
--- stable/7/share/zoneinfo/asia	Sun Jul  7 22:27:48 2013	(r253012)
+++ stable/7/share/zoneinfo/asia	Sun Jul  7 22:27:58 2013	(r253013)
@@ -1212,39 +1212,21 @@ Rule	Zion	2011	only	-	Oct	 2	2:00	0	S
 Rule	Zion	2012	only	-	Mar	Fri>=26	2:00	1:00	D
 Rule	Zion	2012	only	-	Sep	23	2:00	0	S
 
-# From Ephraim Silverberg (2012-10-18):
-# Yesterday, the Interior Ministry Committee, after more than a year
-# past, approved sending the proposed June 2011 changes to the Time
-# Decree Law back to the Knesset for second and third (final) votes
-# before the upcoming elections on Jan. 22, 2013.  Hence, although the
-# changes are not yet law, they are expected to be so before February 2013.
-#
-# As of 2013, DST starts at 02:00 on the Friday before the last Sunday in March.
-# DST ends at 02:00 on the first Sunday after October 1, unless it occurs on the
-# second day of the Jewish Rosh Hashana holiday, in which case DST ends a day
-# later (i.e. at 02:00 the first Monday after October 2).
-# [Rosh Hashana holidays are factored in until 2100.]
-
-# From Ephraim Silverberg (2012-11-05):
-# The Knesset passed today (in second and final readings) the amendment to the
-# Time Decree Law making the changes ... law.
+# From Ephraim Silverberg (2013-06-27):
+# On June 23, 2013, the Israeli government approved changes to the
+# Time Decree Law.  The next day, the changes passed the First Reading
+# in the Knesset.  The law is expected to pass the Second and Third
+# (final) Readings by the beginning of September 2013.
+#
+# As of 2013, DST starts at 02:00 on the Friday before the last Sunday
+# in March.  DST ends at 02:00 on the last Sunday of October.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Zion	2013	max	-	Mar	Fri>=23	2:00	1:00	D
-Rule	Zion	2013	2026	-	Oct	Sun>=2	2:00	0	S
-Rule	Zion	2027	only	-	Oct	Mon>=3	2:00	0	S
-Rule	Zion	2028	max	-	Oct	Sun>=2	2:00	0	S
-# The following rules are commented out for now, as they break older
-# versions of zic that support only signed 32-bit timestamps, i.e.,
-# through 2038-01-19 03:14:07 UTC.
-#Rule	Zion	2028	2053	-	Oct	Sun>=2	2:00	0	S
-#Rule	Zion	2054	only	-	Oct	Mon>=3	2:00	0	S
-#Rule	Zion	2055	2080	-	Oct	Sun>=2	2:00	0	S
-#Rule	Zion	2081	only	-	Oct	Mon>=3	2:00	0	S
-#Rule	Zion	2082	max	-	Oct	Sun>=2	2:00	0	S
+Rule	Zion	2013	max	-	Oct	lastSun	2:00	0	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Jerusalem	2:20:56 -	LMT	1880
+Zone	Asia/Jerusalem	2:20:54 -	LMT	1880
 			2:20:40	-	JMT	1918	# Jerusalem Mean Time?
 			2:00	Zion	I%sT
 
@@ -2547,8 +2529,8 @@ Rule	Syria	2006	only	-	Sep	22	0:00	0	-
 Rule	Syria	2007	only	-	Mar	lastFri	0:00	1:00	S
 # From Jesper Norgard (2007-10-27):
 # The sister center ICARDA of my work CIMMYT is confirming that Syria DST will
-# not take place 1.st November at 0:00 o'clock but 1.st November at 24:00 or
-# rather Midnight between Thursday and Friday. This does make more sence than
+# not take place 1st November at 0:00 o'clock but 1st November at 24:00 or
+# rather Midnight between Thursday and Friday. This does make more sense than
 # having it between Wednesday and Thursday (two workdays in Syria) since the
 # weekend in Syria is not Saturday and Sunday, but Friday and Saturday. So now
 # it is implemented at midnight of the last workday before weekend...

Modified: stable/7/share/zoneinfo/australasia
==============================================================================
--- stable/7/share/zoneinfo/australasia	Sun Jul  7 22:27:48 2013	(r253012)
+++ stable/7/share/zoneinfo/australasia	Sun Jul  7 22:27:58 2013	(r253013)
@@ -230,10 +230,16 @@ Zone Australia/Lord_Howe 10:36:20 -	LMT	
 # - Macquarie Island will stay on UTC+11 for winter and therefore not
 # switch back from daylight savings time when other parts of Australia do
 # on 4 April.
+#
+# From Arthur David Olson (2013-05-23):
+# The 1919 transition is overspecified below so pre-2013 zics
+# will produce a binary file with an EST-type as the first 32-bit type;
+# this is required for correct handling of times before 1916 by
+# pre-2013 versions of localtime.
 Zone Antarctica/Macquarie 0	-	zzz	1899 Nov
 			10:00	-	EST	1916 Oct 1 2:00
 			10:00	1:00	EST	1917 Feb
-			10:00	Aus	EST	1919 Apr
+			10:00	Aus	EST	1919 Apr 1 0:00s
 			0	-	zzz	1948 Mar 25
 			10:00	Aus	EST	1967
 			10:00	AT	EST	2010 Apr 4 3:00
@@ -1475,12 +1481,12 @@ Zone	Pacific/Wallis	12:15:20 -	LMT	1901
 # From Paul Eggert (2000-01-08):
 # IATA SSIM (1999-09) says DST ends 0100 local time.  Go with McDow.
 
-# From the BBC World Service (1998-10-31 11:32 UTC):
+# From the BBC World Service in
+# http://news.bbc.co.uk/2/hi/asia-pacific/205226.stm (1998-10-31 16:03 UTC):
 # The Fijiian government says the main reasons for the time change is to
-# improve productivity and reduce road accidents.  But correspondents say it
-# also hopes the move will boost Fiji's ability to compete with other pacific
-# islands in the effort to attract tourists to witness the dawning of the new
-# millenium.
+# improve productivity and reduce road accidents.... [T]he move is also
+# intended to boost Fiji's ability to attract tourists to witness the dawning
+# of the new millennium.
 
 # http://www.fiji.gov.fj/press/2000_09/2000_09_13-05.shtml (2000-09-13)
 # reports that Fiji has discontinued DST.
@@ -1625,7 +1631,7 @@ Zone	Pacific/Wallis	12:15:20 -	LMT	1901
 # Shanks & Pottenger say the transition was on 1968-10-01; go with Mundell.
 
 # From Eric Ulevik (1999-05-03):
-# Tonga's director of tourism, who is also secretary of the National Millenium
+# Tonga's director of tourism, who is also secretary of the National Millennium
 # Committee, has a plan to get Tonga back in front.
 # He has proposed a one-off move to tropical daylight saving for Tonga from
 # October to March, which has won approval in principle from the Tongan

Modified: stable/7/share/zoneinfo/europe
==============================================================================
--- stable/7/share/zoneinfo/europe	Sun Jul  7 22:27:48 2013	(r253012)
+++ stable/7/share/zoneinfo/europe	Sun Jul  7 22:27:58 2013	(r253013)
@@ -523,7 +523,7 @@ Rule	C-Eur	1944	only	-	Oct	 2	 2:00s	0	-
 # It seems that Paris, Monaco, Rule France, Rule Belgium all agree on
 # 2:00 standard time, e.g. 3:00 local time.  However there are no
 # countries that use C-Eur rules in September 1945, so the only items
-# affected are apparently these ficticious zones that translates acronyms
+# affected are apparently these fictitious zones that translate acronyms
 # CET and MET:
 #
 # Zone CET  1:00 C-Eur CE%sT
@@ -2779,9 +2779,9 @@ Link	Europe/Istanbul	Asia/Istanbul	# Ist
 
 # Ukraine
 #
-# From Igor Karpov, who works for the Ukranian Ministry of Justice,
+# From Igor Karpov, who works for the Ukrainian Ministry of Justice,
 # via Garrett Wollman (2003-01-27):
-# BTW, I've found the official document on this matter. It's goverment
+# BTW, I've found the official document on this matter. It's government
 # regulations number 509, May 13, 1996. In my poor translation it says:
 # "Time in Ukraine is set to second timezone (Kiev time). Each last Sunday
 # of March at 3am the time is changing to 4am and each last Sunday of
@@ -2815,7 +2815,7 @@ Link	Europe/Istanbul	Asia/Istanbul	# Ist
 # time this year after all.
 #
 # From Udo Schwedt (2011-10-18):
-# As far as I understand, the recent change to the Ukranian time zone
+# As far as I understand, the recent change to the Ukrainian time zone
 # (Europe/Kiev) to introduce permanent daylight saving time (similar
 # to Russia) was reverted today:
 #

Modified: stable/7/share/zoneinfo/southamerica
==============================================================================
--- stable/7/share/zoneinfo/southamerica	Sun Jul  7 22:27:48 2013	(r253012)
+++ stable/7/share/zoneinfo/southamerica	Sun Jul  7 22:27:58 2013	(r253013)
@@ -971,7 +971,7 @@ Rule	Brazil	2007	only	-	Feb	25	 0:00	0	-
 # adopted by the same states as before.
 Rule	Brazil	2007	only	-	Oct	Sun>=8	 0:00	1:00	S
 # From Frederico A. C. Neves (2008-09-10):
-# Acording to this decree
+# According to this decree
 # 
 # http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm
 # 
@@ -1203,7 +1203,7 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # http://www.emol.com/noticias/nacional/detalle/detallenoticias.asp?idnoticia=467651
 # 
 #
-# This is not yet reflected in the offical "cambio de hora" site, but
+# This is not yet reflected in the official "cambio de hora" site, but
 # probably will be soon:
 # 
 # http://www.horaoficial.cl/cambio.htm

Modified: stable/7/share/zoneinfo/zone.tab
==============================================================================
--- stable/7/share/zoneinfo/zone.tab	Sun Jul  7 22:27:48 2013	(r253012)
+++ stable/7/share/zoneinfo/zone.tab	Sun Jul  7 22:27:58 2013	(r253013)
@@ -1,18 +1,21 @@
-# 
+# TZ zone descriptions
+#
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 #
-# TZ zone descriptions
-#
-# From Paul Eggert (1996-08-05):
+# From Paul Eggert (2013-05-27):
 #
 # This file contains a table with the following columns:
 # 1.  ISO 3166 2-character country code.  See /usr/share/misc/iso3166.
+#     This identifies a country that overlaps the zone.  The country may
+#     overlap other zones and the zone may overlap other countries.
 # 2.  Latitude and longitude of the zone's principal location
 #     in ISO 6709 sign-degrees-minutes-seconds format,
 #     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
 #     first latitude (+ is north), then longitude (+ is east).
+#     This location need not lie within the column-1 country.
 # 3.  Zone name used in value of TZ environment variable.
+#     Please see the 'Theory' file for how zone names are chosen.
 # 4.  Comments; present if and only if the country has multiple rows.
 #
 # Columns are separated by a single tab.
@@ -22,6 +25,10 @@
 #
 # Lines beginning with `#' are comments.
 #
+# This table is intended as an aid for users, to help them select time
+# zone data appropriate for their practical needs.  It is not intended
+# to take or endorse any position on legal or territorial claims.
+#
 #country-
 #code	coordinates	TZ			comments
 AD	+4230+00131	Europe/Andorra
@@ -216,7 +223,7 @@ ID	-0002+10920	Asia/Pontianak	west & cen
 ID	-0507+11924	Asia/Makassar	east & south Borneo, Sulawesi (Celebes), Bali, Nusa Tengarra, west Timor
 ID	-0232+14042	Asia/Jayapura	west New Guinea (Irian Jaya) & Malukus (Moluccas)
 IE	+5320-00615	Europe/Dublin
-IL	+3146+03514	Asia/Jerusalem
+IL	+314650+0351326	Asia/Jerusalem
 IM	+5409-00428	Europe/Isle_of_Man
 IN	+2232+08822	Asia/Kolkata
 IO	-0720+07225	Indian/Chagos

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 00:50:58 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 5F7B2359;
 Mon,  8 Jul 2013 00:50:58 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 40F0D1DEA;
 Mon,  8 Jul 2013 00:50:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r680ow1S004500;
 Mon, 8 Jul 2013 00:50:58 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r680owcc004499;
 Mon, 8 Jul 2013 00:50:58 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201307080050.r680owcc004499@svn.freebsd.org>
From: Rick Macklem 
Date: Mon, 8 Jul 2013 00:50:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253015 - head/usr.sbin/gssd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 00:50:58 -0000

Author: rmacklem
Date: Mon Jul  8 00:50:57 2013
New Revision: 253015
URL: http://svnweb.freebsd.org/changeset/base/253015

Log:
  Add a new "-h" option to the gssd daemon that enables support for
  host based (kerberos service principal) initiator credentials in
  the default keytab file. This option won't actually be useful until
  the corresponding kernel changes are committed.
  
  Reviewed by:	jhb

Modified:
  head/usr.sbin/gssd/gssd.c

Modified: head/usr.sbin/gssd/gssd.c
==============================================================================
--- head/usr.sbin/gssd/gssd.c	Mon Jul  8 00:36:42 2013	(r253014)
+++ head/usr.sbin/gssd/gssd.c	Mon Jul  8 00:50:57 2013	(r253015)
@@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
 #ifndef _PATH_GSSDSOCK
 #define _PATH_GSSDSOCK	"/var/run/gssd.sock"
 #endif
+#define GSSD_CREDENTIAL_CACHE_FILE	"/tmp/krb5cc_gssd"
 
 struct gss_resource {
 	LIST_ENTRY(gss_resource) gr_link;
@@ -75,6 +76,7 @@ static char ccfile_dirlist[PATH_MAX + 1]
 static char pref_realm[1024];
 static int verbose;
 static int use_old_des;
+static int hostbased_initiator_cred;
 #ifndef WITHOUT_KERBEROS
 /* 1.2.752.43.13.14 */
 static gss_OID_desc gss_krb5_set_allowable_enctypes_x_desc =
@@ -92,8 +94,10 @@ static int find_ccache_file(const char *
 static int is_a_valid_tgt_cache(const char *, uid_t, int *, time_t *);
 static void gssd_verbose_out(const char *, ...);
 #ifndef WITHOUT_KERBEROS
+static krb5_error_code gssd_get_cc_from_keytab(const char *);
 static OM_uint32 gssd_get_user_cred(OM_uint32 *, uid_t, gss_cred_id_t *);
 #endif
+void gssd_terminate(int);
 
 extern void gssd_1(struct svc_req *rqstp, SVCXPRT *transp);
 extern int gssd_syscall(char *path);
@@ -119,11 +123,23 @@ main(int argc, char **argv)
 	pref_realm[0] = '\0';
 	debug = 0;
 	verbose = 0;
-	while ((ch = getopt(argc, argv, "dovs:c:r:")) != -1) {
+	while ((ch = getopt(argc, argv, "dhovs:c:r:")) != -1) {
 		switch (ch) {
 		case 'd':
 			debug_level++;
 			break;
+		case 'h':
+#ifndef WITHOUT_KERBEROS
+			/*
+			 * Enable use of a host based initiator credential
+			 * in the default keytab file.
+			 */
+			hostbased_initiator_cred = 1;
+#else
+			errx(1, "This option not available when built"
+			    " without MK_KERBEROS\n");
+#endif
+			break;
 		case 'o':
 #ifndef WITHOUT_KERBEROS
 			/*
@@ -182,6 +198,7 @@ main(int argc, char **argv)
 		signal(SIGQUIT, SIG_IGN);
 		signal(SIGHUP, SIG_IGN);
 	}
+	signal(SIGTERM, gssd_terminate);
 
 	memset(&sun, 0, sizeof sun);
 	sun.sun_family = AF_LOCAL;
@@ -377,7 +394,17 @@ gssd_init_sec_context_1_svc(init_sec_con
 #endif
 
 	memset(result, 0, sizeof(*result));
-	if (ccfile_dirlist[0] != '\0' && argp->cred == 0) {
+	if (hostbased_initiator_cred != 0 && argp->cred != 0 &&
+	    argp->uid == 0) {
+		/*
+		 * These credentials are for a host based initiator name
+		 * in a keytab file, which should now have credentials
+		 * in /tmp/krb5cc_gssd, because gss_acquire_cred() did
+		 * the equivalent of "kinit -k".
+		 */
+		snprintf(ccname, sizeof(ccname), "FILE:%s",
+		    GSSD_CREDENTIAL_CACHE_FILE);
+	} else if (ccfile_dirlist[0] != '\0' && argp->cred == 0) {
 		/*
 		 * For the "-s" case and no credentials provided as an
 		 * argument, search the directory list for an appropriate
@@ -773,6 +800,51 @@ gssd_acquire_cred_1_svc(acquire_cred_arg
 #endif
 
 	memset(result, 0, sizeof(*result));
+	if (argp->desired_name) {
+		desired_name = gssd_find_resource(argp->desired_name);
+		if (!desired_name) {
+			result->major_status = GSS_S_BAD_NAME;
+			gssd_verbose_out("gssd_acquire_cred: no desired name"
+			    " found\n");
+			return (TRUE);
+		}
+	}
+
+#ifndef WITHOUT_KERBEROS
+	if (hostbased_initiator_cred != 0 && argp->desired_name != 0 &&
+	    argp->uid == 0 && argp->cred_usage == GSS_C_INITIATE) {
+		/* This is a host based initiator name in the keytab file. */
+		snprintf(ccname, sizeof(ccname), "FILE:%s",
+		    GSSD_CREDENTIAL_CACHE_FILE);
+		setenv("KRB5CCNAME", ccname, TRUE);
+		result->major_status = gss_display_name(&result->minor_status,
+		    desired_name, &namebuf, NULL);
+		gssd_verbose_out("gssd_acquire_cred: desired name for host "
+		    "based initiator cred major=0x%x minor=%d\n",
+		    (unsigned int)result->major_status,
+		    (int)result->minor_status);
+		if (result->major_status != GSS_S_COMPLETE)
+			return (TRUE);
+		if (namebuf.length > PATH_MAX + 5) {
+			result->minor_status = 0;
+			result->major_status = GSS_S_FAILURE;
+			return (TRUE);
+		}
+		memcpy(ccname, namebuf.value, namebuf.length);
+		ccname[namebuf.length] = '\0';
+		if ((cp = strchr(ccname, '@')) != NULL)
+			*cp = '/';
+		kret = gssd_get_cc_from_keytab(ccname);
+		gssd_verbose_out("gssd_acquire_cred: using keytab entry for "
+		    "%s, kerberos ret=%d\n", ccname, (int)kret);
+		gss_release_buffer(&minstat, &namebuf);
+		if (kret != 0) {
+			result->minor_status = kret;
+			result->major_status = GSS_S_FAILURE;
+			return (TRUE);
+		}
+	} else
+#endif /* !WITHOUT_KERBEROS */
 	if (ccfile_dirlist[0] != '\0' && argp->desired_name == 0) {
 		/*
 		 * For the "-s" case and no name provided as an
@@ -798,6 +870,7 @@ gssd_acquire_cred_1_svc(acquire_cred_arg
 			    " file found\n");
 			return (TRUE);
 		}
+		setenv("KRB5CCNAME", ccname, TRUE);
 	} else {
 		/*
 		 * If there wasn't a "-s" option or the name has
@@ -815,17 +888,7 @@ gssd_acquire_cred_1_svc(acquire_cred_arg
 		}
 		snprintf(ccname, sizeof(ccname), "FILE:/tmp/krb5cc_%d",
 		    (int) argp->uid);
-	}
-	setenv("KRB5CCNAME", ccname, TRUE);
-
-	if (argp->desired_name) {
-		desired_name = gssd_find_resource(argp->desired_name);
-		if (!desired_name) {
-			result->major_status = GSS_S_BAD_NAME;
-			gssd_verbose_out("gssd_acquire_cred: no desired name"
-			    " found\n");
-			return (TRUE);
-		}
+		setenv("KRB5CCNAME", ccname, TRUE);
 	}
 
 	result->major_status = gss_acquire_cred(&result->minor_status,
@@ -964,6 +1027,8 @@ find_ccache_file(const char *dirpath, ui
 		len = snprintf(namepath, sizeof(namepath), "%s/%s", dirpath,
 		    dp->d_name);
 		if (len < sizeof(namepath) &&
+		    (hostbased_initiator_cred == 0 || strcmp(namepath,
+		     GSSD_CREDENTIAL_CACHE_FILE) != 0) &&
 		    strstr(dp->d_name, ccfile_substring) != NULL &&
 		    lstat(namepath, &sb) >= 0 &&
 		    sb.st_uid == uid &&
@@ -1112,6 +1177,57 @@ is_a_valid_tgt_cache(const char *filepat
 
 #ifndef WITHOUT_KERBEROS
 /*
+ * This function attempts to do essentially a "kinit -k" for the principal
+ * name provided as the argument, so that there will be a TGT in the
+ * credential cache.
+ */
+static krb5_error_code
+gssd_get_cc_from_keytab(const char *name)
+{
+	krb5_error_code ret, opt_ret, princ_ret, cc_ret, kt_ret, cred_ret;
+	krb5_context context;
+	krb5_principal principal;
+	krb5_keytab kt;
+	krb5_creds cred;
+	krb5_get_init_creds_opt *opt;
+	krb5_deltat start_time = 0;
+	krb5_ccache ccache;
+
+	ret = krb5_init_context(&context);
+	if (ret != 0)
+		return (ret);
+	princ_ret = ret = krb5_parse_name(context, name, &principal);
+	if (ret == 0)
+		opt_ret = ret = krb5_get_init_creds_opt_alloc(context, &opt);
+	if (ret == 0)
+		cc_ret = ret = krb5_cc_default(context, &ccache);
+	if (ret == 0)
+		ret = krb5_cc_initialize(context, ccache, principal);
+	if (ret == 0) {
+		krb5_get_init_creds_opt_set_default_flags(context, "gssd",
+		    krb5_principal_get_realm(context, principal), opt);
+		kt_ret = ret = krb5_kt_default(context, &kt);
+	}
+	if (ret == 0)
+		cred_ret = ret = krb5_get_init_creds_keytab(context, &cred,
+		    principal, kt, start_time, NULL, opt);
+	if (ret == 0)
+		ret = krb5_cc_store_cred(context, ccache, &cred);
+	if (kt_ret == 0)
+		krb5_kt_close(context, kt);
+	if (cc_ret == 0)
+		krb5_cc_close(context, ccache);
+	if (opt_ret == 0)
+		krb5_get_init_creds_opt_free(context, opt);
+	if (princ_ret == 0)
+		krb5_free_principal(context, principal);
+	if (cred_ret == 0)
+		krb5_free_cred_contents(context, &cred);
+	krb5_free_context(context);
+	return (ret);
+}
+
+/*
  * Acquire a gss credential for a uid.
  */
 static OM_uint32
@@ -1159,3 +1275,14 @@ gssd_get_user_cred(OM_uint32 *min_statp,
 	return (maj_stat);
 }
 #endif /* !WITHOUT_KERBEROS */
+
+void gssd_terminate(int sig __unused)
+{
+
+#ifndef WITHOUT_KERBEROS
+	if (hostbased_initiator_cred != 0)
+		unlink(GSSD_CREDENTIAL_CACHE_FILE);
+#endif
+	exit(0);
+}
+

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 00:57:12 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id D61F158D;
 Mon,  8 Jul 2013 00:57:12 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id C813A1E3E;
 Mon,  8 Jul 2013 00:57:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r680vCfD005279;
 Mon, 8 Jul 2013 00:57:12 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r680vCXi005278;
 Mon, 8 Jul 2013 00:57:12 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201307080057.r680vCXi005278@svn.freebsd.org>
From: Rick Macklem 
Date: Mon, 8 Jul 2013 00:57:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253016 - head/usr.sbin/gssd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 00:57:12 -0000

Author: rmacklem
Date: Mon Jul  8 00:57:12 2013
New Revision: 253016
URL: http://svnweb.freebsd.org/changeset/base/253016

Log:
  Document the new "-h" option for the gssd daemon.
  This is a content change.
  
  Reviewed by:	jhb

Modified:
  head/usr.sbin/gssd/gssd.8

Modified: head/usr.sbin/gssd/gssd.8
==============================================================================
--- head/usr.sbin/gssd/gssd.8	Mon Jul  8 00:50:57 2013	(r253015)
+++ head/usr.sbin/gssd/gssd.8	Mon Jul  8 00:57:12 2013	(r253016)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 23, 2013
+.Dd July 7, 2013
 .Dt GSSD 8
 .Os
 .Sh NAME
@@ -34,6 +34,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl d
+.Op Fl h
 .Op Fl o
 .Op Fl v
 .Op Fl s Ar dir-list
@@ -51,6 +52,15 @@ Run in debug mode.
 In this mode,
 .Nm
 will not fork when it starts.
+.It Fl h
+Enable support for host based initiator credentials.
+This permits a kerberized NFS mount to use a service principal in
+the default Kerberos5 keytab file for access.
+Such access is enabled via the
+gssname
+option for the
+.Xr mount_nfs 8
+command.
 .It Fl o
 Force use of DES and the associated old style GSS-API initialization token.
 This may be required to make kerberized NFS mounts work against some
@@ -96,6 +106,7 @@ by kernel GSS-API services.
 .Ex -std
 .Sh SEE ALSO
 .Xr gssapi 3 ,
+.Xr mount_nfs 8 ,
 .Xr syslog 3
 .Sh HISTORY
 The

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 01:08:58 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 1619B77C;
 Mon,  8 Jul 2013 01:08:58 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 06BB11E92;
 Mon,  8 Jul 2013 01:08:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6818vUP008811;
 Mon, 8 Jul 2013 01:08:57 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6818vBT008810;
 Mon, 8 Jul 2013 01:08:57 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201307080108.r6818vBT008810@svn.freebsd.org>
From: Rick Macklem 
Date: Mon, 8 Jul 2013 01:08:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253017 - head/usr.sbin/gssd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 01:08:58 -0000

Author: rmacklem
Date: Mon Jul  8 01:08:57 2013
New Revision: 253017
URL: http://svnweb.freebsd.org/changeset/base/253017

Log:
  Make sure the krb5 status variables are correctly initialized.

Modified:
  head/usr.sbin/gssd/gssd.c

Modified: head/usr.sbin/gssd/gssd.c
==============================================================================
--- head/usr.sbin/gssd/gssd.c	Mon Jul  8 00:57:12 2013	(r253016)
+++ head/usr.sbin/gssd/gssd.c	Mon Jul  8 01:08:57 2013	(r253017)
@@ -1196,6 +1196,7 @@ gssd_get_cc_from_keytab(const char *name
 	ret = krb5_init_context(&context);
 	if (ret != 0)
 		return (ret);
+	opt_ret = cc_ret = kt_ret = cred_ret = 0;
 	princ_ret = ret = krb5_parse_name(context, name, &principal);
 	if (ret == 0)
 		opt_ret = ret = krb5_get_init_creds_opt_alloc(context, &opt);

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 01:29:10 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 0EC74D07;
 Mon,  8 Jul 2013 01:29:10 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 015371F3D;
 Mon,  8 Jul 2013 01:29:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r681T9iK014756;
 Mon, 8 Jul 2013 01:29:09 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r681T9nE014755;
 Mon, 8 Jul 2013 01:29:09 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201307080129.r681T9nE014755@svn.freebsd.org>
From: Rick Macklem 
Date: Mon, 8 Jul 2013 01:29:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253018 - head/usr.sbin/gssd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 01:29:10 -0000

Author: rmacklem
Date: Mon Jul  8 01:29:09 2013
New Revision: 253018
URL: http://svnweb.freebsd.org/changeset/base/253018

Log:
  Oops, initialize the krb5 ret values correctly (to anything non-zero).

Modified:
  head/usr.sbin/gssd/gssd.c

Modified: head/usr.sbin/gssd/gssd.c
==============================================================================
--- head/usr.sbin/gssd/gssd.c	Mon Jul  8 01:08:57 2013	(r253017)
+++ head/usr.sbin/gssd/gssd.c	Mon Jul  8 01:29:09 2013	(r253018)
@@ -1196,7 +1196,7 @@ gssd_get_cc_from_keytab(const char *name
 	ret = krb5_init_context(&context);
 	if (ret != 0)
 		return (ret);
-	opt_ret = cc_ret = kt_ret = cred_ret = 0;
+	opt_ret = cc_ret = kt_ret = cred_ret = 1;	/* anything non-zero */
 	princ_ret = ret = krb5_parse_name(context, name, &principal);
 	if (ret == 0)
 		opt_ret = ret = krb5_get_init_creds_opt_alloc(context, &opt);

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 01:35:31 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 87893F12;
 Mon,  8 Jul 2013 01:35:31 +0000 (UTC)
 (envelope-from bjkfbsd@gmail.com)
Received: from mail-qa0-x22b.google.com (mail-qa0-x22b.google.com
 [IPv6:2607:f8b0:400d:c00::22b])
 by mx1.freebsd.org (Postfix) with ESMTP id 1953D1F73;
 Mon,  8 Jul 2013 01:35:31 +0000 (UTC)
Received: by mail-qa0-f43.google.com with SMTP id d13so5411942qak.2
 for ; Sun, 07 Jul 2013 18:35:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=hRkRFz11tC70WCrKKBzvYzfhNjuZ2qbUHramiLo+u9Q=;
 b=jT31Wnflb30E7cOL49J3c/Z6vn/YKiL4UOy0lNJDXTnJYmnrwkabniPzGlq4oDZToL
 c9Hg71R+l4w8TPEA7Z+7uV/5uiq+JxFw0TwRqnXbwJX15Vw5ZxZKZPFhj30dqmdYvW6E
 y21swsbvEoWC/C1pnTqiKOqXfprnvF3G0ytJS2WxhE7VUdu4GKCgXtLzfb53XOE5AURf
 +VsRDCe9Oo0oYZ43hH8hH0PzortbZxmGjmPkULm9lgkyH/1FUJmh89NfBtkzzBnipaxY
 7XkBHD3zxVv6ZE7d8LSoij9gMGgKMhBJGlMIsLsTGSmj7r0w+TooTSun9iXzz38jZEfj
 /Dng==
MIME-Version: 1.0
X-Received: by 10.224.64.73 with SMTP id d9mr6886254qai.73.1373247330590; Sun,
 07 Jul 2013 18:35:30 -0700 (PDT)
Received: by 10.49.95.202 with HTTP; Sun, 7 Jul 2013 18:35:30 -0700 (PDT)
In-Reply-To: <201307080057.r680vCXi005278@svn.freebsd.org>
References: <201307080057.r680vCXi005278@svn.freebsd.org>
Date: Sun, 7 Jul 2013 21:35:30 -0400
Message-ID: 
Subject: Re: svn commit: r253016 - head/usr.sbin/gssd
From: Benjamin Kaduk 
To: Rick Macklem 
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.14
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 01:35:31 -0000

On Sun, Jul 7, 2013 at 8:57 PM, Rick Macklem  wrote:

> Author: rmacklem
> Date: Mon Jul  8 00:57:12 2013
> New Revision: 253016
> URL: http://svnweb.freebsd.org/changeset/base/253016
>
> Log:
>   Document the new "-h" option for the gssd daemon.
>   This is a content change.
>
>   Reviewed by:  jhb
>
> Modified:
>   head/usr.sbin/gssd/gssd.8
>
> Modified: head/usr.sbin/gssd/gssd.8
>
> ==============================================================================
> --- head/usr.sbin/gssd/gssd.8   Mon Jul  8 00:50:57 2013        (r253015)
> +++ head/usr.sbin/gssd/gssd.8   Mon Jul  8 00:57:12 2013        (r253016)
> @@ -51,6 +52,15 @@ Run in debug mode.
>  In this mode,
>  .Nm
>  will not fork when it starts.
> +.It Fl h
> +Enable support for host based initiator credentials.


"host-based" with a hyphen is preferred in krb5 circles.


> +This permits a kerberized NFS mount to use a service principal in
> +the default Kerberos5 keytab file for access.
>

"Kerberos 5" with a space, please.


> +Such access is enabled via the
> +gssname
>

.Ar gssname

-Ben

+option for the
> +.Xr mount_nfs 8
> +command.
>  .It Fl o
>  Force use of DES and the associated old style GSS-API initialization
> token.
>  This may be required to make kerberized NFS mounts work against some
> @@ -96,6 +106,7 @@ by kernel GSS-API services.
>  .Ex -std
>  .Sh SEE ALSO
>  .Xr gssapi 3 ,
> +.Xr mount_nfs 8 ,
>  .Xr syslog 3
>  .Sh HISTORY
>  The
> _______________________________________________
> svn-src-all@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
>

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 01:45:11 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
 id C9E20215; Mon,  8 Jul 2013 01:45:11 +0000 (UTC)
Date: Mon, 8 Jul 2013 01:45:11 +0000
From: Alexey Dokuchaev 
To: Juli Mallett 
Subject: Re: svn commit: r252913 - head/sys/arm/ti/am335x
Message-ID: <20130708014511.GB24353@FreeBSD.org>
References: <201307070422.r674M9HM038537@svn.freebsd.org>
 
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, Oleksandr Tymoshenko ,
 svn-src-all@freebsd.org, src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 01:45:11 -0000

On Sat, Jul 06, 2013 at 09:33:08PM -0700, Juli Mallett wrote:
> Thanks for this and the other commits, Oleksandr!  Much appreciated.
> Looking forward to giving it a spin on my BeagleBones Black!
> 
> [commit diff skipped]

Looking forward to never see overquoting again on FreeBSD lists!

./danfe

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 01:46:12 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id A884E360;
 Mon,  8 Jul 2013 01:46:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 99CF41FBD;
 Mon,  8 Jul 2013 01:46:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r681kCV0020190;
 Mon, 8 Jul 2013 01:46:12 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r681kC5l020188;
 Mon, 8 Jul 2013 01:46:12 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201307080146.r681kC5l020188@svn.freebsd.org>
From: Glen Barber 
Date: Mon, 8 Jul 2013 01:46:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253019 - stable/9/release
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 01:46:12 -0000

Author: gjb
Date: Mon Jul  8 01:46:11 2013
New Revision: 253019
URL: http://svnweb.freebsd.org/changeset/base/253019

Log:
  MFC r252846:
  
   - Add SRC_FORCE_CHECKOUT configuration option to force svn to checkout
     the src/ tree into a directory that contains files/directories, such
     as a case where a custom kernel configuration file is specified.
  
   - Allow specification of multiple KERNCONFs to pass to 'make release'.
  
   - Move evaluation of NODOCS/NOPORTS earlier, and set based on how the
     release process expects these options to be evaluated.
  
   - Wrap KERNCONF specification in double quotes, and use 'eval' so multiple
     kernel configurations do not cause the build to fail in strange ways.
  
   - Set WITHOUT_X11 for the port build flags for the documentation toolchain
     build.  Also run 'clean distclean' targets during port build.
  
  PR:		180192
  MFC after:	3 days
  Approved by:	kib (mentor, implicit)

Modified:
  stable/9/release/release.conf.sample
  stable/9/release/release.sh
Directory Properties:
  stable/9/release/   (props changed)

Modified: stable/9/release/release.conf.sample
==============================================================================
--- stable/9/release/release.conf.sample	Mon Jul  8 01:29:09 2013	(r253018)
+++ stable/9/release/release.conf.sample	Mon Jul  8 01:46:11 2013	(r253019)
@@ -14,6 +14,9 @@ SRCBRANCH="base/stable/9"
 DOCBRANCH="doc/head"
 PORTBRANCH="ports/head"
 
+## Run svn co --force for src checkout.
+#SRC_FORCE_CHECKOUT=yes
+
 ## Set the src/, ports/, and doc/ revisions.
 SRCREVISION="-rHEAD"
 DOCREVISION="-rHEAD"
@@ -23,6 +26,8 @@ PORTREVISION="-rHEAD"
 #TARGET="amd64"
 #TARGET_ARCH="amd64"
 #KERNEL="GENERIC"
+## Multiple kernels may be set.
+#KERNEL="GENERIC XENHVM"
 
 ## Set to specify a custom make.conf and/or src.conf
 #MAKE_CONF="/etc/local/make.conf"

Modified: stable/9/release/release.sh
==============================================================================
--- stable/9/release/release.sh	Mon Jul  8 01:29:09 2013	(r253018)
+++ stable/9/release/release.sh	Mon Jul  8 01:46:11 2013	(r253019)
@@ -45,6 +45,10 @@ SRCBRANCH="base/head"
 DOCBRANCH="doc/head"
 PORTBRANCH="ports/head"
 
+# Sometimes one needs to checkout src with --force svn option.
+# If custom kernel configs copied to src tree before checkout, e.g.
+SRC_FORCE_CHECKOUT=
+
 # The default src/, doc/, and ports/ revisions.
 SRCREVISION="-rHEAD"
 DOCREVISION="-rHEAD"
@@ -109,6 +113,25 @@ while getopts c: opt; do
 done
 shift $(($OPTIND - 1))
 
+# If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree
+# is required to build the documentation set.
+if [ "x${NOPORTS}" != "x" ] && [ "x${NODOC}" = "x" ]; then
+	echo "*** NOTICE: Setting NODOC=1 since ports tree is required"
+	echo "            and NOPORTS is set."
+	NODOC=yes
+fi
+
+# If NOPORTS and/or NODOC are unset, they must not pass to make as variables.
+# The release makefile verifies definedness of NOPORTS/NODOC variables
+# instead of their values.
+DOCPORTS=
+if [ "x${NOPORTS}" != "x" ]; then
+ DOCPORTS="NOPORTS=yes "
+fi
+if [ "x${NODOC}" != "x" ]; then
+ DOCPORTS="${DOCPORTS}NODOC=yes"
+fi
+
 # The aggregated build-time flags based upon variables defined within
 # this file, unless overridden by release.conf.  In most cases, these
 # will not need to be changed.
@@ -118,16 +141,14 @@ CHROOT_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD
 CHROOT_IMAKEFLAGS="${CONF_FILES}"
 CHROOT_DMAKEFLAGS="${CONF_FILES}"
 RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}"
-RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=${KERNEL} ${ARCH_FLAGS} ${CONF_FILES}"
-RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=${KERNEL} ${CONF_FILES} \
-	NODOC=${NODOC} NOPORTS=${NOPORTS}"
-
-# If PORTS is set and NODOC is unset, force NODOC=yes because the ports tree
-# is required to build the documentation set.
-if [ "x${NOPORTS}" != "x" ] && [ "x${NODOC}" = "x" ]; then
-	echo "*** NOTICE: Setting NODOC=1 since ports tree is required"
-	echo "            and NOPORTS is set."
-	NODOC=1
+RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}"
+RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \
+	${DOCPORTS}"
+
+# Force src checkout if configured
+FORCE_SRC_KEY=
+if [ "x${SRC_FORCE_CHECKOUT}" != "x" ]; then
+ FORCE_SRC_KEY="--force"
 fi
 
 if [ ! ${CHROOTDIR} ]; then
@@ -144,7 +165,7 @@ set -e # Everything must succeed
 
 mkdir -p ${CHROOTDIR}/usr
 
-svn co ${SVNROOT}/${SRCBRANCH} ${CHROOTDIR}/usr/src $SRCREVISION
+svn co ${FORCE_SRC_KEY} ${SVNROOT}/${SRCBRANCH} ${CHROOTDIR}/usr/src $SRCREVISION
 if [ "x${NODOC}" = "x" ]; then
 	svn co ${SVNROOT}/${DOCBRANCH} ${CHROOTDIR}/usr/doc $DOCREVISION
 fi
@@ -164,10 +185,10 @@ trap "umount ${CHROOTDIR}/dev" EXIT # Cl
 build_doc_ports() {
 	## Trick the ports 'run-autotools-fixup' target to do the right thing.
 	_OSVERSION=$(sysctl -n kern.osreldate)
-	if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" != "x" ]; then
-		PBUILD_FLAGS="OSVERSION=${_OSVERSION} WITHOUT_JADETEX=yes BATCH=yes"
+	if [ -d ${CHROOTDIR}/usr/doc ] && [ "x${NODOC}" = "x" ]; then
+		PBUILD_FLAGS="OSVERSION=${_OSVERSION} WITHOUT_JADETEX=yes WITHOUT_X11=yes BATCH=yes"
 		chroot ${CHROOTDIR} make -C /usr/ports/textproc/docproj \
-			${PBUILD_FLAGS} install
+			${PBUILD_FLAGS} install clean distclean
 	fi
 }
 
@@ -191,11 +212,11 @@ if [ "x${RELSTRING}" = "x" ]; then
 	RELSTRING="$(chroot ${CHROOTDIR} uname -s)-${OSRELEASE}-${TARGET_ARCH}"
 fi
 
-chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld
-chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel
-chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \
+eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_WMAKEFLAGS} buildworld
+eval chroot ${CHROOTDIR} make -C /usr/src ${RELEASE_KMAKEFLAGS} buildkernel
+eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \
 	release RELSTRING=${RELSTRING}
-chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \
+eval chroot ${CHROOTDIR} make -C /usr/src/release ${RELEASE_RMAKEFLAGS} \
 	install DESTDIR=/R RELSTRING=${RELSTRING}
 
 cd ${CHROOTDIR}/R

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 01:47:50 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id C3CF56D0;
 Mon,  8 Jul 2013 01:47:50 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id B6ADB1FE5;
 Mon,  8 Jul 2013 01:47:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r681lov8020499;
 Mon, 8 Jul 2013 01:47:50 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r681loOq020498;
 Mon, 8 Jul 2013 01:47:50 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201307080147.r681loOq020498@svn.freebsd.org>
From: Rick Macklem 
Date: Mon, 8 Jul 2013 01:47:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253020 - head/usr.sbin/gssd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 01:47:50 -0000

Author: rmacklem
Date: Mon Jul  8 01:47:50 2013
New Revision: 253020
URL: http://svnweb.freebsd.org/changeset/base/253020

Log:
  Fix some Kerberos related terminology.
  This is a content change.
  
  Requested by:	bjk

Modified:
  head/usr.sbin/gssd/gssd.8

Modified: head/usr.sbin/gssd/gssd.8
==============================================================================
--- head/usr.sbin/gssd/gssd.8	Mon Jul  8 01:46:11 2013	(r253019)
+++ head/usr.sbin/gssd/gssd.8	Mon Jul  8 01:47:50 2013	(r253020)
@@ -53,9 +53,9 @@ In this mode,
 .Nm
 will not fork when it starts.
 .It Fl h
-Enable support for host based initiator credentials.
+Enable support for host-based initiator credentials.
 This permits a kerberized NFS mount to use a service principal in
-the default Kerberos5 keytab file for access.
+the default Kerberos 5 keytab file for access.
 Such access is enabled via the
 gssname
 option for the

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 01:53:29 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
 id 4D0E1D34; Mon,  8 Jul 2013 01:53:29 +0000 (UTC)
Date: Mon, 8 Jul 2013 01:53:29 +0000
From: Alexey Dokuchaev 
To: Michael Tuexen 
Subject: Re: svn commit: r252928 - stable/9/sys/netinet
Message-ID: <20130708015329.GD24353@FreeBSD.org>
References: <201307071136.r67BalXW064645@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201307071136.r67BalXW064645@svn.freebsd.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, svn-src-stable-9@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 01:53:29 -0000

On Sun, Jul 07, 2013 at 11:36:47AM +0000, Michael Tuexen wrote:
> Author: tuexen
> Date: Sun Jul  7 11:36:46 2013
> New Revision: 252928
> URL: http://svnweb.freebsd.org/changeset/base/252928
> 
> Log:
>   MFC r240158:
>   Get rid of a gcc'ism.

Neat trick!  I should use it more. ;-)  Hope Clang will uphold it one day.

./danfe

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 02:03:19 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 0C5A9428;
 Mon,  8 Jul 2013 02:03:19 +0000 (UTC)
 (envelope-from markj@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id F321F109B;
 Mon,  8 Jul 2013 02:03:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6823IKM026454;
 Mon, 8 Jul 2013 02:03:18 GMT (envelope-from markj@svn.freebsd.org)
Received: (from markj@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6823IFT026453;
 Mon, 8 Jul 2013 02:03:18 GMT (envelope-from markj@svn.freebsd.org)
Message-Id: <201307080203.r6823IFT026453@svn.freebsd.org>
From: Mark Johnston 
Date: Mon, 8 Jul 2013 02:03:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253022 - head/sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 02:03:19 -0000

Author: markj
Date: Mon Jul  8 02:03:18 2013
New Revision: 253022
URL: http://svnweb.freebsd.org/changeset/base/253022

Log:
  Also define SDT_PROBE_DEFINE0 for the !KDTRACE_HOOKS case.

Modified:
  head/sys/sys/sdt.h

Modified: head/sys/sys/sdt.h
==============================================================================
--- head/sys/sys/sdt.h	Mon Jul  8 01:51:17 2013	(r253021)
+++ head/sys/sys/sdt.h	Mon Jul  8 02:03:18 2013	(r253022)
@@ -86,6 +86,7 @@
 #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
 #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type)
 
+#define	SDT_PROBE_DEFINE0(prov, mod, func, name, sname)
 #define	SDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0)
 #define	SDT_PROBE_DEFINE2(prov, mod, func, name, sname, arg0, arg1)
 #define	SDT_PROBE_DEFINE3(prov, mod, func, name, sname, arg0, arg1, arg2)

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 02:08:27 2013
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
 id F3432773; Mon,  8 Jul 2013 02:08:26 +0000 (UTC)
Date: Mon, 8 Jul 2013 02:08:26 +0000
From: Alexey Dokuchaev 
To: Andriy Gapon 
Subject: Re: svn commit: r253002 - head
Message-ID: <20130708020826.GA31063@FreeBSD.org>
References: <201307072039.r67KdCdR028908@svn.freebsd.org>
 <9D4C7540-A3B0-45E5-8219-6A455D41DF70@gmail.com>
 <51D9DA55.2090808@freebsd.org> <51D9E069.5060300@FreeBSD.org>
 <51D9E2C0.6060603@freebsd.org> <51D9E57F.3090803@FreeBSD.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <51D9E57F.3090803@FreeBSD.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 Alfred Perlstein ,
 "src-committers@freebsd.org" ,
 Garrett Cooper 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 02:08:27 -0000

On Mon, Jul 08, 2013 at 01:02:39AM +0300, Andriy Gapon wrote:
> I am sure that the next time you need to run the same thing you'll remember
> where you put the comment and you'll copy/paste from it.
> I am sure that if any other developer runs into the same situation, then he
> will:
> - google
> - ask on irc
> - ask on mailing lists
> - perhaps even read build(7)
> 
> I am sure that looking through the Makefile would be one of the last things
> on his mind.

It's quite on the contrary.  First people reach for comments/documentation;
only as a last resort they will use Google or ask on MLs.  Bad documentation
is probably one of the key of Google's success. :-)

./danfe

P.S.  You gotta be kidding us, right?

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 02:25:42 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 370C3C4A;
 Mon,  8 Jul 2013 02:25:42 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-pb0-x22c.google.com (mail-pb0-x22c.google.com
 [IPv6:2607:f8b0:400e:c01::22c])
 by mx1.freebsd.org (Postfix) with ESMTP id 0306C113D;
 Mon,  8 Jul 2013 02:25:41 +0000 (UTC)
Received: by mail-pb0-f44.google.com with SMTP id uo1so3771427pbc.3
 for ; Sun, 07 Jul 2013 19:25:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=references:mime-version:in-reply-to:content-type
 :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date
 :to; bh=wpe7sdh37y6H4iUp/M/B/NHJpQDl/3HMVFXv0ypAx3c=;
 b=HSnqzRY+mU33snJhe4nuk10aZ9mbIyfpDyw1LxFbu8mrUG4MpYU/z6q+TAdBY/EtzY
 I5unqSYIobmcachfCs5IOqcbGUw/E8ELr6YRCDceW11Dp9hMj7YrMZgvSty+ar97X4u3
 m+zgkYNQW1hx33h/D5CrhsuIxqotGGjRx9wLF+v+6phdjUpioxkBPIEQ73sODqpYdbwp
 0I3I89Hi2Nq27dq7RvCfMeZZoLCgpLnS3hPgSRohYDZlbcHSITIV22xjZhHi/wWcFd88
 9/2RfL97EUM/5fnJ/tvS+K2uVBdAf2yAiEJURfQfjAMf764vo2gdlXAv7gpQI7pucf/0
 p7Dg==
X-Received: by 10.66.164.232 with SMTP id yt8mr20952389pab.21.1373250341084;
 Sun, 07 Jul 2013 19:25:41 -0700 (PDT)
Received: from [10.198.134.121] (mobile-166-147-081-246.mycingular.net.
 [166.147.81.246])
 by mx.google.com with ESMTPSA id py6sm19535752pbb.33.2013.07.07.19.25.39
 for 
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Sun, 07 Jul 2013 19:25:40 -0700 (PDT)
References: <201307072039.r67KdCdR028908@svn.freebsd.org>
 <9D4C7540-A3B0-45E5-8219-6A455D41DF70@gmail.com>
 <51D9DA55.2090808@freebsd.org>
Mime-Version: 1.0 (1.0)
In-Reply-To: <51D9DA55.2090808@freebsd.org>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Message-Id: 
X-Mailer: iPhone Mail (10B329)
From: Garrett Cooper 
Subject: Re: svn commit: r253002 - head
Date: Sun, 7 Jul 2013 19:25:34 -0700
To: Alfred Perlstein 
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 02:25:42 -0000

On Jul 7, 2013, at 2:15 PM, Alfred Perlstein  wrote:

> On 7/7/13 2:01 PM, Garrett Cooper wrote:
>> Why the magic number 12?
>=20
> Numbers higher seem to result in worse performance as reported by some mem=
bers of my team.

The suggestion is good in spirit, but this doesn't justify the reasoning for=
 this recommendation for all cases.

Please revert this change and add a doc page or notes to the dev handbook di=
scussing what the empirical process and results were for determining this va=
lue so people can come up with their own values that work best with their ha=
rdware and software config. This recommendation is prone to bitrot like some=
 of the recommendations in tuning(7).

Misinformation is sometimes more harmful than no information.

Thanks,
-Garrett=

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 04:27:04 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 5C1E29A9;
 Mon,  8 Jul 2013 04:27:04 +0000 (UTC)
 (envelope-from gonzo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 4EE6E1702;
 Mon,  8 Jul 2013 04:27:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r684R3ER069047;
 Mon, 8 Jul 2013 04:27:03 GMT (envelope-from gonzo@svn.freebsd.org)
Received: (from gonzo@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r684R31T069046;
 Mon, 8 Jul 2013 04:27:03 GMT (envelope-from gonzo@svn.freebsd.org)
Message-Id: <201307080427.r684R31T069046@svn.freebsd.org>
From: Oleksandr Tymoshenko 
Date: Mon, 8 Jul 2013 04:27:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253023 - head/sys/arm/ti
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 04:27:04 -0000

Author: gonzo
Date: Mon Jul  8 04:27:03 2013
New Revision: 253023
URL: http://svnweb.freebsd.org/changeset/base/253023

Log:
  - AM335x requires updated soft-reset logic too

Modified:
  head/sys/arm/ti/ti_mmchs.c

Modified: head/sys/arm/ti/ti_mmchs.c
==============================================================================
--- head/sys/arm/ti/ti_mmchs.c	Mon Jul  8 02:03:18 2013	(r253022)
+++ head/sys/arm/ti/ti_mmchs.c	Mon Jul  8 04:27:03 2013	(r253023)
@@ -213,10 +213,13 @@ ti_mmchs_reset_controller(struct ti_mmch
 	sysctl = ti_mmchs_read_4(sc, MMCHS_SYSCTL);
 	ti_mmchs_write_4(sc, MMCHS_SYSCTL, sysctl | bit);
 
-	if ((ti_chip() == CHIP_OMAP_4) && (ti_revision() > OMAP4430_REV_ES1_0)) {
-		/* OMAP4 ES2 and greater has an updated reset logic.
-		 * Monitor a 0->1 transition first
-		 */
+
+	/* 
+	 * AM335x and OMAP4 ES2 and greater has an updated reset logic.
+	 * Monitor a 0->1 transition first
+	 */
+	if ((ti_chip() == CHIP_AM335X) || 
+	    ((ti_chip() == CHIP_OMAP_4) && (ti_revision() > OMAP4430_REV_ES1_0))) {
 		attempts = 10000;
 		while (!(ti_mmchs_read_4(sc, MMCHS_SYSCTL) & bit) && (attempts-- > 0))
 			continue;

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 04:30:13 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 7345CB1E;
 Mon,  8 Jul 2013 04:30:13 +0000 (UTC)
 (envelope-from gonzo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 66166171F;
 Mon,  8 Jul 2013 04:30:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r684UDIE069649;
 Mon, 8 Jul 2013 04:30:13 GMT (envelope-from gonzo@svn.freebsd.org)
Received: (from gonzo@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r684UDap069648;
 Mon, 8 Jul 2013 04:30:13 GMT (envelope-from gonzo@svn.freebsd.org)
Message-Id: <201307080430.r684UDap069648@svn.freebsd.org>
From: Oleksandr Tymoshenko 
Date: Mon, 8 Jul 2013 04:30:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253024 - head/sys/boot/fdt/dts
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 04:30:13 -0000

Author: gonzo
Date: Mon Jul  8 04:30:12 2013
New Revision: 253024
URL: http://svnweb.freebsd.org/changeset/base/253024

Log:
  - MMC1 (internal eMMC) pins should be configured as input-pullup, except
      for reset pin

Modified:
  head/sys/boot/fdt/dts/beaglebone-black.dts

Modified: head/sys/boot/fdt/dts/beaglebone-black.dts
==============================================================================
--- head/sys/boot/fdt/dts/beaglebone-black.dts	Mon Jul  8 04:27:03 2013	(r253023)
+++ head/sys/boot/fdt/dts/beaglebone-black.dts	Mon Jul  8 04:30:12 2013	(r253024)
@@ -76,17 +76,17 @@
 				"MMC0_DAT2", "mmc0_dat2", "input_pullup",
 				"MMC0_DAT3", "mmc0_dat3", "input_pullup",
 				/* MMC1 */
-				"GPMC_CSn1", "mmc1_clk", "input_pulldown",
-				"GPMC_CSn2", "mmc1_cmd", "input_pulldown",
-				"GPMC_CSn3", "gpio2_0", "output", /* Reset */
-				"GPMC_AD0", "mmc1_dat0", "input_pulldown",
-				"GPMC_AD1", "mmc1_dat1", "input_pulldown",
-				"GPMC_AD2", "mmc1_dat2", "input_pulldown",
-				"GPMC_AD3", "mmc1_dat3", "input_pulldown",
-				"GPMC_AD4", "mmc1_dat4", "input_pulldown",
-				"GPMC_AD5", "mmc1_dat5", "input_pulldown",
-				"GPMC_AD6", "mmc1_dat6", "input_pulldown",
-				"GPMC_AD7", "mmc1_dat7", "input_pulldown",
+				"GPMC_CSn1", "mmc1_clk", "input_pullup",
+				"GPMC_CSn2", "mmc1_cmd", "input_pullup",
+				"GPMC_CSn3", "gpio2_0", "output_pullup", /* Reset */
+				"GPMC_AD0", "mmc1_dat0", "input_pullup",
+				"GPMC_AD1", "mmc1_dat1", "input_pullup",
+				"GPMC_AD2", "mmc1_dat2", "input_pullup",
+				"GPMC_AD3", "mmc1_dat3", "input_pullup",
+				"GPMC_AD4", "mmc1_dat4", "input_pullup",
+				"GPMC_AD5", "mmc1_dat5", "input_pullup",
+				"GPMC_AD6", "mmc1_dat6", "input_pullup",
+				"GPMC_AD7", "mmc1_dat7", "input_pullup",
 				/* GPIO */
 				"ECAP0_IN_PWM0_OUT", "gpio0_7", "input_pulldown",
 				"GPMC_AD10", "gpio0_26", "input_pulldown",

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 05:06:33 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 75F3EF94;
 Mon,  8 Jul 2013 05:06:33 +0000 (UTC)
 (envelope-from gonzo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 68E8D180F;
 Mon,  8 Jul 2013 05:06:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6856XB8080531;
 Mon, 8 Jul 2013 05:06:33 GMT (envelope-from gonzo@svn.freebsd.org)
Received: (from gonzo@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6856X34080530;
 Mon, 8 Jul 2013 05:06:33 GMT (envelope-from gonzo@svn.freebsd.org)
Message-Id: <201307080506.r6856X34080530@svn.freebsd.org>
From: Oleksandr Tymoshenko 
Date: Mon, 8 Jul 2013 05:06:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253025 - head/sys/arm/ti/am335x
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 05:06:33 -0000

Author: gonzo
Date: Mon Jul  8 05:06:32 2013
New Revision: 253025
URL: http://svnweb.freebsd.org/changeset/base/253025

Log:
  Add IDs for TPS65217C and TPS65217D

Modified:
  head/sys/arm/ti/am335x/am335x_pmic.c

Modified: head/sys/arm/ti/am335x/am335x_pmic.c
==============================================================================
--- head/sys/arm/ti/am335x/am335x_pmic.c	Mon Jul  8 04:30:12 2013	(r253024)
+++ head/sys/arm/ti/am335x/am335x_pmic.c	Mon Jul  8 05:06:32 2013	(r253025)
@@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$");
 
 #define TPS65217A		0x7
 #define TPS65217B		0xF
+#define TPS65217C		0xE
+#define TPS65217D		0x6
 
 /* TPS65217 Reisters */
 #define TPS65217_CHIPID_REG	0x00
@@ -131,6 +133,12 @@ am335x_pmic_start(void *xdev)
 		case TPS65217B:
 			sprintf(name, "TPS65217B ver 1.%u", reg & 0xF);
 			break;
+		case TPS65217C:
+			sprintf(name, "TPS65217C ver 1.%u", reg & 0xF);
+			break;
+		case TPS65217D:
+			sprintf(name, "TPS65217D ver 1.%u", reg & 0xF);
+			break;
 		default:
 			sprintf(name, "Unknown PMIC");
 	}

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 05:58:09 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id CE16B86F;
 Mon,  8 Jul 2013 05:58:09 +0000 (UTC)
 (envelope-from joel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id BFD27199D;
 Mon,  8 Jul 2013 05:58:09 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r685w9oV094881;
 Mon, 8 Jul 2013 05:58:09 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r685w9uA094880;
 Mon, 8 Jul 2013 05:58:09 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201307080558.r685w9uA094880@svn.freebsd.org>
From: Joel Dahl 
Date: Mon, 8 Jul 2013 05:58:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253026 - head/share/man/man9
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 05:58:09 -0000

Author: joel (doc committer)
Date: Mon Jul  8 05:58:09 2013
New Revision: 253026
URL: http://svnweb.freebsd.org/changeset/base/253026

Log:
  mdoc: remove superfluous paragraph macros.

Modified:
  head/share/man/man9/SDT.9

Modified: head/share/man/man9/SDT.9
==============================================================================
--- head/share/man/man9/SDT.9	Mon Jul  8 05:06:32 2013	(r253025)
+++ head/share/man/man9/SDT.9	Mon Jul  8 05:58:09 2013	(r253026)
@@ -54,7 +54,6 @@
 .Fn SDT_PROBE6 prov mod func name arg0 arg1 arg2 arg3 arg4 arg5
 .Fn SDT_PROBE7 prov mod func name arg0 arg1 arg2 arg3 arg4 arg5 arg6
 .Sh DESCRIPTION
-.Pp
 The
 .Nm
 macros allow programmers to define static trace points in kernel code.
@@ -158,7 +157,6 @@ trace points.
 They are meant to be added to executable code and can be used to instrument the
 code in which they are called.
 .Sh EXAMPLES
-.Pp
 The following probe definition will create a DTrace probe called
 .Ql icmp::unreach:pkt-receive ,
 which would hypothetically be triggered when the kernel receives an ICMP packet
@@ -216,7 +214,6 @@ framework were originally ported to Free
 This manual page was written by
 .An Mark Johnston Aq markj@FreeBSD.org .
 .Sh BUGS
-.Pp
 The
 .Nm
 macros allow the module name of a probe to be specified as part of a probe

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 06:10:29 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id B407ADD8;
 Mon,  8 Jul 2013 06:10:29 +0000 (UTC)
 (envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id A67921A17;
 Mon,  8 Jul 2013 06:10:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r686ATu3098677;
 Mon, 8 Jul 2013 06:10:29 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r686ATWI098676;
 Mon, 8 Jul 2013 06:10:29 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201307080610.r686ATWI098676@svn.freebsd.org>
From: Adrian Chadd 
Date: Mon, 8 Jul 2013 06:10:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253027 - head/sys/mips/atheros
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 06:10:29 -0000

Author: adrian
Date: Mon Jul  8 06:10:29 2013
New Revision: 253027
URL: http://svnweb.freebsd.org/changeset/base/253027

Log:
  Add AR9341, AR9342, AR9344 SoC types.

Modified:
  head/sys/mips/atheros/ar71xx_setup.h

Modified: head/sys/mips/atheros/ar71xx_setup.h
==============================================================================
--- head/sys/mips/atheros/ar71xx_setup.h	Mon Jul  8 05:58:09 2013	(r253026)
+++ head/sys/mips/atheros/ar71xx_setup.h	Mon Jul  8 06:10:29 2013	(r253027)
@@ -41,6 +41,9 @@ enum ar71xx_soc_type {
 	AR71XX_SOC_AR9132,
 	AR71XX_SOC_AR9330,
 	AR71XX_SOC_AR9331,
+	AR71XX_SOC_AR9341,
+	AR71XX_SOC_AR9342,
+	AR71XX_SOC_AR9344,
 };
 extern enum ar71xx_soc_type ar71xx_soc;   
 

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 06:12:39 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 6BB0BF19;
 Mon,  8 Jul 2013 06:12:39 +0000 (UTC)
 (envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 5D6AA1A24;
 Mon,  8 Jul 2013 06:12:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r686Cdew000601;
 Mon, 8 Jul 2013 06:12:39 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r686Cdt4000600;
 Mon, 8 Jul 2013 06:12:39 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201307080612.r686Cdt4000600@svn.freebsd.org>
From: Adrian Chadd 
Date: Mon, 8 Jul 2013 06:12:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253028 - head/sys/mips/atheros
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 06:12:39 -0000

Author: adrian
Date: Mon Jul  8 06:12:38 2013
New Revision: 253028
URL: http://svnweb.freebsd.org/changeset/base/253028

Log:
  Import the initial SoC register definitions for the AR934x MIPS74k SoC.
  
  Obtained from:	Linux/OpenWRT

Added:
  head/sys/mips/atheros/ar934xreg.h   (contents, props changed)

Added: head/sys/mips/atheros/ar934xreg.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/atheros/ar934xreg.h	Mon Jul  8 06:12:38 2013	(r253028)
@@ -0,0 +1,156 @@
+/*-
+ * Copyright (c) 2013 Adrian Chadd 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef	__AR934X_REG_H__
+#define	__AR934X_REG_H__
+
+#define	AR934X_WMAC_BASE	(AR71XX_APB_BASE + 0x00100000)
+#define	AR934X_WMAC_SIZE	0x20000
+#define	AR934X_EHCI_BASE	0x1b000000
+#define	AR934X_EHCI_SIZE	0x200
+#define	AR934X_SRIF_BASE	(AR71XX_APB_BASE + 0x00116000)
+#define	AR934X_SRIF_SIZE	0x1000
+
+#define	AR934X_DDR_REG_FLUSH_GE0	(AR71XX_APB_BASE + 0x9c)
+#define	AR934X_DDR_REG_FLUSH_GE1	(AR71XX_APB_BASE + 0xa0)
+#define	AR934X_DDR_REG_FLUSH_USB	(AR71XX_APB_BASE + 0xa4)
+#define	AR934X_DDR_REG_FLUSH_PCIE	(AR71XX_APB_BASE + 0xa8)
+#define	AR934X_DDR_REG_FLUSH_WMAC	(AR71XX_APB_BASE + 0xac)
+
+#define	AR934X_PLL_CPU_CONFIG_REG	(AR71XX_PLL_CPU_BASE + 0x00)
+#define	AR934X_PLL_DDR_CONFIG_REG	(AR71XX_PLL_CPU_BASE + 0x04)
+#define	AR934X_PLL_CPU_DDR_CLK_CTRL_REG	(AR71XX_PLL_CPU_BASE + 0x08)
+
+#define	AR934X_PLL_CPU_CONFIG_NFRAC_SHIFT	0
+#define	AR934X_PLL_CPU_CONFIG_NFRAC_MASK	0x3f
+#define	AR934X_PLL_CPU_CONFIG_NINT_SHIFT	6
+#define	AR934X_PLL_CPU_CONFIG_NINT_MASK		0x3f
+#define	AR934X_PLL_CPU_CONFIG_REFDIV_SHIFT	12
+#define	AR934X_PLL_CPU_CONFIG_REFDIV_MASK	0x1f
+#define	AR934X_PLL_CPU_CONFIG_OUTDIV_SHIFT	19
+#define	AR934X_PLL_CPU_CONFIG_OUTDIV_MASK	0x3
+
+#define	AR934X_PLL_DDR_CONFIG_NFRAC_SHIFT	0
+#define	AR934X_PLL_DDR_CONFIG_NFRAC_MASK	0x3ff
+#define	AR934X_PLL_DDR_CONFIG_NINT_SHIFT	10
+#define	AR934X_PLL_DDR_CONFIG_NINT_MASK		0x3f
+#define	AR934X_PLL_DDR_CONFIG_REFDIV_SHIFT	16
+#define	AR934X_PLL_DDR_CONFIG_REFDIV_MASK	0x1f
+#define	AR934X_PLL_DDR_CONFIG_OUTDIV_SHIFT	23
+#define	AR934X_PLL_DDR_CONFIG_OUTDIV_MASK	0x7
+
+#define	AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_PLL_BYPASS	(1 << 2)
+#define	AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_PLL_BYPASS	(1 << 3)
+#define	AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_PLL_BYPASS	(1 << 4)
+#define	AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_SHIFT	5
+#define	AR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_MASK	0x1f
+#define	AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_SHIFT	10
+#define	AR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_MASK	0x1f
+#define	AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_SHIFT	15
+#define	AR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_MASK	0x1f
+#define	AR934X_PLL_CPU_DDR_CLK_CTRL_CPUCLK_FROM_CPUPLL	(1 << 20)
+#define	AR934X_PLL_CPU_DDR_CLK_CTRL_DDRCLK_FROM_DDRPLL	(1 << 21)
+#define	AR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL	(1 << 24)
+
+#define	AR934X_RESET_REG_RESET_MODULE		(AR71XX_RST_BLOCK_BASE + 0x1c)
+#define	AR934X_RESET_REG_BOOTSTRAP		(AR71XX_RST_BLOCK_BASE + 0xb0)
+#define	AR934X_RESET_REG_PCIE_WMAC_INT_STATUS	(AR71XX_RST_BLOCK_BASE + 0xac)
+
+#define	AR934X_RESET_USB_PHY_ANALOG	(1 << 11)
+#define	AR934X_RESET_USB_HOST		(1 << 5)
+#define	AR934X_RESET_USB_PHY		(1 << 4)
+#define	AR934X_RESET_USBSUS_OVERRIDE	(1 << 3)
+
+#define	AR934X_BOOTSTRAP_SW_OPTION8	(1 << 23)
+#define	AR934X_BOOTSTRAP_SW_OPTION7	(1 << 22)
+#define	AR934X_BOOTSTRAP_SW_OPTION6	(1 << 21)
+#define	AR934X_BOOTSTRAP_SW_OPTION5	(1 << 20)
+#define	AR934X_BOOTSTRAP_SW_OPTION4	(1 << 19)
+#define	AR934X_BOOTSTRAP_SW_OPTION3	(1 << 18)
+#define	AR934X_BOOTSTRAP_SW_OPTION2	(1 << 17)
+#define	AR934X_BOOTSTRAP_SW_OPTION1	(1 << 16)
+#define	AR934X_BOOTSTRAP_USB_MODE_DEVICE	(1 << 7)
+#define	AR934X_BOOTSTRAP_PCIE_RC	(1 << 6)
+#define	AR934X_BOOTSTRAP_EJTAG_MODE	(1 << 5)
+#define	AR934X_BOOTSTRAP_REF_CLK_40	(1 << 4)
+#define	AR934X_BOOTSTRAP_BOOT_FROM_SPI	(1 << 2)
+#define	AR934X_BOOTSTRAP_SDRAM_DISABLED	(1 << 1)
+#define	AR934X_BOOTSTRAP_DDR1		(1 << 0)
+
+#define	AR934X_PCIE_WMAC_INT_WMAC_MISC	(1 << 0)
+#define	AR934X_PCIE_WMAC_INT_WMAC_TX	(1 << 1)
+#define	AR934X_PCIE_WMAC_INT_WMAC_RXLP	(1 << 2)
+#define	AR934X_PCIE_WMAC_INT_WMAC_RXHP	(1 << 3)
+#define	AR934X_PCIE_WMAC_INT_PCIE_RC	(1 << 4)
+#define	AR934X_PCIE_WMAC_INT_PCIE_RC0	(1 << 5)
+#define	AR934X_PCIE_WMAC_INT_PCIE_RC1	(1 << 6)
+#define	AR934X_PCIE_WMAC_INT_PCIE_RC2	(1 << 7)
+#define	AR934X_PCIE_WMAC_INT_PCIE_RC3	(1 << 8)
+#define	AR934X_PCIE_WMAC_INT_WMAC_ALL \
+        (AR934X_PCIE_WMAC_INT_WMAC_MISC | AR934X_PCIE_WMAC_INT_WMAC_TX | \
+         AR934X_PCIE_WMAC_INT_WMAC_RXLP | AR934X_PCIE_WMAC_INT_WMAC_RXHP)
+
+#define	AR934X_PCIE_WMAC_INT_PCIE_ALL \
+        (AR934X_PCIE_WMAC_INT_PCIE_RC | AR934X_PCIE_WMAC_INT_PCIE_RC0 | \
+         AR934X_PCIE_WMAC_INT_PCIE_RC1 | AR934X_PCIE_WMAC_INT_PCIE_RC2 | \
+         AR934X_PCIE_WMAC_INT_PCIE_RC3)
+
+#define	REV_ID_MAJOR_AR9341		0x0120
+#define	REV_ID_MAJOR_AR9342		0x1120
+#define	REV_ID_MAJOR_AR9344		0x2120
+
+#define	AR934X_REV_ID_REVISION_MASK     0xf
+
+/*
+ * GPIO block
+ */
+#define	AR934X_GPIO_REG_FUNC		0x6c
+#define	AR934X_GPIO_COUNT		23
+
+/*
+ * SRIF block
+ */
+#define	AR934X_SRIF_CPU_DPLL1_REG	(AR934X_SRIF_BASE + 0x1c0)
+#define	AR934X_SRIF_CPU_DPLL2_REG	(AR934X_SRIF_BASE + 0x1c4)
+#define	AR934X_SRIF_CPU_DPLL3_REG	(AR934X_SRIF_BASE + 0x1c8)
+
+#define	AR934X_SRIF_DDR_DPLL1_REG	(AR934X_SRIF_BASE + 0x240)
+#define	AR934X_SRIF_DDR_DPLL2_REG	(AR934X_SRIF_BASE + 0x244)
+#define	AR934X_SRIF_DDR_DPLL3_REG	(AR934X_SRIF_BASE + 0x248)
+
+#define	AR934X_SRIF_DPLL1_REFDIV_SHIFT	27
+#define	AR934X_SRIF_DPLL1_REFDIV_MASK	0x1f
+#define	AR934X_SRIF_DPLL1_NINT_SHIFT	18
+#define	AR934X_SRIF_DPLL1_NINT_MASK	0x1ff
+#define	AR934X_SRIF_DPLL1_NFRAC_MASK	0x0003ffff
+
+#define	AR934X_SRIF_DPLL2_LOCAL_PLL	(1 << 30)
+#define	AR934X_SRIF_DPLL2_OUTDIV_SHIFT	13
+#define	AR934X_SRIF_DPLL2_OUTDIV_MASK	0x7
+
+#endif	/* __AR934X_REG_H__ */

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 06:23:32 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 903885A4;
 Mon,  8 Jul 2013 06:23:32 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-vb0-x22c.google.com (mail-vb0-x22c.google.com
 [IPv6:2607:f8b0:400c:c02::22c])
 by mx1.freebsd.org (Postfix) with ESMTP id 1D0551AA9;
 Mon,  8 Jul 2013 06:23:32 +0000 (UTC)
Received: by mail-vb0-f44.google.com with SMTP id e15so3099329vbg.31
 for ; Sun, 07 Jul 2013 23:23:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type:content-transfer-encoding;
 bh=pZprHLhgQ7qljIiJE1K2R0/hlLLIgXYc59qNeR3shLc=;
 b=XoMlzBFLd8bfDECQIbWgmZRomBA11aE+2wzrm7gZh98A/8H/cfrtAhBZPukRRH/suM
 ga9HX5mPdzwxyS26tLxfGq6Oj3mL6IcSWy4fginLJwaFNUz3DtQKn19fRiVGWoxrzGMQ
 DT0rUc7JHEgtcIIgrijyXNXcidi9OWLOtnZ9h4kQMWpufOPcrO+k98Kev+Uscyn76/Zs
 yoFUeHL/mG6VYEHT/bpsAvZbJpMGgzV3L/cvkMTLUjpRjFD62sESRt9vxJQ5dXKnQWfX
 vHF0P1YzfZ5NeGSoTwfaZA/KHIbWPtn9k7khgdnN1DEedYGx+s6xeEPUh5zeN7W9QzoA
 y5Sw==
MIME-Version: 1.0
X-Received: by 10.221.5.71 with SMTP id of7mr13147599vcb.39.1373264611572;
 Sun, 07 Jul 2013 23:23:31 -0700 (PDT)
Received: by 10.220.146.145 with HTTP; Sun, 7 Jul 2013 23:23:31 -0700 (PDT)
In-Reply-To: 
References: <201307072039.r67KdCdR028908@svn.freebsd.org>
 <9D4C7540-A3B0-45E5-8219-6A455D41DF70@gmail.com>
 <51D9DA55.2090808@freebsd.org>
 
Date: Sun, 7 Jul 2013 23:23:31 -0700
Message-ID: 
Subject: Re: svn commit: r253002 - head
From: Garrett Cooper 
To: Alfred Perlstein 
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" 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 06:23:32 -0000

On Sun, Jul 7, 2013 at 7:25 PM, Garrett Cooper  wrot=
e:
> On Jul 7, 2013, at 2:15 PM, Alfred Perlstein  wrote:
>
>> On 7/7/13 2:01 PM, Garrett Cooper wrote:
>>> Why the magic number 12?
>>
>> Numbers higher seem to result in worse performance as reported by some m=
embers of my team.
>
> The suggestion is good in spirit, but this doesn't justify the reasoning =
for this recommendation for all cases.
>
> Please revert this change and add a doc page or notes to the dev handbook=
 discussing what the empirical process and results were for determining thi=
s value so people can come up with their own values that work best with the=
ir hardware and software config. This recommendation is prone to bitrot lik=
e some of the recommendations in tuning(7).
>
> Misinformation is sometimes more harmful than no information.

I spoke with Alfred over the phone and did some more careful thought
about this and I'm rescinding this request.

Alfred did a good job at documenting how JFLAG works (it was
previously undocumented). My concern over -j12 was performance
related, and after giving things more careful thought it actually
makes sense why -j12 was chosen because Westmere and newer processors
have issues with NUMA and cache locality between multiple processor
packages as we've seen non-empirically and empirically at Isilon with
FreeBSD 7 and 10 (it's a known issue that jeffr@ and jhb@ are aware
of).

I'll come up with a concise patch that does what Alfred was trying to
achieve and have Alfred review it.

Thanks (and thank you Alfred for the contribution!!!)!
-Garrett

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 12:17:10 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 745C25C0;
 Mon,  8 Jul 2013 12:17:10 +0000 (UTC)
 (envelope-from achim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 5654C1D1A;
 Mon,  8 Jul 2013 12:17:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68CHAim059937;
 Mon, 8 Jul 2013 12:17:10 GMT (envelope-from achim@svn.freebsd.org)
Received: (from achim@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68CH7Rl059920;
 Mon, 8 Jul 2013 12:17:07 GMT (envelope-from achim@svn.freebsd.org)
Message-Id: <201307081217.r68CH7Rl059920@svn.freebsd.org>
From: Achim Leubner 
Date: Mon, 8 Jul 2013 12:17:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253033 - in stable/8: share/man/man4 sys sys/amd64/amd64
 sys/amd64/conf sys/conf sys/dev/aacraid sys/dev/sound sys/i386/conf
 sys/i386/i386 sys/ia64/conf sys/modules sys/modules/aacraid...
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 12:17:10 -0000

Author: achim
Date: Mon Jul  8 12:17:06 2013
New Revision: 253033
URL: http://svnweb.freebsd.org/changeset/base/253033

Log:
  MFC r250963, r251013, r251056: Driver 'aacraid' added to support Adaptec by PMC RAID controller families Series 6, 7, 8 and upcoming products.
  
  Approved by:	emaste (co-mentor)

Added:
  stable/8/share/man/man4/aacraid.4
     - copied, changed from r250963, head/share/man/man4/aacraid.4
  stable/8/sys/dev/aacraid/
     - copied from r250963, head/sys/dev/aacraid/
  stable/8/sys/modules/aacraid/
     - copied from r250963, head/sys/modules/aacraid/
Modified:
  stable/8/share/man/man4/Makefile
  stable/8/sys/amd64/conf/GENERIC
  stable/8/sys/amd64/conf/NOTES
  stable/8/sys/conf/files
  stable/8/sys/conf/options
  stable/8/sys/dev/aacraid/aacraid.c
  stable/8/sys/i386/conf/GENERIC
  stable/8/sys/i386/conf/NOTES
  stable/8/sys/ia64/conf/GENERIC
  stable/8/sys/modules/Makefile
  stable/8/sys/modules/aacraid/Makefile
  stable/8/sys/sys/aac_ioctl.h
Directory Properties:
  stable/8/share/man/man4/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/Makefile   (props changed)
  stable/8/sys/amd64/   (props changed)
  stable/8/sys/amd64/amd64/intr_machdep.c   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/arm/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/bsm/   (props changed)
  stable/8/sys/cam/   (props changed)
  stable/8/sys/cddl/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/compat/   (props changed)
  stable/8/sys/conf/   (props changed)
  stable/8/sys/contrib/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/crypto/   (props changed)
  stable/8/sys/ddb/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/aac/   (props changed)
  stable/8/sys/dev/acpi_support/   (props changed)
  stable/8/sys/dev/acpica/   (props changed)
  stable/8/sys/dev/adb/   (props changed)
  stable/8/sys/dev/adlink/   (props changed)
  stable/8/sys/dev/advansys/   (props changed)
  stable/8/sys/dev/ae/   (props changed)
  stable/8/sys/dev/age/   (props changed)
  stable/8/sys/dev/agp/   (props changed)
  stable/8/sys/dev/aha/   (props changed)
  stable/8/sys/dev/ahb/   (props changed)
  stable/8/sys/dev/ahci/   (props changed)
  stable/8/sys/dev/aic/   (props changed)
  stable/8/sys/dev/aic7xxx/   (props changed)
  stable/8/sys/dev/alc/   (props changed)
  stable/8/sys/dev/ale/   (props changed)
  stable/8/sys/dev/amd/   (props changed)
  stable/8/sys/dev/amdsbwd/   (props changed)
  stable/8/sys/dev/amdtemp/   (props changed)
  stable/8/sys/dev/amr/   (props changed)
  stable/8/sys/dev/an/   (props changed)
  stable/8/sys/dev/arcmsr/   (props changed)
  stable/8/sys/dev/asmc/   (props changed)
  stable/8/sys/dev/asr/   (props changed)
  stable/8/sys/dev/ata/   (props changed)
  stable/8/sys/dev/ath/   (props changed)
  stable/8/sys/dev/atkbdc/   (props changed)
  stable/8/sys/dev/auxio/   (props changed)
  stable/8/sys/dev/bce/   (props changed)
  stable/8/sys/dev/bfe/   (props changed)
  stable/8/sys/dev/bge/   (props changed)
  stable/8/sys/dev/bktr/   (props changed)
  stable/8/sys/dev/bm/   (props changed)
  stable/8/sys/dev/buslogic/   (props changed)
  stable/8/sys/dev/bwi/   (props changed)
  stable/8/sys/dev/bwn/   (props changed)
  stable/8/sys/dev/cardbus/   (props changed)
  stable/8/sys/dev/cas/   (props changed)
  stable/8/sys/dev/ce/   (props changed)
  stable/8/sys/dev/cfe/   (props changed)
  stable/8/sys/dev/cfi/   (props changed)
  stable/8/sys/dev/ciss/   (props changed)
  stable/8/sys/dev/cm/   (props changed)
  stable/8/sys/dev/cmx/   (props changed)
  stable/8/sys/dev/coretemp/   (props changed)
  stable/8/sys/dev/cp/   (props changed)
  stable/8/sys/dev/cpuctl/   (props changed)
  stable/8/sys/dev/cpufreq/   (props changed)
  stable/8/sys/dev/cs/   (props changed)
  stable/8/sys/dev/ct/   (props changed)
  stable/8/sys/dev/ctau/   (props changed)
  stable/8/sys/dev/cx/   (props changed)
  stable/8/sys/dev/cxgb/   (props changed)
  stable/8/sys/dev/cxgbe/   (props changed)
  stable/8/sys/dev/cy/   (props changed)
  stable/8/sys/dev/dc/   (props changed)
  stable/8/sys/dev/dcons/   (props changed)
  stable/8/sys/dev/de/   (props changed)
  stable/8/sys/dev/digi/   (props changed)
  stable/8/sys/dev/dpms/   (props changed)
  stable/8/sys/dev/dpt/   (props changed)
  stable/8/sys/dev/drm/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)
  stable/8/sys/dev/ed/   (props changed)
  stable/8/sys/dev/eisa/   (props changed)
  stable/8/sys/dev/en/   (props changed)
  stable/8/sys/dev/ep/   (props changed)
  stable/8/sys/dev/esp/   (props changed)
  stable/8/sys/dev/et/   (props changed)
  stable/8/sys/dev/ex/   (props changed)
  stable/8/sys/dev/exca/   (props changed)
  stable/8/sys/dev/fatm/   (props changed)
  stable/8/sys/dev/fb/   (props changed)
  stable/8/sys/dev/fdc/   (props changed)
  stable/8/sys/dev/fe/   (props changed)
  stable/8/sys/dev/firewire/   (props changed)
  stable/8/sys/dev/flash/   (props changed)
  stable/8/sys/dev/fxp/   (props changed)
  stable/8/sys/dev/gem/   (props changed)
  stable/8/sys/dev/glxsb/   (props changed)
  stable/8/sys/dev/hatm/   (props changed)
  stable/8/sys/dev/hifn/   (props changed)
  stable/8/sys/dev/hme/   (props changed)
  stable/8/sys/dev/hpt27xx/   (props changed)
  stable/8/sys/dev/hptiop/   (props changed)
  stable/8/sys/dev/hptmv/   (props changed)
  stable/8/sys/dev/hptrr/   (props changed)
  stable/8/sys/dev/hwpmc/   (props changed)
  stable/8/sys/dev/ic/   (props changed)
  stable/8/sys/dev/ichsmb/   (props changed)
  stable/8/sys/dev/ichwd/   (props changed)
  stable/8/sys/dev/ida/   (props changed)
  stable/8/sys/dev/ie/   (props changed)
  stable/8/sys/dev/ieee488/   (props changed)
  stable/8/sys/dev/if_ndis/   (props changed)
  stable/8/sys/dev/iicbus/   (props changed)
  stable/8/sys/dev/iir/   (props changed)
  stable/8/sys/dev/io/   (props changed)
  stable/8/sys/dev/ipmi/   (props changed)
  stable/8/sys/dev/ips/   (props changed)
  stable/8/sys/dev/ipw/   (props changed)
  stable/8/sys/dev/isci/   (props changed)
  stable/8/sys/dev/iscsi/   (props changed)
  stable/8/sys/dev/isp/   (props changed)
  stable/8/sys/dev/ispfw/   (props changed)
  stable/8/sys/dev/iwi/   (props changed)
  stable/8/sys/dev/iwn/   (props changed)
  stable/8/sys/dev/ixgb/   (props changed)
  stable/8/sys/dev/ixgbe/   (props changed)
  stable/8/sys/dev/jme/   (props changed)
  stable/8/sys/dev/joy/   (props changed)
  stable/8/sys/dev/kbd/   (props changed)
  stable/8/sys/dev/kbdmux/   (props changed)
  stable/8/sys/dev/ksyms/   (props changed)
  stable/8/sys/dev/le/   (props changed)
  stable/8/sys/dev/led/   (props changed)
  stable/8/sys/dev/lge/   (props changed)
  stable/8/sys/dev/lindev/   (props changed)
  stable/8/sys/dev/lmc/   (props changed)
  stable/8/sys/dev/malo/   (props changed)
  stable/8/sys/dev/mc146818/   (props changed)
  stable/8/sys/dev/mca/   (props changed)
  stable/8/sys/dev/mcd/   (props changed)
  stable/8/sys/dev/md/   (props changed)
  stable/8/sys/dev/mem/   (props changed)
  stable/8/sys/dev/mfi/   (props changed)
  stable/8/sys/dev/mge/   (props changed)
  stable/8/sys/dev/mii/   (props changed)
  stable/8/sys/dev/mk48txx/   (props changed)
  stable/8/sys/dev/mlx/   (props changed)
  stable/8/sys/dev/mly/   (props changed)
  stable/8/sys/dev/mmc/   (props changed)
  stable/8/sys/dev/mn/   (props changed)
  stable/8/sys/dev/mps/   (props changed)
  stable/8/sys/dev/mpt/   (props changed)
  stable/8/sys/dev/mse/   (props changed)
  stable/8/sys/dev/msk/   (props changed)
  stable/8/sys/dev/mvs/   (props changed)
  stable/8/sys/dev/mwl/   (props changed)
  stable/8/sys/dev/mxge/   (props changed)
  stable/8/sys/dev/my/   (props changed)
  stable/8/sys/dev/ncv/   (props changed)
  stable/8/sys/dev/netmap/   (props changed)
  stable/8/sys/dev/nfe/   (props changed)
  stable/8/sys/dev/nge/   (props changed)
  stable/8/sys/dev/nmdm/   (props changed)
  stable/8/sys/dev/nsp/   (props changed)
  stable/8/sys/dev/null/   (props changed)
  stable/8/sys/dev/nve/   (props changed)
  stable/8/sys/dev/nvram/   (props changed)
  stable/8/sys/dev/nxge/   (props changed)
  stable/8/sys/dev/oce/   (props changed)
  stable/8/sys/dev/ofw/   (props changed)
  stable/8/sys/dev/patm/   (props changed)
  stable/8/sys/dev/pbio/   (props changed)
  stable/8/sys/dev/pccard/   (props changed)
  stable/8/sys/dev/pccbb/   (props changed)
  stable/8/sys/dev/pcf/   (props changed)
  stable/8/sys/dev/pci/   (props changed)
  stable/8/sys/dev/pcn/   (props changed)
  stable/8/sys/dev/pdq/   (props changed)
  stable/8/sys/dev/powermac_nvram/   (props changed)
  stable/8/sys/dev/ppbus/   (props changed)
  stable/8/sys/dev/ppc/   (props changed)
  stable/8/sys/dev/pst/   (props changed)
  stable/8/sys/dev/puc/   (props changed)
  stable/8/sys/dev/quicc/   (props changed)
  stable/8/sys/dev/ral/   (props changed)
  stable/8/sys/dev/random/   (props changed)
  stable/8/sys/dev/rc/   (props changed)
  stable/8/sys/dev/re/   (props changed)
  stable/8/sys/dev/rndtest/   (props changed)
  stable/8/sys/dev/rp/   (props changed)
  stable/8/sys/dev/safe/   (props changed)
  stable/8/sys/dev/sbni/   (props changed)
  stable/8/sys/dev/scc/   (props changed)
  stable/8/sys/dev/scd/   (props changed)
  stable/8/sys/dev/sdhci/   (props changed)
  stable/8/sys/dev/sec/   (props changed)
  stable/8/sys/dev/sf/   (props changed)
  stable/8/sys/dev/sge/   (props changed)
  stable/8/sys/dev/si/   (props changed)
  stable/8/sys/dev/siba/   (props changed)
  stable/8/sys/dev/siis/   (props changed)
  stable/8/sys/dev/sio/   (props changed)
  stable/8/sys/dev/sis/   (props changed)
  stable/8/sys/dev/sk/   (props changed)
  stable/8/sys/dev/smbus/   (props changed)
  stable/8/sys/dev/smc/   (props changed)
  stable/8/sys/dev/sn/   (props changed)
  stable/8/sys/dev/snc/   (props changed)
  stable/8/sys/dev/snp/   (props changed)
  stable/8/sys/dev/sound/   (props changed)
  stable/8/sys/dev/sound/chip.h   (props changed)
  stable/8/sys/dev/sound/clone.c   (props changed)
  stable/8/sys/dev/sound/clone.h   (props changed)
  stable/8/sys/dev/sound/driver.c   (props changed)
  stable/8/sys/dev/sound/isa/   (props changed)
  stable/8/sys/dev/sound/macio/   (props changed)
  stable/8/sys/dev/sound/midi/   (props changed)
  stable/8/sys/dev/sound/pci/   (props changed)
  stable/8/sys/dev/sound/pcm/   (props changed)
  stable/8/sys/dev/sound/sbus/   (props changed)
  stable/8/sys/dev/sound/unit.c   (props changed)
  stable/8/sys/dev/sound/unit.h   (props changed)
  stable/8/sys/dev/sound/usb/   (props changed)
  stable/8/sys/dev/sound/version.h   (props changed)
  stable/8/sys/dev/speaker/   (props changed)
  stable/8/sys/dev/spibus/   (props changed)
  stable/8/sys/dev/ste/   (props changed)
  stable/8/sys/dev/stg/   (props changed)
  stable/8/sys/dev/stge/   (props changed)
  stable/8/sys/dev/streams/   (props changed)
  stable/8/sys/dev/sym/   (props changed)
  stable/8/sys/dev/syscons/   (props changed)
  stable/8/sys/dev/tdfx/   (props changed)
  stable/8/sys/dev/ti/   (props changed)
  stable/8/sys/dev/tl/   (props changed)
  stable/8/sys/dev/tpm/   (props changed)
  stable/8/sys/dev/trm/   (props changed)
  stable/8/sys/dev/tsec/   (props changed)
  stable/8/sys/dev/twa/   (props changed)
  stable/8/sys/dev/twe/   (props changed)
  stable/8/sys/dev/tws/   (props changed)
  stable/8/sys/dev/tx/   (props changed)
  stable/8/sys/dev/txp/   (props changed)
  stable/8/sys/dev/uart/   (props changed)
  stable/8/sys/dev/ubsec/   (props changed)
  stable/8/sys/dev/usb/   (props changed)
  stable/8/sys/dev/utopia/   (props changed)
  stable/8/sys/dev/vge/   (props changed)
  stable/8/sys/dev/viawd/   (props changed)
  stable/8/sys/dev/virtio/   (props changed)
  stable/8/sys/dev/vkbd/   (props changed)
  stable/8/sys/dev/vr/   (props changed)
  stable/8/sys/dev/vte/   (props changed)
  stable/8/sys/dev/vx/   (props changed)
  stable/8/sys/dev/watchdog/   (props changed)
  stable/8/sys/dev/wb/   (props changed)
  stable/8/sys/dev/wbwd/   (props changed)
  stable/8/sys/dev/wds/   (props changed)
  stable/8/sys/dev/wi/   (props changed)
  stable/8/sys/dev/wl/   (props changed)
  stable/8/sys/dev/wpi/   (props changed)
  stable/8/sys/dev/xe/   (props changed)
  stable/8/sys/dev/xen/   (props changed)
  stable/8/sys/dev/xl/   (props changed)
  stable/8/sys/fs/   (props changed)
  stable/8/sys/gdb/   (props changed)
  stable/8/sys/geom/   (props changed)
  stable/8/sys/gnu/   (props changed)
  stable/8/sys/i386/   (props changed)
  stable/8/sys/i386/i386/intr_machdep.c   (props changed)
  stable/8/sys/ia64/   (props changed)
  stable/8/sys/isa/   (props changed)
  stable/8/sys/kern/   (props changed)
  stable/8/sys/kgssapi/   (props changed)
  stable/8/sys/libkern/   (props changed)
  stable/8/sys/mips/   (props changed)
  stable/8/sys/modules/   (props changed)
  stable/8/sys/net/   (props changed)
  stable/8/sys/net80211/   (props changed)
  stable/8/sys/netatalk/   (props changed)
  stable/8/sys/netgraph/   (props changed)
  stable/8/sys/netinet/   (props changed)
  stable/8/sys/netinet6/   (props changed)
  stable/8/sys/netipsec/   (props changed)
  stable/8/sys/netipx/   (props changed)
  stable/8/sys/netnatm/   (props changed)
  stable/8/sys/netncp/   (props changed)
  stable/8/sys/netsmb/   (props changed)
  stable/8/sys/nfs/   (props changed)
  stable/8/sys/nfsclient/   (props changed)
  stable/8/sys/nfsserver/   (props changed)
  stable/8/sys/nlm/   (props changed)
  stable/8/sys/opencrypto/   (props changed)
  stable/8/sys/pc98/   (props changed)
  stable/8/sys/pci/   (props changed)
  stable/8/sys/powerpc/   (props changed)
  stable/8/sys/rpc/   (props changed)
  stable/8/sys/security/   (props changed)
  stable/8/sys/sparc64/   (props changed)
  stable/8/sys/sun4v/   (props changed)
  stable/8/sys/sys/   (props changed)
  stable/8/sys/tools/   (props changed)
  stable/8/sys/ufs/   (props changed)
  stable/8/sys/vm/   (props changed)
  stable/8/sys/x86/   (props changed)
  stable/8/sys/xdr/   (props changed)
  stable/8/sys/xen/   (props changed)

Modified: stable/8/share/man/man4/Makefile
==============================================================================
--- stable/8/share/man/man4/Makefile	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/share/man/man4/Makefile	Mon Jul  8 12:17:06 2013	(r253033)
@@ -2,6 +2,7 @@
 # $FreeBSD$
 
 MAN=	aac.4 \
+	aacraid.4 \
 	acpi.4 \
 	${_acpi_aiboost.4} \
 	${_acpi_asus.4} \

Copied and modified: stable/8/share/man/man4/aacraid.4 (from r250963, head/share/man/man4/aacraid.4)
==============================================================================
--- head/share/man/man4/aacraid.4	Fri May 24 09:22:43 2013	(r250963, copy source)
+++ stable/8/share/man/man4/aacraid.4	Mon Jul  8 12:17:06 2013	(r253033)
@@ -53,10 +53,10 @@ The
 driver provides support for the Adaptec by PMC RAID controllers,
 including Series 6/7/8 and upcoming families.
 .Pp
-The RAID containers are handled via the 
+The RAID containers are handled via the
 .Nm aacraidp0
 bus.
-The physical buses are represented by the 
+The physical buses are represented by the
 .Nm aacraidp?
 devices (beginning with aacraidp1). These devices enable the
 SCSI pass-thru interface and allows devices connected
@@ -135,5 +135,4 @@ and are also queued for retrieval by a m
 .An Scott Long
 .Aq scottl@FreeBSD.org
 .Sh BUGS
-.Pp
 The controller is not actually paused on suspend/resume.

Modified: stable/8/sys/amd64/conf/GENERIC
==============================================================================
--- stable/8/sys/amd64/conf/GENERIC	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/amd64/conf/GENERIC	Mon Jul  8 12:17:06 2013	(r253033)
@@ -151,6 +151,7 @@ device		twa		# 3ware 9000 series PATA/SA
 # RAID controllers
 device		aac		# Adaptec FSA RAID
 device		aacp		# SCSI passthrough for aac (requires CAM)
+device		aacraid		# Adaptec by PMC RAID
 device		ida		# Compaq Smart RAID
 device		mfi		# LSI MegaRAID SAS
 device		mlx		# Mylex DAC960 family

Modified: stable/8/sys/amd64/conf/NOTES
==============================================================================
--- stable/8/sys/amd64/conf/NOTES	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/amd64/conf/NOTES	Mon Jul  8 12:17:06 2013	(r253033)
@@ -389,6 +389,10 @@ device		aac
 device		aacp	# SCSI Passthrough interface (optional, CAM required)
 
 #
+# Adaptec by PMC RAID controllers, Series 6/7/8 and upcoming families
+device		aacraid		# Container interface, CAM required
+
+#
 # Highpoint RocketRAID 27xx.
 device		hpt27xx
 

Modified: stable/8/sys/conf/files
==============================================================================
--- stable/8/sys/conf/files	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/conf/files	Mon Jul  8 12:17:06 2013	(r253033)
@@ -397,6 +397,11 @@ dev/aac/aac_debug.c		optional aac
 dev/aac/aac_disk.c		optional aac
 dev/aac/aac_linux.c		optional aac compat_linux
 dev/aac/aac_pci.c		optional aac pci
+dev/aacraid/aacraid.c		optional aacraid
+dev/aacraid/aacraid_cam.c	optional aacraid scbus
+dev/aacraid/aacraid_debug.c	optional aacraid
+dev/aacraid/aacraid_linux.c	optional aacraid compat_linux
+dev/aacraid/aacraid_pci.c	optional aacraid pci
 dev/acpi_support/acpi_wmi.c	optional acpi_wmi acpi
 dev/acpi_support/acpi_aiboost.c	optional acpi_aiboost acpi
 dev/acpi_support/acpi_asus.c	optional acpi_asus acpi

Modified: stable/8/sys/conf/options
==============================================================================
--- stable/8/sys/conf/options	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/conf/options	Mon Jul  8 12:17:06 2013	(r253033)
@@ -31,6 +31,7 @@
 # opt_.h
 
 AAC_DEBUG		opt_aac.h
+AACRAID_DEBUG		opt_aacraid.h
 AHC_ALLOW_MEMIO		opt_aic7xxx.h
 AHC_TMODE_ENABLE	opt_aic7xxx.h
 AHC_DUMP_EEPROM		opt_aic7xxx.h

Modified: stable/8/sys/dev/aacraid/aacraid.c
==============================================================================
--- head/sys/dev/aacraid/aacraid.c	Fri May 24 09:22:43 2013	(r250963)
+++ stable/8/sys/dev/aacraid/aacraid.c	Mon Jul  8 12:17:06 2013	(r253033)
@@ -2522,7 +2522,7 @@ aac_ioctl_send_raw_srb(struct aac_softc 
 		srb_sg_address = (u_int64_t)sgp->SgAddress;
 	} else if (fibsize == (sizeof(struct aac_srb) + 
 		srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) {
-#ifdef __amd64__
+#ifdef __LP64__
 		struct aac_sg_entry64 *sgp = 
 			(struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry;
 		srb_sg_bytecount = sgp->SgByteCount;
@@ -2576,12 +2576,7 @@ aac_ioctl_send_raw_srb(struct aac_softc 
 			cm->cm_flags |= AAC_CMD_DATAOUT;
 
 		if (srbcmd->flags & AAC_SRB_FLAGS_DATA_OUT) {
-			if ((error = copyin(
-#ifdef __amd64__
-				(void *)srb_sg_address,
-#else
-				(void *)(u_int32_t)srb_sg_address,
-#endif
+			if ((error = copyin((void *)(uintptr_t)srb_sg_address,
 				cm->cm_data, cm->cm_datalen)) != 0)
 				goto out;
 			/* sync required for bus_dmamem_alloc() alloc. mem.? */
@@ -2624,12 +2619,8 @@ aac_ioctl_send_raw_srb(struct aac_softc 
 
 	/* copy data */
 	if (transfer_data && (srbcmd->flags & AAC_SRB_FLAGS_DATA_IN)) {
-		if ((error = copyout(cm->cm_data, 
-#ifdef __amd64__
-			(void *)srb_sg_address,
-#else
-			(void *)(u_int32_t)srb_sg_address,
-#endif
+		if ((error = copyout(cm->cm_data,
+			(void *)(uintptr_t)srb_sg_address,
 			cm->cm_datalen)) != 0)
 			goto out;
 		/* sync required for bus_dmamem_alloc() allocated mem.? */

Modified: stable/8/sys/i386/conf/GENERIC
==============================================================================
--- stable/8/sys/i386/conf/GENERIC	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/i386/conf/GENERIC	Mon Jul  8 12:17:06 2013	(r253033)
@@ -158,6 +158,7 @@ device		tws		# LSI 3ware 9750 SATA+SAS 6
 # RAID controllers
 device		aac		# Adaptec FSA RAID
 device		aacp		# SCSI passthrough for aac (requires CAM)
+device		aacraid		# Adaptec by PMC RAID
 device		ida		# Compaq Smart RAID
 device		mfi		# LSI MegaRAID SAS
 device		mlx		# Mylex DAC960 family

Modified: stable/8/sys/i386/conf/NOTES
==============================================================================
--- stable/8/sys/i386/conf/NOTES	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/i386/conf/NOTES	Mon Jul  8 12:17:06 2013	(r253033)
@@ -718,6 +718,10 @@ hint.stg.0.port="11"
 device		aac
 device		aacp	# SCSI Passthrough interface (optional, CAM required)
 
+#
+# Adaptec by PMC RAID controllers, Series 6/7/8 and upcoming families
+device		aacraid		# Container interface, CAM required
+
 # The 'asr' driver provides support for current DPT/Adaptec SCSI RAID
 # controllers (SmartRAID V and VI and later).
 # These controllers require the CAM infrastructure.

Modified: stable/8/sys/ia64/conf/GENERIC
==============================================================================
--- stable/8/sys/ia64/conf/GENERIC	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/ia64/conf/GENERIC	Mon Jul  8 12:17:06 2013	(r253033)
@@ -110,6 +110,7 @@ device		ses		# Environmental Services (a
 # RAID controllers
 device		aac		# Adaptec FSA RAID
 device		aacp		# SCSI passthrough for aac (requires CAM)
+device		aacraid		# Adaptec by PMC RAID
 device		ida		# Compaq Smart RAID
 device		mlx		# Mylex DAC960 family
 

Modified: stable/8/sys/modules/Makefile
==============================================================================
--- stable/8/sys/modules/Makefile	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/modules/Makefile	Mon Jul  8 12:17:06 2013	(r253033)
@@ -6,6 +6,7 @@ SUBDIR=	\
 	${_3dfx} \
 	${_3dfx_linux} \
 	${_aac} \
+	${_aacraid} \
 	accf_data \
 	accf_dns \
 	accf_http \
@@ -477,6 +478,7 @@ _zfs=		zfs
 .endif
 .if ${MACHINE} == "i386"
 _aac=		aac
+_aacraid=	aacraid
 _acpi=		acpi
 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
 _aesni=		aesni
@@ -540,6 +542,7 @@ _snc=		snc
 
 .if ${MACHINE_ARCH} == "amd64"
 _aac=		aac
+_aacraid=	aacraid
 _acpi=		acpi
 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
 _aesni=		aesni
@@ -636,6 +639,7 @@ _zfs=		zfs
 
 .if ${MACHINE_ARCH} == "ia64"
 _aac=		aac
+_aacraid=	aacraid
 _aic=		aic
 _an=		an
 _arcnet=	arcnet

Modified: stable/8/sys/modules/aacraid/Makefile
==============================================================================
--- head/sys/modules/aacraid/Makefile	Fri May 24 09:22:43 2013	(r250963)
+++ stable/8/sys/modules/aacraid/Makefile	Mon Jul  8 12:17:06 2013	(r253033)
@@ -2,7 +2,7 @@
 
 .PATH: ${.CURDIR}/../../dev/aacraid
 
-.if ${MACHINE_CPUARCH} == "i386"
+.if ${MACHINE_ARCH} == "i386"
 SUBDIR= aacraid_linux
 .endif
 

Modified: stable/8/sys/sys/aac_ioctl.h
==============================================================================
--- stable/8/sys/sys/aac_ioctl.h	Mon Jul  8 12:11:54 2013	(r253032)
+++ stable/8/sys/sys/aac_ioctl.h	Mon Jul  8 12:17:06 2013	(r253033)
@@ -192,7 +192,10 @@ struct aac_query_disk {
 typedef union {
 	struct {
 		u_int32_t largeLBA  : 1;	/* disk support greater 2TB */
-		u_int32_t fReserved : 31;
+		u_int32_t IoctlBuf  : 1;	/* ARCIOCTL call support */
+		u_int32_t AIFSupport: 1;	/* AIF support */
+		u_int32_t JBODSupport:1;	/* fw + driver support JBOD */
+		u_int32_t fReserved : 28;
 	} fBits;
 	u_int32_t fValue;
 } featuresState;

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 13:22:59 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 1B0605AB;
 Mon,  8 Jul 2013 13:22:59 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 0BC4110D0;
 Mon,  8 Jul 2013 13:22:59 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68DMwc2079636;
 Mon, 8 Jul 2013 13:22:58 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68DMwWF079635;
 Mon, 8 Jul 2013 13:22:58 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201307081322.r68DMwWF079635@svn.freebsd.org>
From: Michael Tuexen 
Date: Mon, 8 Jul 2013 13:22:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253034 - stable/8/sys/netinet
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 13:22:59 -0000

Author: tuexen
Date: Mon Jul  8 13:22:58 2013
New Revision: 253034
URL: http://svnweb.freebsd.org/changeset/base/253034

Log:
  Don't keep a pointer to freed memory.
  This is a direct commit, since this code is gone in head.

Modified:
  stable/8/sys/netinet/sctp_output.c

Modified: stable/8/sys/netinet/sctp_output.c
==============================================================================
--- stable/8/sys/netinet/sctp_output.c	Mon Jul  8 12:17:06 2013	(r253033)
+++ stable/8/sys/netinet/sctp_output.c	Mon Jul  8 13:22:58 2013	(r253034)
@@ -4487,6 +4487,7 @@ sctp_lowlevel_chunk_output(struct sctp_i
 				/* Now if we had a temp route free it */
 				if (ro->ro_rt) {
 					RTFREE(ro->ro_rt);
+					ro->ro_rt = NULL;
 				}
 			} else {
 				/*

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 13:24:18 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id E28F86E3;
 Mon,  8 Jul 2013 13:24:18 +0000 (UTC)
 (envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id C2FCA10DB;
 Mon,  8 Jul 2013 13:24:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68DOImb079827;
 Mon, 8 Jul 2013 13:24:18 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68DOIIT079823;
 Mon, 8 Jul 2013 13:24:18 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201307081324.r68DOIIT079823@svn.freebsd.org>
From: Andre Oppermann 
Date: Mon, 8 Jul 2013 13:24:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253035 - stable/9/sys/kern
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 13:24:19 -0000

Author: andre
Date: Mon Jul  8 13:24:18 2013
New Revision: 253035
URL: http://svnweb.freebsd.org/changeset/base/253035

Log:
  MFC r241726:
  
   Move UMA socket zone initialization from uipc_domain.c to uipc_socket.c
   into one place next to its other related functions to avoid confusion.
  
  MFC r241729:
  
   Move socket UMA zone initialization functionality together into
   one place.
  
  MFC r241779:
  
   Tidy up somaxconn (accept queue limit) and related functions
   and move it together into one place.

Modified:
  stable/9/sys/kern/uipc_domain.c
  stable/9/sys/kern/uipc_socket.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/uipc_domain.c
==============================================================================
--- stable/9/sys/kern/uipc_domain.c	Mon Jul  8 13:22:58 2013	(r253034)
+++ stable/9/sys/kern/uipc_domain.c	Mon Jul  8 13:24:18 2013	(r253035)
@@ -239,28 +239,11 @@ domain_add(void *data)
 	mtx_unlock(&dom_mtx);
 }
 
-static void
-socket_zone_change(void *tag)
-{
-
-	uma_zone_set_max(socket_zone, maxsockets);
-}
-
 /* ARGSUSED*/
 static void
 domaininit(void *dummy)
 {
 
-	/*
-	 * Before we do any setup, make sure to initialize the
-	 * zone allocator we get struct sockets from.
-	 */
-	socket_zone = uma_zcreate("socket", sizeof(struct socket), NULL, NULL,
-	    NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
-	uma_zone_set_max(socket_zone, maxsockets);
-	EVENTHANDLER_REGISTER(maxsockets_change, socket_zone_change, NULL,
-		EVENTHANDLER_PRI_FIRST);
-
 	if (max_linkhdr < 16)		/* XXX */
 		max_linkhdr = 16;
 

Modified: stable/9/sys/kern/uipc_socket.c
==============================================================================
--- stable/9/sys/kern/uipc_socket.c	Mon Jul  8 13:22:58 2013	(r253034)
+++ stable/9/sys/kern/uipc_socket.c	Mon Jul  8 13:24:18 2013	(r253035)
@@ -175,11 +175,8 @@ static struct filterops sowrite_filtops 
 	.f_event = filt_sowrite,
 };
 
-uma_zone_t socket_zone;
 so_gen_t	so_gencnt;	/* generation count for sockets */
 
-int	maxsockets;
-
 MALLOC_DEFINE(M_SONAME, "soname", "socket name");
 MALLOC_DEFINE(M_PCB, "pcb", "protocol control block");
 
@@ -187,15 +184,37 @@ MALLOC_DEFINE(M_PCB, "pcb", "protocol co
 	VNET_ASSERT(curvnet != NULL,					\
 	    ("%s:%d curvnet is NULL, so=%p", __func__, __LINE__, (so)));
 
+/*
+ * Limit on the number of connections in the listen queue waiting
+ * for accept(2).
+ */
 static int somaxconn = SOMAXCONN;
-static int sysctl_somaxconn(SYSCTL_HANDLER_ARGS);
-/* XXX: we dont have SYSCTL_USHORT */
+
+static int
+sysctl_somaxconn(SYSCTL_HANDLER_ARGS)
+{
+	int error;
+	int val;
+
+	val = somaxconn;
+	error = sysctl_handle_int(oidp, &val, 0, req);
+	if (error || !req->newptr )
+		return (error);
+
+	if (val < 1 || val > USHRT_MAX)
+		return (EINVAL);
+
+	somaxconn = val;
+	return (0);
+}
 SYSCTL_PROC(_kern_ipc, KIPC_SOMAXCONN, somaxconn, CTLTYPE_UINT | CTLFLAG_RW,
-    0, sizeof(int), sysctl_somaxconn, "I", "Maximum pending socket connection "
-    "queue size");
+    0, sizeof(int), sysctl_somaxconn, "I",
+    "Maximum listen socket pending connection accept queue size");
+
 static int numopensockets;
 SYSCTL_INT(_kern_ipc, OID_AUTO, numopensockets, CTLFLAG_RD,
     &numopensockets, 0, "Number of open sockets");
+
 #ifdef ZERO_COPY_SOCKETS
 /* These aren't static because they're used in other files. */
 int so_zero_copy_send = 1;
@@ -229,6 +248,45 @@ MTX_SYSINIT(so_global_mtx, &so_global_mt
 SYSCTL_NODE(_kern, KERN_IPC, ipc, CTLFLAG_RW, 0, "IPC");
 
 /*
+ * Initialize the socket subsystem and set up the socket
+ * memory allocator.
+ */
+uma_zone_t socket_zone;
+int	maxsockets;
+
+static void
+socket_zone_change(void *tag)
+{
+
+	uma_zone_set_max(socket_zone, maxsockets);
+}
+
+static void
+socket_init(void *tag)
+{
+
+        socket_zone = uma_zcreate("socket", sizeof(struct socket), NULL, NULL,
+            NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
+        uma_zone_set_max(socket_zone, maxsockets);
+        EVENTHANDLER_REGISTER(maxsockets_change, socket_zone_change, NULL,
+                EVENTHANDLER_PRI_FIRST);
+}
+SYSINIT(socket, SI_SUB_PROTO_DOMAININIT, SI_ORDER_ANY, socket_init, NULL);
+
+/*
+ * Initialise maxsockets.  This SYSINIT must be run after
+ * tunable_mbinit().
+ */
+static void
+init_maxsockets(void *ignored)
+{
+
+	TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets);
+	maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters));
+}
+SYSINIT(param, SI_SUB_TUNABLES, SI_ORDER_ANY, init_maxsockets, NULL);
+
+/*
  * Sysctl to get and set the maximum global sockets limit.  Notify protocols
  * of the change so that they can update their dependent limits as required.
  */
@@ -252,25 +310,11 @@ sysctl_maxsockets(SYSCTL_HANDLER_ARGS)
 	}
 	return (error);
 }
-
 SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets, CTLTYPE_INT|CTLFLAG_RW,
     &maxsockets, 0, sysctl_maxsockets, "IU",
     "Maximum number of sockets avaliable");
 
 /*
- * Initialise maxsockets.  This SYSINIT must be run after
- * tunable_mbinit().
- */
-static void
-init_maxsockets(void *ignored)
-{
-
-	TUNABLE_INT_FETCH("kern.ipc.maxsockets", &maxsockets);
-	maxsockets = imax(maxsockets, imax(maxfiles, nmbclusters));
-}
-SYSINIT(param, SI_SUB_TUNABLES, SI_ORDER_ANY, init_maxsockets, NULL);
-
-/*
  * Socket operation routines.  These routines are called by the routines in
  * sys_socket.c or from a system process, and implement the semantics of
  * socket operations by switching out to the protocol specific routines.
@@ -3296,24 +3340,6 @@ socheckuid(struct socket *so, uid_t uid)
 	return (0);
 }
 
-static int
-sysctl_somaxconn(SYSCTL_HANDLER_ARGS)
-{
-	int error;
-	int val;
-
-	val = somaxconn;
-	error = sysctl_handle_int(oidp, &val, 0, req);
-	if (error || !req->newptr )
-		return (error);
-
-	if (val < 1 || val > USHRT_MAX)
-		return (EINVAL);
-
-	somaxconn = val;
-	return (0);
-}
-
 /*
  * These functions are used by protocols to notify the socket layer (and its
  * consumers) of state changes in the sockets driven by protocol-side events.

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 15:28:09 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id BC6A9DBF;
 Mon,  8 Jul 2013 15:28:09 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id ABDA618B1;
 Mon,  8 Jul 2013 15:28:09 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68FS9f3015739;
 Mon, 8 Jul 2013 15:28:09 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68FS9IX015736;
 Mon, 8 Jul 2013 15:28:09 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201307081528.r68FS9IX015736@svn.freebsd.org>
From: Alexander Motin 
Date: Mon, 8 Jul 2013 15:28:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253036 - head/sys/dev/sound/pci/hda
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 15:28:09 -0000

Author: mav
Date: Mon Jul  8 15:28:09 2013
New Revision: 253036
URL: http://svnweb.freebsd.org/changeset/base/253036

Log:
  Add quirk to configure headphones redirection on ASUS UX31A laptop.
  
  MFC after:	3 days

Modified:
  head/sys/dev/sound/pci/hda/hdaa_patches.c
  head/sys/dev/sound/pci/hda/hdac.h

Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c
==============================================================================
--- head/sys/dev/sound/pci/hda/hdaa_patches.c	Mon Jul  8 13:24:18 2013	(r253035)
+++ head/sys/dev/sound/pci/hda/hdaa_patches.c	Mon Jul  8 15:28:09 2013	(r253036)
@@ -368,6 +368,13 @@ hdac_pin_patch(struct hdaa_widget *w)
 			patch = "as=1 seq=15";
 			break;
 		}
+	} else if (id == HDA_CODEC_ALC269 &&
+	    subid == ASUS_UX31A_SUBVENDOR) {
+		switch (nid) {
+		case 33:
+			patch = "as=1 seq=15";
+			break;
+		}
 	}
 
 	if (patch != NULL)

Modified: head/sys/dev/sound/pci/hda/hdac.h
==============================================================================
--- head/sys/dev/sound/pci/hda/hdac.h	Mon Jul  8 13:24:18 2013	(r253035)
+++ head/sys/dev/sound/pci/hda/hdac.h	Mon Jul  8 15:28:09 2013	(r253036)
@@ -198,6 +198,7 @@
 #define ASUS_F3JC_SUBVENDOR	HDA_MODEL_CONSTRUCT(ASUS, 0x1338)
 #define ASUS_G2K_SUBVENDOR	HDA_MODEL_CONSTRUCT(ASUS, 0x1339)
 #define ASUS_A7T_SUBVENDOR	HDA_MODEL_CONSTRUCT(ASUS, 0x13c2)
+#define ASUS_UX31A_SUBVENDOR	HDA_MODEL_CONSTRUCT(ASUS, 0x1517)
 #define ASUS_W2J_SUBVENDOR	HDA_MODEL_CONSTRUCT(ASUS, 0x1971)
 #define ASUS_M5200_SUBVENDOR	HDA_MODEL_CONSTRUCT(ASUS, 0x1993)
 #define ASUS_P5PL2_SUBVENDOR	HDA_MODEL_CONSTRUCT(ASUS, 0x817f)

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 15:54:44 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 07D70309;
 Mon,  8 Jul 2013 15:54:44 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id DCD7919C1;
 Mon,  8 Jul 2013 15:54:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68FshFD023937;
 Mon, 8 Jul 2013 15:54:43 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68Fscuf023906;
 Mon, 8 Jul 2013 15:54:38 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201307081554.r68Fscuf023906@svn.freebsd.org>
From: Alexander Motin 
Date: Mon, 8 Jul 2013 15:54:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253037 - in stable/9/sys: cam cam/ata cam/ctl cam/scsi
 dev/aac dev/arcmsr dev/ata dev/ciss dev/firewire dev/hpt27xx dev/hptiop
 dev/hptrr dev/isci dev/iscsi/initiator dev/isp dev/mfi de...
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 15:54:44 -0000

Author: mav
Date: Mon Jul  8 15:54:38 2013
New Revision: 253037
URL: http://svnweb.freebsd.org/changeset/base/253037

Log:
  MFC r249468:
  Stop abusing xpt_periph in random plases that really have no periph related
  to CCB, for example, bus scanning.  NULL value is fine in such cases and it
  is correctly logged in debug messages as "noperiph".  If at some point we
  need some real XPT periphs (alike to pmpX now), quite likely they will be
  per-bus, and not a single global instance as xpt_periph now.

Modified:
  stable/9/sys/cam/ata/ata_xpt.c
  stable/9/sys/cam/cam_xpt.c
  stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c
  stable/9/sys/cam/scsi/scsi_xpt.c
  stable/9/sys/dev/aac/aac_cam.c
  stable/9/sys/dev/arcmsr/arcmsr.c
  stable/9/sys/dev/ata/atapi-cam.c
  stable/9/sys/dev/ciss/ciss.c
  stable/9/sys/dev/firewire/sbp.c
  stable/9/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
  stable/9/sys/dev/hptiop/hptiop.c
  stable/9/sys/dev/hptrr/hptrr_osm_bsd.c
  stable/9/sys/dev/isci/isci_controller.c
  stable/9/sys/dev/isci/isci_domain.c
  stable/9/sys/dev/isci/isci_remote_device.c
  stable/9/sys/dev/iscsi/initiator/isc_cam.c
  stable/9/sys/dev/isp/isp_freebsd.c
  stable/9/sys/dev/mfi/mfi_cam.c
  stable/9/sys/dev/mly/mly.c
  stable/9/sys/dev/mps/mps_sas.c
  stable/9/sys/dev/mpt/mpt_cam.c
  stable/9/sys/dev/mpt/mpt_raid.c
  stable/9/sys/dev/twa/tw_osl_cam.c
  stable/9/sys/dev/tws/tws_cam.c
  stable/9/sys/dev/virtio/scsi/virtio_scsi.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/isp/   (props changed)

Modified: stable/9/sys/cam/ata/ata_xpt.c
==============================================================================
--- stable/9/sys/cam/ata/ata_xpt.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/cam/ata/ata_xpt.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -1445,7 +1445,7 @@ done:
 		scan_info->counter = (scan_info->counter + 1 ) %
 		    (scan_info->cpi->max_target + 1);
 scan_next:
-		status = xpt_create_path(&path, xpt_periph,
+		status = xpt_create_path(&path, NULL,
 		    scan_info->request_ccb->ccb_h.path_id,
 		    scan_info->counter, 0);
 		if (status != CAM_REQ_CMP) {
@@ -1503,7 +1503,7 @@ ata_scan_lun(struct cam_periph *periph, 
 			    "can't continue\n");
 			return;
 		}
-		status = xpt_create_path(&new_path, xpt_periph,
+		status = xpt_create_path(&new_path, NULL,
 					  path->bus->path_id,
 					  path->target->target_id,
 					  path->device->lun_id);

Modified: stable/9/sys/cam/cam_xpt.c
==============================================================================
--- stable/9/sys/cam/cam_xpt.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/cam/cam_xpt.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -497,7 +497,7 @@ xptdoioctl(struct cdev *dev, u_long cmd,
 			 * Create a path using the bus, target, and lun the
 			 * user passed in.
 			 */
-			if (xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+			if (xpt_create_path(&ccb->ccb_h.path, NULL,
 					    inccb->ccb_h.path_id,
 					    inccb->ccb_h.target_id,
 					    inccb->ccb_h.target_lun) !=
@@ -533,7 +533,7 @@ xptdoioctl(struct cdev *dev, u_long cmd,
 			 * Create a path using the bus, target, and lun the
 			 * user passed in.
 			 */
-			if (xpt_create_path(&ccb.ccb_h.path, xpt_periph,
+			if (xpt_create_path(&ccb.ccb_h.path, NULL,
 					    inccb->ccb_h.path_id,
 					    inccb->ccb_h.target_id,
 					    inccb->ccb_h.target_lun) !=
@@ -3062,7 +3062,7 @@ xpt_action_default(union ccb *start_ccb)
 			CAM_SIM_LOCK(xpt_path_sim(start_ccb->ccb_h.path));
 		}
 		if (start_ccb->cdbg.flags != CAM_DEBUG_NONE) {
-			if (xpt_create_path(&cam_dpath, xpt_periph,
+			if (xpt_create_path(&cam_dpath, NULL,
 					    start_ccb->ccb_h.path_id,
 					    start_ccb->ccb_h.target_id,
 					    start_ccb->ccb_h.target_lun) !=
@@ -4862,7 +4862,7 @@ xpt_config(void *arg)
 
 	/* Setup debugging path */
 	if (cam_dflags != CAM_DEBUG_NONE) {
-		if (xpt_create_path_unlocked(&cam_dpath, xpt_periph,
+		if (xpt_create_path_unlocked(&cam_dpath, NULL,
 				    CAM_DEBUG_BUS, CAM_DEBUG_TARGET,
 				    CAM_DEBUG_LUN) != CAM_REQ_CMP) {
 			printf("xpt_config: xpt_create_path() failed for debug"

Modified: stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c
==============================================================================
--- stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -316,7 +316,7 @@ cfcs_onoffline(void *arg, int online)
 		goto bailout;
 	}
 
-	if (xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+	if (xpt_create_path(&ccb->ccb_h.path, NULL,
 			    cam_sim_path(softc->sim), CAM_TARGET_WILDCARD,
 			    CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 		printf("%s: can't allocate path for rescan\n", __func__);

Modified: stable/9/sys/cam/scsi/scsi_xpt.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_xpt.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/cam/scsi/scsi_xpt.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -1934,7 +1934,7 @@ scsi_scan_bus(struct cam_periph *periph,
 			if (i == initiator_id)
 				continue;
 
-			status = xpt_create_path(&path, xpt_periph,
+			status = xpt_create_path(&path, NULL,
 						 request_ccb->ccb_h.path_id,
 						 i, 0);
 			if (status != CAM_REQ_CMP) {
@@ -2135,7 +2135,7 @@ scsi_scan_bus(struct cam_periph *periph,
 				xpt_free_ccb(request_ccb);
 				break;
 			}
-			status = xpt_create_path(&path, xpt_periph,
+			status = xpt_create_path(&path, NULL,
 			    scan_info->request_ccb->ccb_h.path_id,
 			    scan_info->counter, 0);
 			if (status != CAM_REQ_CMP) {
@@ -2158,7 +2158,7 @@ scsi_scan_bus(struct cam_periph *periph,
 			request_ccb->crcn.flags =
 			    scan_info->request_ccb->crcn.flags;
 		} else {
-			status = xpt_create_path(&path, xpt_periph,
+			status = xpt_create_path(&path, NULL,
 						 path_id, target_id, lun_id);
 			/*
 			 * Free the old request path- we're done with it. We
@@ -2231,7 +2231,7 @@ scsi_scan_lun(struct cam_periph *periph,
 			    "can't continue\n");
 			return;
 		}
-		status = xpt_create_path(&new_path, xpt_periph,
+		status = xpt_create_path(&new_path, NULL,
 					  path->bus->path_id,
 					  path->target->target_id,
 					  path->device->lun_id);

Modified: stable/9/sys/dev/aac/aac_cam.c
==============================================================================
--- stable/9/sys/dev/aac/aac_cam.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/aac/aac_cam.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -129,7 +129,7 @@ aac_cam_rescan(struct aac_softc *sc, uin
 			return;
 		}
 
-		if (xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+		if (xpt_create_path(&ccb->ccb_h.path, NULL,
 		    cam_sim_path(camsc->sim),
 		    target_id, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 			xpt_free_ccb(ccb);

Modified: stable/9/sys/dev/arcmsr/arcmsr.c
==============================================================================
--- stable/9/sys/dev/arcmsr/arcmsr.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/arcmsr/arcmsr.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -1600,7 +1600,8 @@ static void	arcmsr_rescan_lun(struct Ada
 
 	if ((ccb = (union ccb *)xpt_alloc_ccb_nowait()) == NULL)
  		return;
-	if (xpt_create_path(&path, xpt_periph, cam_sim_path(acb->psim), target, lun) != CAM_REQ_CMP)
+	if (xpt_create_path(&path, NULL, cam_sim_path(acb->psim), target, lun)
+	    != CAM_REQ_CMP)
 	{
 		xpt_free_ccb(ccb);
 		return;

Modified: stable/9/sys/dev/ata/atapi-cam.c
==============================================================================
--- stable/9/sys/dev/ata/atapi-cam.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/ata/atapi-cam.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -825,7 +825,7 @@ cam_rescan(struct cam_sim *sim)
     ccb = xpt_alloc_ccb_nowait();
     if (ccb == NULL)
 	return;
-    if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim),
+    if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sim),
 			CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 	xpt_free_ccb(ccb);
 	return;

Modified: stable/9/sys/dev/ciss/ciss.c
==============================================================================
--- stable/9/sys/dev/ciss/ciss.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/ciss/ciss.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -2913,7 +2913,7 @@ ciss_cam_rescan_target(struct ciss_softc
 	return;
     }
 
-    if (xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+    if (xpt_create_path(&ccb->ccb_h.path, NULL,
 	    cam_sim_path(sc->ciss_cam_sim[bus]),
 	    target, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 	ciss_printf(sc, "rescan failed (can't create path)\n");

Modified: stable/9/sys/dev/firewire/sbp.c
==============================================================================
--- stable/9/sys/dev/firewire/sbp.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/firewire/sbp.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -1086,7 +1086,7 @@ END_DEBUG
 	sbp_xfer_free(xfer);
 
 	if (sdev->path == NULL)
-		xpt_create_path(&sdev->path, xpt_periph,
+		xpt_create_path(&sdev->path, NULL,
 			cam_sim_path(target->sbp->sim),
 			target->target_id, sdev->lun_id);
 
@@ -2039,7 +2039,7 @@ END_DEBUG
 	if (xpt_bus_register(sbp->sim, dev, /*bus*/0) != CAM_SUCCESS)
 		goto fail;
 
-	if (xpt_create_path(&sbp->path, xpt_periph, cam_sim_path(sbp->sim),
+	if (xpt_create_path(&sbp->path, NULL, cam_sim_path(sbp->sim),
 	    CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 		xpt_bus_deregister(cam_sim_path(sbp->sim));
 		goto fail;

Modified: stable/9/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
==============================================================================
--- stable/9/sys/dev/hpt27xx/hpt27xx_osm_bsd.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/hpt27xx/hpt27xx_osm_bsd.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -1347,7 +1347,7 @@ static int	hpt_rescan_bus(void)
 		{
 			return(ENOMEM);
 		}
-		if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(vbus_ext->sim),
+		if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(vbus_ext->sim),
 			CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP)	
 		{
 			xpt_free_ccb(ccb);

Modified: stable/9/sys/dev/hptiop/hptiop.c
==============================================================================
--- stable/9/sys/dev/hptiop/hptiop.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/hptiop/hptiop.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -1437,7 +1437,7 @@ static int  hptiop_rescan_bus(struct hpt
 
 	if ((ccb = xpt_alloc_ccb()) == NULL)
 		return(ENOMEM);
-	if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(hba->sim),
+	if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(hba->sim),
 		CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 		xpt_free_ccb(ccb);
 		return(EIO);

Modified: stable/9/sys/dev/hptrr/hptrr_osm_bsd.c
==============================================================================
--- stable/9/sys/dev/hptrr/hptrr_osm_bsd.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/hptrr/hptrr_osm_bsd.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -1355,7 +1355,7 @@ static int	hpt_rescan_bus(void)
 	ldm_for_each_vbus(vbus, vbus_ext) {
 		if ((ccb = xpt_alloc_ccb()) == NULL)
 			return(ENOMEM);
-		if (xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+		if (xpt_create_path(&ccb->ccb_h.path, NULL,
 		    cam_sim_path(vbus_ext->sim),
 		    CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 			xpt_free_ccb(ccb);

Modified: stable/9/sys/dev/isci/isci_controller.c
==============================================================================
--- stable/9/sys/dev/isci/isci_controller.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/isci/isci_controller.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -539,7 +539,7 @@ void isci_controller_domain_discovery_co
 			 */
 			union ccb *ccb = xpt_alloc_ccb_nowait();
 
-			xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+			xpt_create_path(&ccb->ccb_h.path, NULL,
 			    cam_sim_path(isci_controller->sim),
 			    CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
 

Modified: stable/9/sys/dev/isci/isci_domain.c
==============================================================================
--- stable/9/sys/dev/isci/isci_domain.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/isci/isci_domain.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -300,7 +300,7 @@ scif_cb_domain_device_removed(SCI_CONTRO
 
 	isci_controller->remote_device[isci_remote_device->index] = NULL;
 
-	xpt_create_path(&ccb->ccb_h.path, xpt_periph, path,
+	xpt_create_path(&ccb->ccb_h.path, NULL, path,
 	    isci_remote_device->index, CAM_LUN_WILDCARD);
 
 	xpt_rescan(ccb);

Modified: stable/9/sys/dev/isci/isci_remote_device.c
==============================================================================
--- stable/9/sys/dev/isci/isci_remote_device.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/isci/isci_remote_device.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -83,7 +83,7 @@ scif_cb_remote_device_ready(SCI_CONTROLL
 			 */
 			union ccb *ccb = xpt_alloc_ccb_nowait();
 
-			xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+			xpt_create_path(&ccb->ccb_h.path, NULL,
 			    cam_sim_path(isci_controller->sim),
 			    isci_remote_device->index, CAM_LUN_WILDCARD);
 
@@ -262,7 +262,7 @@ isci_remote_device_freeze_lun_queue(stru
 	if (!(remote_device->frozen_lun_mask & (1 << lun))) {
 		struct cam_path *path;
 
-		xpt_create_path(&path, xpt_periph,
+		xpt_create_path(&path, NULL,
 		    cam_sim_path(remote_device->domain->controller->sim),
 		    remote_device->index, lun);
 		xpt_freeze_devq(path, 1);
@@ -279,7 +279,7 @@ isci_remote_device_release_lun_queue(str
 		struct cam_path *path;
 
 		remote_device->frozen_lun_mask &= ~(1 << lun);
-		xpt_create_path(&path, xpt_periph,
+		xpt_create_path(&path, NULL,
 		    cam_sim_path(remote_device->domain->controller->sim),
 		    remote_device->index, lun);
 		xpt_release_devq(path, 1, TRUE);

Modified: stable/9/sys/dev/iscsi/initiator/isc_cam.c
==============================================================================
--- stable/9/sys/dev/iscsi/initiator/isc_cam.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/iscsi/initiator/isc_cam.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -150,7 +150,7 @@ ic_scan(isc_session_t *sp)
      sp->flags |= ISC_SCANWAIT;
 
      CAM_LOCK(sp);
-     if(xpt_create_path(&sp->cam_path, xpt_periph, cam_sim_path(sp->cam_sim),
+     if(xpt_create_path(&sp->cam_path, NULL, cam_sim_path(sp->cam_sim),
 			0, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 	  xdebug("can't create cam path");
 	  CAM_UNLOCK(sp);

Modified: stable/9/sys/dev/isp/isp_freebsd.c
==============================================================================
--- stable/9/sys/dev/isp/isp_freebsd.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/isp/isp_freebsd.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -4556,7 +4556,8 @@ isp_make_here(ispsoftc_t *isp, int chan,
 		isp_prt(isp, ISP_LOGWARN, "Chan %d unable to alloc CCB for rescan", chan);
 		return;
 	}
-	if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(fc->sim), tgt, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
+	if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(fc->sim),
+	    tgt, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 		isp_prt(isp, ISP_LOGWARN, "unable to create path for rescan");
 		xpt_free_ccb(ccb);
 		return;

Modified: stable/9/sys/dev/mfi/mfi_cam.c
==============================================================================
--- stable/9/sys/dev/mfi/mfi_cam.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/mfi/mfi_cam.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -318,7 +318,7 @@ mfip_cam_rescan(struct mfi_softc *sc, ui
 
 	sim = camsc->sim;
 	mtx_lock(&sc->mfi_io_lock);
-	if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim),
+	if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sim),
 	    tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 		xpt_free_ccb(ccb);
 		mtx_unlock(&sc->mfi_io_lock);

Modified: stable/9/sys/dev/mly/mly.c
==============================================================================
--- stable/9/sys/dev/mly/mly.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/mly/mly.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -2026,7 +2026,7 @@ mly_cam_rescan_btl(struct mly_softc *sc,
 	mly_printf(sc, "rescan failed (can't allocate CCB)\n");
 	return;
     }
-    if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, 
+    if (xpt_create_path(&ccb->ccb_h.path, NULL,
 	    cam_sim_path(sc->mly_cam_sim[bus]), target, 0) != CAM_REQ_CMP) {
 	mly_printf(sc, "rescan failed (can't create path)\n");
 	xpt_free_ccb(ccb);

Modified: stable/9/sys/dev/mps/mps_sas.c
==============================================================================
--- stable/9/sys/dev/mps/mps_sas.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/mps/mps_sas.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -271,7 +271,7 @@ mpssas_rescan_target(struct mps_softc *s
 		return;
 	}
 
-	if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, pathid,
+	if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid,
 		            targetid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 		mps_dprint(sc, MPS_FAULT, "unable to create path for rescan\n");
 		xpt_free_ccb(ccb);
@@ -3318,7 +3318,7 @@ mpssas_check_eedp(struct mpssas_softc *s
 				return;
 			}
 
-			if (xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+			if (xpt_create_path(&ccb->ccb_h.path, NULL,
 			    pathid, targetid, lunid) != CAM_REQ_CMP) {
 				mps_dprint(sc, MPS_FAULT, "Unable to create "
 				    "path for EEDP support\n");

Modified: stable/9/sys/dev/mpt/mpt_cam.c
==============================================================================
--- stable/9/sys/dev/mpt/mpt_cam.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/mpt/mpt_cam.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -2364,7 +2364,7 @@ mpt_cam_event(struct mpt_softc *mpt, req
 			break;
 		}
 
-		if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, pathid,
+		if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid,
 		    CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 			mpt_prt(mpt, "unable to create path for rescan\n");
 			xpt_free_ccb(ccb);
@@ -2512,7 +2512,7 @@ mpt_cam_event(struct mpt_softc *mpt, req
 				    "unable to alloc CCB for rescan\n");
 				break;
 			}
-			if (xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+			if (xpt_create_path(&ccb->ccb_h.path, NULL,
 			    cam_sim_path(sim), psdsc->TargetID,
 			    CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 				mpt_prt(mpt,

Modified: stable/9/sys/dev/mpt/mpt_raid.c
==============================================================================
--- stable/9/sys/dev/mpt/mpt_raid.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/mpt/mpt_raid.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -705,7 +705,7 @@ mpt_raid_thread(void *arg)
 			ccb = xpt_alloc_ccb();
 
 			MPT_LOCK(mpt);
-			error = xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+			error = xpt_create_path(&ccb->ccb_h.path, NULL,
 			    cam_sim_path(mpt->phydisk_sim),
 			    CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD);
 			if (error != CAM_REQ_CMP) {
@@ -1662,7 +1662,7 @@ mpt_raid_set_vol_queue_depth(struct mpt_
 
 		mpt->raid_rescan = 0;
 
-		error = xpt_create_path(&path, xpt_periph,
+		error = xpt_create_path(&path, NULL,
 					cam_sim_path(mpt->sim),
 					mpt_vol->config_page->VolumeID,
 					/*lun*/0);

Modified: stable/9/sys/dev/twa/tw_osl_cam.c
==============================================================================
--- stable/9/sys/dev/twa/tw_osl_cam.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/twa/tw_osl_cam.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -488,7 +488,7 @@ tw_osli_request_bus_scan(struct twa_soft
 	if ((ccb = xpt_alloc_ccb()) == NULL)
 		return(ENOMEM);
 	mtx_lock(sc->sim_lock);
-	if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sc->sim),
+	if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->sim),
 	    CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
 		xpt_free_ccb(ccb);
 		mtx_unlock(sc->sim_lock);

Modified: stable/9/sys/dev/tws/tws_cam.c
==============================================================================
--- stable/9/sys/dev/tws/tws_cam.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/tws/tws_cam.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -221,7 +221,7 @@ tws_bus_scan(struct tws_softc *sc)
     if ((ccb = xpt_alloc_ccb()) == NULL)
 		    return(ENOMEM);
 
-    if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sc->sim),
+    if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(sc->sim),
                   CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
         xpt_free_ccb(ccb);
         return(EIO);

Modified: stable/9/sys/dev/virtio/scsi/virtio_scsi.c
==============================================================================
--- stable/9/sys/dev/virtio/scsi/virtio_scsi.c	Mon Jul  8 15:28:09 2013	(r253036)
+++ stable/9/sys/dev/virtio/scsi/virtio_scsi.c	Mon Jul  8 15:54:38 2013	(r253037)
@@ -1702,7 +1702,7 @@ vtscsi_execute_rescan(struct vtscsi_soft
 		return;
 	}
 
-	status = xpt_create_path(&ccb->ccb_h.path, xpt_periph,
+	status = xpt_create_path(&ccb->ccb_h.path, NULL,
 	    cam_sim_path(sc->vtscsi_sim), target_id, lun_id);
 	if (status != CAM_REQ_CMP) {
 		xpt_free_ccb(ccb);

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 15:59:12 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 09407517;
 Mon,  8 Jul 2013 15:59:12 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id EECEC19F4;
 Mon,  8 Jul 2013 15:59:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68FxBIt024590;
 Mon, 8 Jul 2013 15:59:11 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68FxBxs024589;
 Mon, 8 Jul 2013 15:59:11 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201307081559.r68FxBxs024589@svn.freebsd.org>
From: Alexander Motin 
Date: Mon, 8 Jul 2013 15:59:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253038 - stable/9/sys/cam/ctl
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 15:59:12 -0000

Author: mav
Date: Mon Jul  8 15:59:11 2013
New Revision: 253038
URL: http://svnweb.freebsd.org/changeset/base/253038

Log:
  MFC r252569:
  Fix NULL-deference kernel panic on attempt of destroying non-existing
  ramdisk-backed CTL LUN.

Modified:
  stable/9/sys/cam/ctl/ctl_backend_ramdisk.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/ctl/ctl_backend_ramdisk.c
==============================================================================
--- stable/9/sys/cam/ctl/ctl_backend_ramdisk.c	Mon Jul  8 15:54:38 2013	(r253037)
+++ stable/9/sys/cam/ctl/ctl_backend_ramdisk.c	Mon Jul  8 15:59:11 2013	(r253038)
@@ -441,6 +441,9 @@ ctl_backend_ramdisk_rm(struct ctl_be_ram
 		snprintf(req->error_str, sizeof(req->error_str),
 			 "%s: error %d returned from ctl_invalidate_lun() for "
 			 "LUN %d", __func__, retval, params->lun_id);
+		mtx_lock(&softc->lock);
+		be_lun->flags &= ~CTL_BE_RAMDISK_LUN_WAITING;
+		mtx_unlock(&softc->lock);
 		goto bailout_error;
 	}
 
@@ -475,14 +478,6 @@ ctl_backend_ramdisk_rm(struct ctl_be_ram
 	return (retval);
 
 bailout_error:
-
-	/*
-	 * Don't leave the waiting flag set.
-	 */
-	mtx_lock(&softc->lock);
-	be_lun->flags &= ~CTL_BE_RAMDISK_LUN_WAITING;
-	mtx_unlock(&softc->lock);
-
 	req->status = CTL_LUN_ERROR;
 
 	return (0);

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 16:02:04 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 256D67AC;
 Mon,  8 Jul 2013 16:02:04 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 167911A24;
 Mon,  8 Jul 2013 16:02:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68G23ic026882;
 Mon, 8 Jul 2013 16:02:03 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68G23Ai026881;
 Mon, 8 Jul 2013 16:02:03 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201307081602.r68G23Ai026881@svn.freebsd.org>
From: Alexander Motin 
Date: Mon, 8 Jul 2013 16:02:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253039 - stable/9/sys/cam/scsi
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 16:02:04 -0000

Author: mav
Date: Mon Jul  8 16:02:03 2013
New Revision: 253039
URL: http://svnweb.freebsd.org/changeset/base/253039

Log:
  MFC r252204, r252250:
  Add bunch of names for Seagate and HGST vennor-specififc ASC/ASCQ codes.

Modified:
  stable/9/sys/cam/scsi/scsi_all.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_all.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_all.c	Mon Jul  8 15:59:11 2013	(r253038)
+++ stable/9/sys/cam/scsi/scsi_all.c	Mon Jul  8 16:02:03 2013	(r253039)
@@ -737,6 +737,172 @@ static struct asc_table_entry sony_mo_en
 	     "Logical unit not ready, cause not reportable") }
 };
 
+static struct asc_table_entry hgst_entries[] = {
+	{ SST(0x04, 0xF0, SS_RDEF,
+	    "Vendor Unique - Logical Unit Not Ready") },
+	{ SST(0x0A, 0x01, SS_RDEF,
+	    "Unrecovered Super Certification Log Write Error") },
+	{ SST(0x0A, 0x02, SS_RDEF,
+	    "Unrecovered Super Certification Log Read Error") },
+	{ SST(0x15, 0x03, SS_RDEF,
+	    "Unrecovered Sector Error") },
+	{ SST(0x3E, 0x04, SS_RDEF,
+	    "Unrecovered Self-Test Hard-Cache Test Fail") },
+	{ SST(0x3E, 0x05, SS_RDEF,
+	    "Unrecovered Self-Test OTF-Cache Fail") },
+	{ SST(0x40, 0x00, SS_RDEF,
+	    "Unrecovered SAT No Buffer Overflow Error") },
+	{ SST(0x40, 0x01, SS_RDEF,
+	    "Unrecovered SAT Buffer Overflow Error") },
+	{ SST(0x40, 0x02, SS_RDEF,
+	    "Unrecovered SAT No Buffer Overflow With ECS Fault") },
+	{ SST(0x40, 0x03, SS_RDEF,
+	    "Unrecovered SAT Buffer Overflow With ECS Fault") },
+	{ SST(0x40, 0x81, SS_RDEF,
+	    "DRAM Failure") },
+	{ SST(0x44, 0x0B, SS_RDEF,
+	    "Vendor Unique - Internal Target Failure") },
+	{ SST(0x44, 0xF2, SS_RDEF,
+	    "Vendor Unique - Internal Target Failure") },
+	{ SST(0x44, 0xF6, SS_RDEF,
+	    "Vendor Unique - Internal Target Failure") },
+	{ SST(0x44, 0xF9, SS_RDEF,
+	    "Vendor Unique - Internal Target Failure") },
+	{ SST(0x44, 0xFA, SS_RDEF,
+	    "Vendor Unique - Internal Target Failure") },
+	{ SST(0x5D, 0x22, SS_RDEF,
+	    "Extreme Over-Temperature Warning") },
+	{ SST(0x5D, 0x50, SS_RDEF,
+	    "Load/Unload cycle Count Warning") },
+	{ SST(0x81, 0x00, SS_RDEF,
+	    "Vendor Unique - Internal Logic Error") },
+	{ SST(0x85, 0x00, SS_RDEF,
+	    "Vendor Unique - Internal Key Seed Error") },
+};
+
+static struct asc_table_entry seagate_entries[] = {
+	{ SST(0x04, 0xF0, SS_RDEF,
+	    "Logical Unit Not Ready, super certify in Progress") },
+	{ SST(0x08, 0x86, SS_RDEF,
+	    "Write Fault Data Corruption") },
+	{ SST(0x09, 0x0D, SS_RDEF,
+	    "Tracking Failure") },
+	{ SST(0x09, 0x0E, SS_RDEF,
+	    "ETF Failure") },
+	{ SST(0x0B, 0x5D, SS_RDEF,
+	    "Pre-SMART Warning") },
+	{ SST(0x0B, 0x85, SS_RDEF,
+	    "5V Voltage Warning") },
+	{ SST(0x0B, 0x8C, SS_RDEF,
+	    "12V Voltage Warning") },
+	{ SST(0x0C, 0xFF, SS_RDEF,
+	    "Write Error - Too many error recovery revs") },
+	{ SST(0x11, 0xFF, SS_RDEF,
+	    "Unrecovered Read Error - Too many error recovery revs") },
+	{ SST(0x19, 0x0E, SS_RDEF,
+	    "Fewer than 1/2 defect list copies") },
+	{ SST(0x20, 0xF3, SS_RDEF,
+	    "Illegal CDB linked to skip mask cmd") },
+	{ SST(0x24, 0xF0, SS_RDEF,
+	    "Illegal byte in CDB, LBA not matching") },
+	{ SST(0x24, 0xF1, SS_RDEF,
+	    "Illegal byte in CDB, LEN not matching") },
+	{ SST(0x24, 0xF2, SS_RDEF,
+	    "Mask not matching transfer length") },
+	{ SST(0x24, 0xF3, SS_RDEF,
+	    "Drive formatted without plist") },
+	{ SST(0x26, 0x95, SS_RDEF,
+	    "Invalid Field Parameter - CAP File") },
+	{ SST(0x26, 0x96, SS_RDEF,
+	    "Invalid Field Parameter - RAP File") },
+	{ SST(0x26, 0x97, SS_RDEF,
+	    "Invalid Field Parameter - TMS Firmware Tag") },
+	{ SST(0x26, 0x98, SS_RDEF,
+	    "Invalid Field Parameter - Check Sum") },
+	{ SST(0x26, 0x99, SS_RDEF,
+	    "Invalid Field Parameter - Firmware Tag") },
+	{ SST(0x29, 0x08, SS_RDEF,
+	    "Write Log Dump data") },
+	{ SST(0x29, 0x09, SS_RDEF,
+	    "Write Log Dump data") },
+	{ SST(0x29, 0x0A, SS_RDEF,
+	    "Reserved disk space") },
+	{ SST(0x29, 0x0B, SS_RDEF,
+	    "SDBP") },
+	{ SST(0x29, 0x0C, SS_RDEF,
+	    "SDBP") },
+	{ SST(0x31, 0x91, SS_RDEF,
+	    "Format Corrupted World Wide Name (WWN) is Invalid") },
+	{ SST(0x32, 0x03, SS_RDEF,
+	    "Defect List - Length exceeds Command Allocated Length") },
+	{ SST(0x33, 0x00, SS_RDEF,
+	    "Flash not ready for access") },
+	{ SST(0x3F, 0x70, SS_RDEF,
+	    "Invalid RAP block") },
+	{ SST(0x3F, 0x71, SS_RDEF,
+	    "RAP/ETF mismatch") },
+	{ SST(0x3F, 0x90, SS_RDEF,
+	    "Invalid CAP block") },
+	{ SST(0x3F, 0x91, SS_RDEF,
+	    "World Wide Name (WWN) Mismatch") },
+	{ SST(0x40, 0x01, SS_RDEF,
+	    "DRAM Parity Error") },
+	{ SST(0x40, 0x02, SS_RDEF,
+	    "DRAM Parity Error") },
+	{ SST(0x42, 0x0A, SS_RDEF,
+	    "Loopback Test") },
+	{ SST(0x42, 0x0B, SS_RDEF,
+	    "Loopback Test") },
+	{ SST(0x44, 0xF2, SS_RDEF,
+	    "Compare error during data integrity check") },
+	{ SST(0x44, 0xF6, SS_RDEF,
+	    "Unrecoverable error during data integrity check") },
+	{ SST(0x47, 0x80, SS_RDEF,
+	    "Fibre Channel Sequence Error") },
+	{ SST(0x4E, 0x01, SS_RDEF,
+	    "Information Unit Too Short") },
+	{ SST(0x80, 0x00, SS_RDEF,
+	    "General Firmware Error / Command Timeout") },
+	{ SST(0x80, 0x01, SS_RDEF,
+	    "Command Timeout") },
+	{ SST(0x80, 0x02, SS_RDEF,
+	    "Command Timeout") },
+	{ SST(0x80, 0x80, SS_RDEF,
+	    "FC FIFO Error During Read Transfer") },
+	{ SST(0x80, 0x81, SS_RDEF,
+	    "FC FIFO Error During Write Transfer") },
+	{ SST(0x80, 0x82, SS_RDEF,
+	    "DISC FIFO Error During Read Transfer") },
+	{ SST(0x80, 0x83, SS_RDEF,
+	    "DISC FIFO Error During Write Transfer") },
+	{ SST(0x80, 0x84, SS_RDEF,
+	    "LBA Seeded LRC Error on Read") },
+	{ SST(0x80, 0x85, SS_RDEF,
+	    "LBA Seeded LRC Error on Write") },
+	{ SST(0x80, 0x86, SS_RDEF,
+	    "IOEDC Error on Read") },
+	{ SST(0x80, 0x87, SS_RDEF,
+	    "IOEDC Error on Write") },
+	{ SST(0x80, 0x88, SS_RDEF,
+	    "Host Parity Check Failed") },
+	{ SST(0x80, 0x89, SS_RDEF,
+	    "IOEDC error on read detected by formatter") },
+	{ SST(0x80, 0x8A, SS_RDEF,
+	    "Host Parity Errors / Host FIFO Initialization Failed") },
+	{ SST(0x80, 0x8B, SS_RDEF,
+	    "Host Parity Errors") },
+	{ SST(0x80, 0x8C, SS_RDEF,
+	    "Host Parity Errors") },
+	{ SST(0x80, 0x8D, SS_RDEF,
+	    "Host Parity Errors") },
+	{ SST(0x81, 0x00, SS_RDEF,
+	    "LA Check Failed") },
+	{ SST(0x82, 0x00, SS_RDEF,
+	    "Internal client detected insufficient buffer") },
+	{ SST(0x84, 0x00, SS_RDEF,
+	    "Scheduled Diagnostic And Repair") },
+};
+
 static struct scsi_sense_quirk_entry sense_quirk_table[] = {
 	{
 		/*
@@ -759,6 +925,26 @@ static struct scsi_sense_quirk_entry sen
 		sizeof(sony_mo_entries)/sizeof(struct asc_table_entry),
 		/*sense key entries*/NULL,
 		sony_mo_entries
+	},
+	{
+		/*
+		 * HGST vendor-specific error codes
+		 */
+		{T_DIRECT, SIP_MEDIA_FIXED, "HGST", "*", "*"},
+		/*num_sense_keys*/0,
+		sizeof(hgst_entries)/sizeof(struct asc_table_entry),
+		/*sense key entries*/NULL,
+		hgst_entries
+	},
+	{
+		/*
+		 * SEAGATE vendor-specific error codes
+		 */
+		{T_DIRECT, SIP_MEDIA_FIXED, "SEAGATE", "*", "*"},
+		/*num_sense_keys*/0,
+		sizeof(seagate_entries)/sizeof(struct asc_table_entry),
+		/*sense key entries*/NULL,
+		seagate_entries
 	}
 };
 

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 16:03:19 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 45AA78E4;
 Mon,  8 Jul 2013 16:03:19 +0000 (UTC)
 (envelope-from hiren@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 36E831A2D;
 Mon,  8 Jul 2013 16:03:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68G3J4h027102;
 Mon, 8 Jul 2013 16:03:19 GMT (envelope-from hiren@svn.freebsd.org)
Received: (from hiren@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68G3Jm7027100;
 Mon, 8 Jul 2013 16:03:19 GMT (envelope-from hiren@svn.freebsd.org)
Message-Id: <201307081603.r68G3Jm7027100@svn.freebsd.org>
From: Hiren Panchasara 
Date: Mon, 8 Jul 2013 16:03:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253040 - head/contrib/wpa/src/rsn_supp
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 16:03:19 -0000

Author: hiren
Date: Mon Jul  8 16:03:18 2013
New Revision: 253040
URL: http://svnweb.freebsd.org/changeset/base/253040

Log:
  Move to MSG_DEBUG to print it via syslog only when requested.
  
  Reviewed by:	rpaulo, adrian
  Approved by:	sbruno (mentor)

Modified:
  head/contrib/wpa/src/rsn_supp/wpa.c

Modified: head/contrib/wpa/src/rsn_supp/wpa.c
==============================================================================
--- head/contrib/wpa/src/rsn_supp/wpa.c	Mon Jul  8 16:02:03 2013	(r253039)
+++ head/contrib/wpa/src/rsn_supp/wpa.c	Mon Jul  8 16:03:18 2013	(r253040)
@@ -1348,7 +1348,7 @@ static void wpa_supplicant_process_1_of_
 		goto failed;
 
 	if (rekey) {
-		wpa_msg(sm->ctx->msg_ctx, MSG_INFO, "WPA: Group rekeying "
+		wpa_msg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Group rekeying "
 			"completed with " MACSTR " [GTK=%s]",
 			MAC2STR(sm->bssid), wpa_cipher_txt(sm->group_cipher));
 		wpa_sm_cancel_auth_timeout(sm);

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 17:20:05 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 8FDD5BE2;
 Mon,  8 Jul 2013 17:20:05 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 808411DB1;
 Mon,  8 Jul 2013 17:20:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68HK5kR048859;
 Mon, 8 Jul 2013 17:20:05 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68HK5Sk048858;
 Mon, 8 Jul 2013 17:20:05 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201307081720.r68HK5Sk048858@svn.freebsd.org>
From: Alexander Motin 
Date: Mon, 8 Jul 2013 17:20:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253041 - stable/9/sys/dev/ata/chipsets
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 17:20:05 -0000

Author: mav
Date: Mon Jul  8 17:20:05 2013
New Revision: 253041
URL: http://svnweb.freebsd.org/changeset/base/253041

Log:
  MFC r252203:
  Add test for SATA registers writability and skip using them if it failed.
  
  There are some systems reported, where PCI BAR(5), used for SATA registers
  access, is present, but not functional.  Attempt to use it brakes devices
  detection logic.  Try to detect those cases on attach by setting and testing
  some bits in SControl register.  If bits are unsettable, fallback to legacy
  ATA without hot-plug detection, speed control/reporting, etc.

Modified:
  stable/9/sys/dev/ata/chipsets/ata-intel.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/ata/chipsets/ata-intel.c
==============================================================================
--- stable/9/sys/dev/ata/chipsets/ata-intel.c	Mon Jul  8 16:03:18 2013	(r253040)
+++ stable/9/sys/dev/ata/chipsets/ata-intel.c	Mon Jul  8 17:20:05 2013	(r253041)
@@ -73,6 +73,7 @@ static int ata_intel_sata_cscr_write(dev
     int reg, u_int32_t result);
 static int ata_intel_sata_sidpr_write(device_t dev, int port,
     int reg, u_int32_t result);
+static int ata_intel_sata_sidpr_test(device_t dev);
 static int ata_intel_31244_ch_attach(device_t dev);
 static int ata_intel_31244_ch_detach(device_t dev);
 static int ata_intel_31244_status(device_t dev);
@@ -417,22 +418,20 @@ ata_intel_ch_attach(device_t dev)
 		}
 		if (ch->flags & ATA_SATA) {
 			if ((ctlr->chip->cfg1 & INTEL_ICH5)) {
-				ch->flags |= ATA_PERIODIC_POLL;
-				ch->hw.status = ata_intel_sata_status;
 				ch->hw.pm_read = ata_intel_sata_cscr_read;
 				ch->hw.pm_write = ata_intel_sata_cscr_write;
 			} else if (ctlr->r_res2) {
-				ch->flags |= ATA_PERIODIC_POLL;
-				ch->hw.status = ata_intel_sata_status;
 				if ((ctlr->chip->cfg1 & INTEL_ICH7)) {
 					ch->hw.pm_read = ata_intel_sata_ahci_read;
 					ch->hw.pm_write = ata_intel_sata_ahci_write;
-				} else {
+				} else if (ata_intel_sata_sidpr_test(dev)) {
 					ch->hw.pm_read = ata_intel_sata_sidpr_read;
 					ch->hw.pm_write = ata_intel_sata_sidpr_write;
 				};
 			}
 			if (ch->hw.pm_write != NULL) {
+				ch->flags |= ATA_PERIODIC_POLL;
+				ch->hw.status = ata_intel_sata_status;
 				ata_sata_scr_write(ch, 0,
 				    ATA_SERROR, 0xffffffff);
 				if ((ch->flags & ATA_NO_SLAVE) == 0) {
@@ -836,6 +835,32 @@ ata_intel_sata_sidpr_write(device_t dev,
 }
 
 static int
+ata_intel_sata_sidpr_test(device_t dev)
+{
+	struct ata_channel *ch = device_get_softc(dev);
+	int port;
+	uint32_t val;
+
+	port = (ch->flags & ATA_NO_SLAVE) ? 0 : 1;
+	for (; port >= 0; port--) {
+		ata_intel_sata_sidpr_read(dev, port, ATA_SCONTROL, &val);
+		if ((val & ATA_SC_IPM_MASK) ==
+		    (ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER))
+			return (1);
+		val |= ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER;
+		ata_intel_sata_sidpr_write(dev, port, ATA_SCONTROL, val);
+		ata_intel_sata_sidpr_read(dev, port, ATA_SCONTROL, &val);
+		if ((val & ATA_SC_IPM_MASK) ==
+		    (ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER))
+			return (1);
+	}
+	if (bootverbose)
+		device_printf(dev,
+		    "SControl registers are not functional: %08x\n", val);
+	return (0);
+}
+
+static int
 ata_intel_31244_ch_attach(device_t dev)
 {
     struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 17:57:12 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 09F6C56A;
 Mon,  8 Jul 2013 17:57:12 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id EEF601F0B;
 Mon,  8 Jul 2013 17:57:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68HvBsg059786;
 Mon, 8 Jul 2013 17:57:11 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68HvB2i059785;
 Mon, 8 Jul 2013 17:57:11 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201307081757.r68HvB2i059785@svn.freebsd.org>
From: Dimitry Andric 
Date: Mon, 8 Jul 2013 17:57:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253042 - head/contrib/llvm/lib/CodeGen/SelectionDAG
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 17:57:12 -0000

Author: dim
Date: Mon Jul  8 17:57:11 2013
New Revision: 253042
URL: http://svnweb.freebsd.org/changeset/base/253042

Log:
  Pull in r185616 from llvm trunk:
  
    FastISel can only append to basic blocks.
  
    Compute the insertion point from the end of the basic block instead of
    skipping labels from the front.
  
    This caused failures in landing pads when live-in copies where inserted
    before instruction selection.
  
  I missed this change in r252720; without it, certain compilation flags
  can cause exception labels to not be generated, but still referenced,
  leading to link errors.
  
  Reported by:	zeising
  MFC after:	3 days

Modified:
  head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp

Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
==============================================================================
--- head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp	Mon Jul  8 17:20:05 2013	(r253041)
+++ head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp	Mon Jul  8 17:57:11 2013	(r253042)
@@ -75,15 +75,12 @@ STATISTIC(NumFastIselDead, "Number of de
 void FastISel::startNewBlock() {
   LocalValueMap.clear();
 
+  // Instructions are appended to FuncInfo.MBB. If the basic block already
+  // contains labels or copies, use the last instruction as the last local
+  // value.
   EmitStartPt = 0;
-
-  // Advance the emit start point past any EH_LABEL instructions.
-  MachineBasicBlock::iterator
-    I = FuncInfo.MBB->begin(), E = FuncInfo.MBB->end();
-  while (I != E && I->getOpcode() == TargetOpcode::EH_LABEL) {
-    EmitStartPt = I;
-    ++I;
-  }
+  if (!FuncInfo.MBB->empty())
+    EmitStartPt = &FuncInfo.MBB->back();
   LastLocalValue = EmitStartPt;
 }
 

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 20:21:36 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id CC6BF35F;
 Mon,  8 Jul 2013 20:21:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id BE9261791;
 Mon,  8 Jul 2013 20:21:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68KLaAg005031;
 Mon, 8 Jul 2013 20:21:36 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68KLanT005030;
 Mon, 8 Jul 2013 20:21:36 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201307082021.r68KLanT005030@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Mon, 8 Jul 2013 20:21:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253045 - head/sys/fs/ext2fs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 20:21:36 -0000

Author: pfg
Date: Mon Jul  8 20:21:36 2013
New Revision: 253045
URL: http://svnweb.freebsd.org/changeset/base/253045

Log:
  Avoid a panic and return EINVAL instead.
  
  Merge from UFS r232692:
  syscall() fuzzing can trigger this panic.
  
  MFC after:	3 days

Modified:
  head/sys/fs/ext2fs/ext2_vnops.c

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vnops.c	Mon Jul  8 19:40:50 2013	(r253044)
+++ head/sys/fs/ext2fs/ext2_vnops.c	Mon Jul  8 20:21:36 2013	(r253045)
@@ -1598,11 +1598,11 @@ ext2_read(struct vop_read_args *ap)
 	} else if (vp->v_type != VREG && vp->v_type != VDIR)
 		panic("%s: type %d", "ext2_read", vp->v_type);
 #endif
+	if (uio->uio_resid < 0 || uio->uio_offset < 0)
+		return (EINVAL);
 	orig_resid = uio->uio_resid;
-	KASSERT(orig_resid >= 0, ("ext2_read: uio->uio_resid < 0"));
 	if (orig_resid == 0)
 		return (0);
-	KASSERT(uio->uio_offset >= 0, ("ext2_read: uio->uio_offset < 0"));
 	fs = ip->i_e2fs;
 	if (uio->uio_offset < ip->i_size &&
 	    uio->uio_offset >= fs->e2fs_maxfilesize)

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 21:10:30 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 94A04CA3;
 Mon,  8 Jul 2013 21:10:30 +0000 (UTC)
 (envelope-from asomers@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 86B491950;
 Mon,  8 Jul 2013 21:10:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68LAUZ4019788;
 Mon, 8 Jul 2013 21:10:30 GMT (envelope-from asomers@svn.freebsd.org)
Received: (from asomers@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68LAUNu019787;
 Mon, 8 Jul 2013 21:10:30 GMT (envelope-from asomers@svn.freebsd.org)
Message-Id: <201307082110.r68LAUNu019787@svn.freebsd.org>
From: Alan Somers 
Date: Mon, 8 Jul 2013 21:10:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253046 - head/sbin/devd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 21:10:30 -0000

Author: asomers
Date: Mon Jul  8 21:10:30 2013
New Revision: 253046
URL: http://svnweb.freebsd.org/changeset/base/253046

Log:
  Correct the printf format specifier for total_events.
  Add __printflike argument checking for devdlog().
  
  Reported by: pjd
  Approved by: gibbs (co-mentor)

Modified:
  head/sbin/devd/devd.cc

Modified: head/sbin/devd/devd.cc
==============================================================================
--- head/sbin/devd/devd.cc	Mon Jul  8 20:21:36 2013	(r253045)
+++ head/sbin/devd/devd.cc	Mon Jul  8 21:10:30 2013	(r253046)
@@ -124,7 +124,8 @@ static volatile sig_atomic_t romeo_must_
 
 static const char *configfile = CF;
 
-static void devdlog(int priority, const char* message, ...);
+static void devdlog(int priority, const char* message, ...)
+	__printflike(2, 3);
 static void event_loop(void);
 static void usage(void);
 
@@ -969,7 +970,7 @@ event_loop(void)
 		}
 		rv = select(max_fd, &fds, NULL, NULL, &tv);
 		if (got_siginfo) {
-			devdlog(LOG_INFO, "Events received so far=%ld\n",
+			devdlog(LOG_INFO, "Events received so far=%u\n",
 			    total_events);
 			got_siginfo = 0;
 		}

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 21:17:21 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 36E2FC4;
 Mon,  8 Jul 2013 21:17:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 297191996;
 Mon,  8 Jul 2013 21:17:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68LHLET020936;
 Mon, 8 Jul 2013 21:17:21 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68LHL9O020935;
 Mon, 8 Jul 2013 21:17:21 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201307082117.r68LHL9O020935@svn.freebsd.org>
From: John Baldwin 
Date: Mon, 8 Jul 2013 21:17:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253047 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 21:17:21 -0000

Author: jhb
Date: Mon Jul  8 21:17:20 2013
New Revision: 253047
URL: http://svnweb.freebsd.org/changeset/base/253047

Log:
  Fix build with INVARIANT_SUPPORT enabled but not INVARIANTS.
  
  Reported by:	"Matthew D. Fuller" 

Modified:
  head/sys/kern/kern_rmlock.c

Modified: head/sys/kern/kern_rmlock.c
==============================================================================
--- head/sys/kern/kern_rmlock.c	Mon Jul  8 21:10:30 2013	(r253046)
+++ head/sys/kern/kern_rmlock.c	Mon Jul  8 21:17:20 2013	(r253047)
@@ -704,6 +704,10 @@ _rm_runlock_debug(struct rmlock *rm, str
 #endif
 
 #ifdef INVARIANT_SUPPORT
+#ifndef INVARIANTS
+#undef _rm_assert
+#endif
+
 /*
  * Note that this does not need to use witness_assert() for read lock
  * assertions since an exact count of read locks held by this thread

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 21:25:13 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 91345536;
 Mon,  8 Jul 2013 21:25:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 692A219F9;
 Mon,  8 Jul 2013 21:25:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r68LPDeS023496;
 Mon, 8 Jul 2013 21:25:13 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r68LPDlY023493;
 Mon, 8 Jul 2013 21:25:13 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201307082125.r68LPDlY023493@svn.freebsd.org>
From: John Baldwin 
Date: Mon, 8 Jul 2013 21:25:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253048 - in head/sys/ofed: drivers/net/mlx4 include/linux
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 21:25:13 -0000

Author: jhb
Date: Mon Jul  8 21:25:12 2013
New Revision: 253048
URL: http://svnweb.freebsd.org/changeset/base/253048

Log:
  Allow mlx4 devices to switch from Ethernet to Infiniband (and vice versa):
  - Fix sysctl wrapper for sysfs attributes to properly handle new string
    values similar to sysctl_handle_string() (only copyin the user's
    supplied length and nul-terminate the string).
  - Don't check for a trailing newline when evaluating the desired operating
    mode of a mlx4 device.
  
  PR:		kern/179999
  Submitted by:	Shahar Klein 
  MFC after:	1 week

Modified:
  head/sys/ofed/drivers/net/mlx4/main.c
  head/sys/ofed/include/linux/sysfs.h

Modified: head/sys/ofed/drivers/net/mlx4/main.c
==============================================================================
--- head/sys/ofed/drivers/net/mlx4/main.c	Mon Jul  8 21:17:20 2013	(r253047)
+++ head/sys/ofed/drivers/net/mlx4/main.c	Mon Jul  8 21:25:12 2013	(r253048)
@@ -479,11 +479,11 @@ static ssize_t set_port_type(struct devi
 	int i;
 	int err = 0;
 
-	if (!strcmp(buf, "ib\n"))
+	if (!strcmp(buf, "ib"))
 		info->tmp_type = MLX4_PORT_TYPE_IB;
-	else if (!strcmp(buf, "eth\n"))
+	else if (!strcmp(buf, "eth"))
 		info->tmp_type = MLX4_PORT_TYPE_ETH;
-	else if (!strcmp(buf, "auto\n"))
+	else if (!strcmp(buf, "auto"))
 		info->tmp_type = MLX4_PORT_TYPE_AUTO;
 	else {
 		mlx4_err(mdev, "%s is not supported port type\n", buf);

Modified: head/sys/ofed/include/linux/sysfs.h
==============================================================================
--- head/sys/ofed/include/linux/sysfs.h	Mon Jul  8 21:17:20 2013	(r253047)
+++ head/sys/ofed/include/linux/sysfs.h	Mon Jul  8 21:25:12 2013	(r253048)
@@ -104,10 +104,15 @@ sysctl_handle_attr(SYSCTL_HANDLER_ARGS)
 	error = SYSCTL_OUT(req, buf, len);
 	if (error || !req->newptr || ops->store == NULL)
 		goto out;
-	error = SYSCTL_IN(req, buf, PAGE_SIZE);
+	len = req->newlen - req->newidx;
+	if (len >= PAGE_SIZE)
+		error = EINVAL;
+	else 
+		error = SYSCTL_IN(req, buf, len);
 	if (error)
 		goto out;
-	len = ops->store(kobj, attr, buf, req->newlen);
+	((char *)buf)[len] = '\0';
+	len = ops->store(kobj, attr, buf, len);
 	if (len < 0)
 		error = -len;
 out:

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 21:26:15 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 7755171C;
 Mon,  8 Jul 2013 21:26:15 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 by mx1.freebsd.org (Postfix) with ESMTP id 532A61A15;
 Mon,  8 Jul 2013 21:26:15 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id B9B8FB9C2;
 Mon,  8 Jul 2013 17:26:14 -0400 (EDT)
From: John Baldwin 
To: Alfred Perlstein 
Subject: Re: svn commit: r253007 - in head/sys: kern net80211 sys
Date: Mon, 8 Jul 2013 16:20:02 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; )
References: <201307072139.r67Ldb6u046408@svn.freebsd.org>
In-Reply-To: <201307072139.r67Ldb6u046408@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201307081620.02262.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Mon, 08 Jul 2013 17:26:14 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 21:26:15 -0000

On Sunday, July 07, 2013 5:39:37 pm Alfred Perlstein wrote:
> Author: alfred
> Date: Sun Jul  7 21:39:37 2013
> New Revision: 253007
> URL: http://svnweb.freebsd.org/changeset/base/253007
> 
> Log:
>   Make kassert_printf use __printflike.
>   
>   Fix associated errors/warnings while I'm here.
>   
>   Requested by: avg
> 
> Modified:
>   head/sys/kern/subr_witness.c
>   head/sys/kern/vfs_bio.c
>   head/sys/net80211/ieee80211_output.c
>   head/sys/sys/systm.h
> 
> Modified: head/sys/kern/subr_witness.c
> 
==============================================================================
> --- head/sys/kern/subr_witness.c	Sun Jul  7 21:23:58 2013	(r253006)
> +++ head/sys/kern/subr_witness.c	Sun Jul  7 21:39:37 2013	(r253007)
> @@ -1138,12 +1138,16 @@ witness_checkorder(struct lock_object *l
>  		iclass = LOCK_CLASS(interlock);
>  		lock1 = find_instance(lock_list, interlock);
>  		if (lock1 == NULL)
> -			kassert_panic("interlock (%s) %s not locked @ %s:%d",
> +			kassert_panic(
> +			    "interlock (%s) %s not locked while locking"
> +			    " %s @ %s:%d",
>  			    iclass->lc_name, interlock->lo_name,
>  			    flags & LOP_EXCLUSIVE ? "exclusive" : "shared",
>  			    fixup_filename(file), line);
>  		else if ((lock1->li_flags & LI_RECURSEMASK) != 0)
> -			kassert_panic("interlock (%s) %s recursed @ %s:%d",
> +			kassert_panic(
> +			    "interlock (%s) %s recursed while locking %s"
> +			    " @ %s:%d",
>  			    iclass->lc_name, interlock->lo_name,
>  			    flags & LOP_EXCLUSIVE ? "exclusive" : "shared",
>  			    fixup_filename(file), line);

Eh, this isn't really correct.  Better to remove the useless
"exclusive"/"shared" string argument.  That was a copy/paste bug on my part.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 21:26:18 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id EAB42745;
 Mon,  8 Jul 2013 21:26:18 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 by mx1.freebsd.org (Postfix) with ESMTP id 78CAF1A16;
 Mon,  8 Jul 2013 21:26:18 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9A62BB982;
 Mon,  8 Jul 2013 17:26:17 -0400 (EDT)
From: John Baldwin 
To: Garrett Cooper 
Subject: Re: svn commit: r253002 - head
Date: Mon, 8 Jul 2013 17:13:51 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; )
References: <201307072039.r67KdCdR028908@svn.freebsd.org>
 
 
In-Reply-To: 
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201307081713.51892.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Mon, 08 Jul 2013 17:26:17 -0400 (EDT)
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 Alfred Perlstein ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 21:26:19 -0000

On Monday, July 08, 2013 2:23:31 am Garrett Cooper wrote:
> On Sun, Jul 7, 2013 at 7:25 PM, Garrett Cooper  
wrote:
> > On Jul 7, 2013, at 2:15 PM, Alfred Perlstein  wrote:
> >
> >> On 7/7/13 2:01 PM, Garrett Cooper wrote:
> >>> Why the magic number 12?
> >>
> >> Numbers higher seem to result in worse performance as reported by some 
members of my team.
> >
> > The suggestion is good in spirit, but this doesn't justify the reasoning 
for this recommendation for all cases.
> >
> > Please revert this change and add a doc page or notes to the dev handbook 
discussing what the empirical process and results were for determining this 
value so people can come up with their own values that work best with their 
hardware and software config. This recommendation is prone to bitrot like some 
of the recommendations in tuning(7).
> >
> > Misinformation is sometimes more harmful than no information.
> 
> I spoke with Alfred over the phone and did some more careful thought
> about this and I'm rescinding this request.
> 
> Alfred did a good job at documenting how JFLAG works (it was
> previously undocumented). My concern over -j12 was performance
> related, and after giving things more careful thought it actually
> makes sense why -j12 was chosen because Westmere and newer processors
> have issues with NUMA and cache locality between multiple processor
> packages as we've seen non-empirically and empirically at Isilon with
> FreeBSD 7 and 10 (it's a known issue that jeffr@ and jhb@ are aware
> of).
> 
> I'll come up with a concise patch that does what Alfred was trying to
> achieve and have Alfred review it.
> 
> Thanks (and thank you Alfred for the contribution!!!)!

Westmere is fine, it's post-Westmere that is more troublesome.

I think the comment is not super useful, but don't object enough to want
it to be removed.  I always use 'make tinderbox' instead of
'make universe' though as I want build failures to be obvious.  For the
described use case of "checking if kernels build", 'tinderbox' certainly
seems to be the more appropriate target.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 22:13:26 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id B6595661;
 Mon,  8 Jul 2013 22:13:26 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com
 [IPv6:2607:f8b0:400e:c03::232])
 by mx1.freebsd.org (Postfix) with ESMTP id 81EE71C17;
 Mon,  8 Jul 2013 22:13:26 +0000 (UTC)
Received: by mail-pa0-f50.google.com with SMTP id fb1so4851054pad.37
 for ; Mon, 08 Jul 2013 15:13:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=subject:mime-version:content-type:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to:x-mailer;
 bh=O69bBy/sGC6V+ZYcRC53MOnboBEIj9UQTas6y+EGmSs=;
 b=KDc4uy2mLO4KkX+22vspzoUg1iAI30hhtR3ZmIK8U407EGKzqDRoRpSQHQ6RwKShSD
 Fs7uZ9IEFeRhvyPeD6s3b1qs5kqRsuLOD02ZumUAuelCalqVul3oLraFg793XYMpRspd
 F7EsUukg8T/7zr3gDOuspUSV+N4Ceu4koJf9F2Cz3ZLJyERRiCfO7uk4GI5J/oejREgg
 F4ISIQtL5q12OSuHW2arqS2ApbEf2/M350slNKLJX6UN+UTXLx2lrWJ3xAIs6rjdy0om
 KVcwO12zGboG7SnI88JA/hRicQTcVhA4MNVkqibl/SsMtQzIDPuBcPZo73MBbARTAYKV
 g+lQ==
X-Received: by 10.66.218.39 with SMTP id pd7mr25029921pac.148.1373321606262;
 Mon, 08 Jul 2013 15:13:26 -0700 (PDT)
Received: from [192.168.242.58] (c-67-182-131-225.hsd1.wa.comcast.net.
 [67.182.131.225])
 by mx.google.com with ESMTPSA id dj5sm24438421pbc.25.2013.07.08.15.13.24
 for 
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Mon, 08 Jul 2013 15:13:25 -0700 (PDT)
Subject: Re: svn commit: r253048 - in head/sys/ofed: drivers/net/mlx4
 include/linux
Mime-Version: 1.0 (Apple Message framework v1283)
Content-Type: text/plain; charset=us-ascii
From: Garrett Cooper 
In-Reply-To: <201307082125.r68LPDlY023493@svn.freebsd.org>
Date: Mon, 8 Jul 2013 15:13:22 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <3FF894D3-ACDF-4796-A682-F9F9DD8C943D@gmail.com>
References: <201307082125.r68LPDlY023493@svn.freebsd.org>
To: John Baldwin 
X-Mailer: Apple Mail (2.1283)
Cc: svn-src-head ,
 svn-src-all ,
 src-committers , shahark@mellanox.com
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 22:13:26 -0000

On Jul 8, 2013, at 2:25 PM, John Baldwin wrote:

> Author: jhb
> Date: Mon Jul  8 21:25:12 2013
> New Revision: 253048
> URL: http://svnweb.freebsd.org/changeset/base/253048
>=20
> Log:
>  Allow mlx4 devices to switch from Ethernet to Infiniband (and vice =
versa):
>  - Fix sysctl wrapper for sysfs attributes to properly handle new =
string
>    values similar to sysctl_handle_string() (only copyin the user's
>    supplied length and nul-terminate the string).
>  - Don't check for a trailing newline when evaluating the desired =
operating
>    mode of a mlx4 device.
>=20
>  PR:		kern/179999
>  Submitted by:	Shahar Klein 
>  MFC after:	1 week

Was there an issue with the patch I submitted via =
http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dkern/174213 (basically =
solving the same problem, but only with the sysfs <-> sysctl(9) =
handler)? I was of the impression that sysfs on Linux always added on =
trailing newlines (but I could be wrong because I haven't used Linux at =
a dev level for ages). Thanks!=

From owner-svn-src-all@FreeBSD.ORG  Mon Jul  8 23:24:05 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 538085DA;
 Mon,  8 Jul 2013 23:24:05 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-ve0-x22a.google.com (mail-ve0-x22a.google.com
 [IPv6:2607:f8b0:400c:c01::22a])
 by mx1.freebsd.org (Postfix) with ESMTP id C111B1EC2;
 Mon,  8 Jul 2013 23:24:04 +0000 (UTC)
Received: by mail-ve0-f170.google.com with SMTP id 14so4106974vea.1
 for ; Mon, 08 Jul 2013 16:24:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=Mue28M9PuK266fsOgiBvJDC5UFyIhtMdvxesGv6Pskg=;
 b=KFnd9f+zR7v6CFSyRNTRj35z1szNk1/KnLVFblHnqyB+ALkdIysjXj4MIrGNa/6RF2
 wCE9kCz6oS/TxnNWEvxnzZDWsJisDohJ79Dy2bJaKGHcKTtWzmigRhXgcRo9FfEiEtOs
 wZ6A8JIuM7AaQFF6oNv4i9lUyO/2cRiG+ft754A4f7lefs6SwwSGvqJyyQUxEDE6CIkU
 XJ77aCCM+kbAu/JWN4x9MMuL+I7oLNAZV2jzuo3p5he6GnTXPBO1D7bfSsAdKtz4KtQJ
 u45x9PI2o8l80X9bk8FQlye5RUf0LyTyr+Fy9TNRdyHrpdMslD8IC5sV8kpfb9+WH2vN
 LDMg==
MIME-Version: 1.0
X-Received: by 10.52.186.129 with SMTP id fk1mr12459656vdc.66.1373325844249;
 Mon, 08 Jul 2013 16:24:04 -0700 (PDT)
Received: by 10.220.146.145 with HTTP; Mon, 8 Jul 2013 16:24:04 -0700 (PDT)
In-Reply-To: <201307081713.51892.jhb@freebsd.org>
References: <201307072039.r67KdCdR028908@svn.freebsd.org>
 
 
 <201307081713.51892.jhb@freebsd.org>
Date: Mon, 8 Jul 2013 16:24:04 -0700
Message-ID: 
Subject: Re: svn commit: r253002 - head
From: Garrett Cooper 
To: John Baldwin 
Content-Type: text/plain; charset=ISO-8859-1
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 Alfred Perlstein ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Mon, 08 Jul 2013 23:24:05 -0000

On Mon, Jul 8, 2013 at 2:13 PM, John Baldwin  wrote:
> On Monday, July 08, 2013 2:23:31 am Garrett Cooper wrote:
>> On Sun, Jul 7, 2013 at 7:25 PM, Garrett Cooper 
> wrote:
>> > On Jul 7, 2013, at 2:15 PM, Alfred Perlstein  wrote:
>> >
>> >> On 7/7/13 2:01 PM, Garrett Cooper wrote:
>> >>> Why the magic number 12?
>> >>
>> >> Numbers higher seem to result in worse performance as reported by some
> members of my team.
>> >
>> > The suggestion is good in spirit, but this doesn't justify the reasoning
> for this recommendation for all cases.
>> >
>> > Please revert this change and add a doc page or notes to the dev handbook
> discussing what the empirical process and results were for determining this
> value so people can come up with their own values that work best with their
> hardware and software config. This recommendation is prone to bitrot like some
> of the recommendations in tuning(7).
>> >
>> > Misinformation is sometimes more harmful than no information.
>>
>> I spoke with Alfred over the phone and did some more careful thought
>> about this and I'm rescinding this request.
>>
>> Alfred did a good job at documenting how JFLAG works (it was
>> previously undocumented). My concern over -j12 was performance
>> related, and after giving things more careful thought it actually
>> makes sense why -j12 was chosen because Westmere and newer processors
>> have issues with NUMA and cache locality between multiple processor
>> packages as we've seen non-empirically and empirically at Isilon with
>> FreeBSD 7 and 10 (it's a known issue that jeffr@ and jhb@ are aware
>> of).
>>
>> I'll come up with a concise patch that does what Alfred was trying to
>> achieve and have Alfred review it.
>>
>> Thanks (and thank you Alfred for the contribution!!!)!
>
> Westmere is fine, it's post-Westmere that is more troublesome.

Even the 6-core Westmeres (I'm being completely dumb here as you and
Jeff know a lot more about the NUMA issue than I do as I just caught
the tail end of the conversation at BSDCan)? I'm asking because they
(iX) are using build.ix as the primary build machine and it has 2
Westmere dies with (IIRC -- please correct me if I'm wrong
Alfred/Xin/etc) 6 cores each and are SMT enabled. It also has a
boatload of RAM and disks hooked up to an mfi(4) controller (which
could be a contributing factor in the performance degradation issue).

> I think the comment is not super useful, but don't object enough to want
> it to be removed.  I always use 'make tinderbox' instead of
> 'make universe' though as I want build failures to be obvious.  For the
> described use case of "checking if kernels build", 'tinderbox' certainly
> seems to be the more appropriate target.

Changing it from universe to tinderbox seems like a better idea --
I'll put a short note in my proposed patch for that.

Thanks!
-Garrett

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 00:01:09 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 7E697BA6;
 Tue,  9 Jul 2013 00:01:09 +0000 (UTC)
 (envelope-from alfred@freebsd.org)
Received: from elvis.mu.org (elvis.mu.org [192.203.228.196])
 by mx1.freebsd.org (Postfix) with ESMTP id 5FA941FFB;
 Tue,  9 Jul 2013 00:01:09 +0000 (UTC)
Received: from Alfreds-MacBook-Pro-9.local
 (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218])
 by elvis.mu.org (Postfix) with ESMTPSA id 3A75B1A3C7A;
 Mon,  8 Jul 2013 17:01:02 -0700 (PDT)
Message-ID: <51DB52BC.2030802@freebsd.org>
Date: Mon, 08 Jul 2013 17:01:00 -0700
From: Alfred Perlstein 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7;
 rv:17.0) Gecko/20130620 Thunderbird/17.0.7
MIME-Version: 1.0
To: Garrett Cooper 
Subject: Re: svn commit: r253002 - head
References: <201307072039.r67KdCdR028908@svn.freebsd.org>
 
 
 <201307081713.51892.jhb@freebsd.org>
 
In-Reply-To: 
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" ,
 John Baldwin 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 00:01:09 -0000

On 7/8/13 4:24 PM, Garrett Cooper wrote:
> On Mon, Jul 8, 2013 at 2:13 PM, John Baldwin  wrote:
>> On Monday, July 08, 2013 2:23:31 am Garrett Cooper wrote:
>>> On Sun, Jul 7, 2013 at 7:25 PM, Garrett Cooper 
>> wrote:
>>>> On Jul 7, 2013, at 2:15 PM, Alfred Perlstein  wrote:
>>>>
>>>>> On 7/7/13 2:01 PM, Garrett Cooper wrote:
>>>>>> Why the magic number 12?
>>>>> Numbers higher seem to result in worse performance as reported by some
>> members of my team.
>>>> The suggestion is good in spirit, but this doesn't justify the reasoning
>> for this recommendation for all cases.
>>>> Please revert this change and add a doc page or notes to the dev handbook
>> discussing what the empirical process and results were for determining this
>> value so people can come up with their own values that work best with their
>> hardware and software config. This recommendation is prone to bitrot like some
>> of the recommendations in tuning(7).
>>>> Misinformation is sometimes more harmful than no information.
>>> I spoke with Alfred over the phone and did some more careful thought
>>> about this and I'm rescinding this request.
>>>
>>> Alfred did a good job at documenting how JFLAG works (it was
>>> previously undocumented). My concern over -j12 was performance
>>> related, and after giving things more careful thought it actually
>>> makes sense why -j12 was chosen because Westmere and newer processors
>>> have issues with NUMA and cache locality between multiple processor
>>> packages as we've seen non-empirically and empirically at Isilon with
>>> FreeBSD 7 and 10 (it's a known issue that jeffr@ and jhb@ are aware
>>> of).
>>>
>>> I'll come up with a concise patch that does what Alfred was trying to
>>> achieve and have Alfred review it.
>>>
>>> Thanks (and thank you Alfred for the contribution!!!)!
>> Westmere is fine, it's post-Westmere that is more troublesome.
> Even the 6-core Westmeres (I'm being completely dumb here as you and
> Jeff know a lot more about the NUMA issue than I do as I just caught
> the tail end of the conversation at BSDCan)? I'm asking because they
> (iX) are using build.ix as the primary build machine and it has 2
> Westmere dies with (IIRC -- please correct me if I'm wrong
> Alfred/Xin/etc) 6 cores each and are SMT enabled. It also has a
> boatload of RAM and disks hooked up to an mfi(4) controller (which
> could be a contributing factor in the performance degradation issue).
>
>> I think the comment is not super useful, but don't object enough to want
>> it to be removed.  I always use 'make tinderbox' instead of
>> 'make universe' though as I want build failures to be obvious.  For the
>> described use case of "checking if kernels build", 'tinderbox' certainly
>> seems to be the more appropriate target.
> Changing it from universe to tinderbox seems like a better idea --
> I'll put a short note in my proposed patch for that.
>
> Thanks!
> -Garrett
>
Just to clarify, the passing of jflag in the comments was there because 
it seems like most of the targets default to "-j1" which out of the box 
is somewhat ludicrous these days.  It was only a guide such that someone 
who knows what "-j" does would be like "oh that's absurd, I know a 
better value" rather than just being oblivious to it (like me) or 
stupidly assume that some level of auto-tuning was done (also like me) 
and wind up wondering why "make universe" is taking as long as an actual 
real live universe to build.

;)

-Alfred

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 00:12:25 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 76592F85;
 Tue,  9 Jul 2013 00:12:25 +0000 (UTC)
 (envelope-from Devin.Teske@fisglobal.com)
Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190])
 by mx1.freebsd.org (Postfix) with ESMTP id 423431083;
 Tue,  9 Jul 2013 00:12:24 +0000 (UTC)
Received: from smtp.fisglobal.com ([10.132.206.31])
 by ltcfislmsgpa07.fnfis.com (8.14.5/8.14.5) with ESMTP id r690COH8003286
 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT);
 Mon, 8 Jul 2013 19:12:24 -0500
Received: from LTCFISWMSGMB21.FNFIS.com ([10.132.99.23]) by
 LTCFISWMSGHT03.FNFIS.com ([10.132.206.31]) with mapi id 14.02.0309.002; Mon,
 8 Jul 2013 19:12:24 -0500
From: "Teske, Devin" 
To: Alfred Perlstein 
Subject: Re: svn commit: r253002 - head
Thread-Topic: svn commit: r253002 - head
Thread-Index: AQHOe1IOUGaKuVMAxE6Zyjz3auiH3plaB1mAgAAD6YCAAcPiAA==
Date: Tue, 9 Jul 2013 00:12:22 +0000
Message-ID: <13CA24D6AB415D428143D44749F57D7201FB7609@ltcfiswmsgmb21>
References: <201307072039.r67KdCdR028908@svn.freebsd.org>
 <9D4C7540-A3B0-45E5-8219-6A455D41DF70@gmail.com>
 <51D9DA55.2090808@freebsd.org>
In-Reply-To: <51D9DA55.2090808@freebsd.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.132.253.126]
Content-Type: text/plain; charset="iso-8859-1"
Content-ID: <3741638654480344B94FF8ABDDF3EA6D@fisglobal.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431,
 0.0.0000
 definitions=2013-07-08_06:2013-07-08,2013-07-08,1970-01-01 signatures=0
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 Devin Teske ,
 "src-committers@freebsd.org" ,
 Garrett Cooper 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: Devin Teske 
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 00:12:25 -0000

On Jul 7, 2013, at 2:15 PM, Alfred Perlstein wrote:

> On 7/7/13 2:01 PM, Garrett Cooper wrote:
>> Why the magic number 12?
>=20
> Numbers higher seem to result in worse performance as reported by some me=
mbers of my team.
>=20

We've run as high as -j48 ... number of logical cpu's "times-two" (it was o=
n a box with 24 logical CPUs).

We did buildworld in under 9 minutes. Beyond the "times-two" rule we saw a =
slow-down.

NOTE: I might also mention this was on RAID-1 SSD.
--=20
Devin



>> On Jul 7, 2013, at 1:39 PM, Alfred Perlstein  wrote:
>>=20
>>> Author: alfred
>>> Date: Sun Jul  7 20:39:11 2013
>>> New Revision: 253002
>>> URL: http://svnweb.freebsd.org/changeset/base/253002
>>>=20
>>> Log:
>>>  Document tip on how to build all kernels quickly.
>>>=20
>>> Modified:
>>>  head/Makefile
>>>=20
>>> Modified: head/Makefile
>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>>> --- head/Makefile    Sun Jul  7 19:58:14 2013    (r253001)
>>> +++ head/Makefile    Sun Jul  7 20:39:11 2013    (r253002)
>>> @@ -32,6 +32,12 @@
>>> # targets             - Print a list of supported TARGET/TARGET_ARCH pa=
irs
>>> #                       for world and kernel targets.
>>> # toolchains          - Build a toolchain for all world and kernel targ=
ets.
>>> +#
>>> +# "quick" way to test all kernel builds:
>>> +#    _jflag=3D`sysctl -n hw.ncpu`
>>> +#    _jflag=3D$(($_jflag * 2))
>>> +#    [ $_jflag -gt 12 ] && _jflag=3D12
>>> +#    make universe -DMAKE_JUST_KERNELS JFLAG=3D${jflag}
>>> #
>>> # This makefile is simple by design. The FreeBSD make automatically rea=
ds
>>> # the /usr/share/mk/sys.mk unless the -m argument is specified on the
>>> _______________________________________________
>>> 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

_____________
The information contained in this message is proprietary and/or confidentia=
l. If you are not the intended recipient, please: (i) delete the message an=
d all copies; (ii) do not disclose, distribute or use the message in any ma=
nner; and (iii) notify the sender immediately. In addition, please be aware=
 that any message addressed to our domain is subject to archiving and revie=
w by persons other than the intended recipient. Thank you.

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 00:46:20 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 3028FF2B;
 Tue,  9 Jul 2013 00:46:20 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-pd0-x22a.google.com (mail-pd0-x22a.google.com
 [IPv6:2607:f8b0:400e:c02::22a])
 by mx1.freebsd.org (Postfix) with ESMTP id E8AAE1953;
 Tue,  9 Jul 2013 00:46:19 +0000 (UTC)
Received: by mail-pd0-f170.google.com with SMTP id x11so4673575pdj.1
 for ; Mon, 08 Jul 2013 17:46:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=subject:mime-version:content-type:from:in-reply-to:date:cc
 :content-transfer-encoding:message-id:references:to:x-mailer;
 bh=Svobeg1whpVeU3ywjb8f++Wqld6OyW7l8Y5GyRUN8oY=;
 b=gtbpOanj8n6kEkPpv6WZ14SVGNspcTPM/HR8QBbTWBZPAo9tkdAv5fzPvcgS0yy1Xp
 WC88BMxPihtOZaMiWM91v4Fbcxv2fg/mPyr/DQfOol8t+g8s8L3H8RhnB82724nE8DiC
 Qm/GFtejYuDIIqW8OgBFwt1m4ff+GV4E0AfgHhEYemLoLYlC8Oig0LhG07dIZMeC17MO
 4J9WXy2KnvB9Dj9EDT+9fbnEmVN42o/CGcHS6AWkHbLtm8pWHqPWueLSNpL57f5n5jNk
 /4Yz/Lsdtl4biqUSJm2DAJPFOXgUEmt101KGfC/Ww6FEW1/kkHbIwulk08R66D+Me0GV
 8ZZA==
X-Received: by 10.66.138.15 with SMTP id qm15mr24887589pab.128.1373328982184; 
 Mon, 08 Jul 2013 17:16:22 -0700 (PDT)
Received: from [192.168.242.58] (c-67-182-131-225.hsd1.wa.comcast.net.
 [67.182.131.225])
 by mx.google.com with ESMTPSA id vi8sm16244645pbc.31.2013.07.08.17.16.20
 for 
 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Mon, 08 Jul 2013 17:16:21 -0700 (PDT)
Subject: Re: svn commit: r253002 - head
Mime-Version: 1.0 (Apple Message framework v1283)
Content-Type: text/plain; charset=iso-8859-1
From: Garrett Cooper 
In-Reply-To: <13CA24D6AB415D428143D44749F57D7201FB7609@ltcfiswmsgmb21>
Date: Mon, 8 Jul 2013 17:16:18 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <93211009-266E-4491-B706-67847A055832@gmail.com>
References: <201307072039.r67KdCdR028908@svn.freebsd.org>
 <9D4C7540-A3B0-45E5-8219-6A455D41DF70@gmail.com>
 <51D9DA55.2090808@freebsd.org>
 <13CA24D6AB415D428143D44749F57D7201FB7609@ltcfiswmsgmb21>
To: Devin Teske 
X-Mailer: Apple Mail (2.1283)
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 Alfred Perlstein ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 00:46:20 -0000

On Jul 8, 2013, at 5:12 PM, Teske, Devin wrote:

> On Jul 7, 2013, at 2:15 PM, Alfred Perlstein wrote:
>=20
>> On 7/7/13 2:01 PM, Garrett Cooper wrote:
>>> Why the magic number 12?
>>=20
>> Numbers higher seem to result in worse performance as reported by =
some members of my team.
>>=20
>=20
> We've run as high as -j48 ... number of logical cpu's "times-two" (it =
was on a box with 24 logical CPUs).
>=20
> We did buildworld in under 9 minutes. Beyond the "times-two" rule we =
saw a slow-down.
>=20
> NOTE: I might also mention this was on RAID-1 SSD.

+1 as well, which is part of the reason why I questioned the performance =
recommendation, but that's beside the point. Thanks!=

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 01:05:30 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 89D7642F;
 Tue,  9 Jul 2013 01:05:30 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 6AFDC1A28;
 Tue,  9 Jul 2013 01:05:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6915UDD082156;
 Tue, 9 Jul 2013 01:05:30 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6915Tmi082145;
 Tue, 9 Jul 2013 01:05:29 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201307090105.r6915Tmi082145@svn.freebsd.org>
From: Rick Macklem 
Date: Tue, 9 Jul 2013 01:05:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253049 - in head/sys: fs/nfs fs/nfsclient kgssapi rpc
 rpc/rpcsec_gss sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 01:05:30 -0000

Author: rmacklem
Date: Tue Jul  9 01:05:28 2013
New Revision: 253049
URL: http://svnweb.freebsd.org/changeset/base/253049

Log:
  Add support for host-based (Kerberos 5 service principal) initiator
  credentials to the kernel rpc. Modify the NFSv4 client to add
  support for the gssname and allgssname mount options to use this
  capability. Requires the gssd daemon to be running with the "-h" option.
  
  Reviewed by:	jhb

Modified:
  head/sys/fs/nfs/nfs.h
  head/sys/fs/nfs/nfs_commonkrpc.c
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/kgssapi/gss_impl.c
  head/sys/rpc/rpcsec_gss.h
  head/sys/rpc/rpcsec_gss/rpcsec_gss.c
  head/sys/sys/param.h

Modified: head/sys/fs/nfs/nfs.h
==============================================================================
--- head/sys/fs/nfs/nfs.h	Mon Jul  8 21:25:12 2013	(r253048)
+++ head/sys/fs/nfs/nfs.h	Tue Jul  9 01:05:28 2013	(r253049)
@@ -466,6 +466,7 @@ struct nfssockreq {
 	u_int32_t	nr_prog;
 	u_int32_t	nr_vers;
 	struct __rpc_client *nr_client;
+	AUTH		*nr_auth;
 };
 
 /*

Modified: head/sys/fs/nfs/nfs_commonkrpc.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonkrpc.c	Mon Jul  8 21:25:12 2013	(r253048)
+++ head/sys/fs/nfs/nfs_commonkrpc.c	Tue Jul  9 01:05:28 2013	(r253049)
@@ -102,7 +102,6 @@ static int	nfs_bufpackets = 4;
 static int	nfs_reconnects;
 static int	nfs3_jukebox_delay = 10;
 static int	nfs_skip_wcc_data_onerr = 1;
-static int	nfs_keytab_enctype = ETYPE_DES_CBC_CRC;
 
 SYSCTL_DECL(_vfs_nfs);
 
@@ -114,8 +113,6 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs3_juke
     "Number of seconds to delay a retry after receiving EJUKEBOX");
 SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, &nfs_skip_wcc_data_onerr, 0,
     "Disable weak cache consistency checking when server returns an error");
-SYSCTL_INT(_vfs_nfs, OID_AUTO, keytab_enctype, CTLFLAG_RW, &nfs_keytab_enctype, 0,
-    "Encryption type for the keytab entry used by nfs");
 
 static void	nfs_down(struct nfsmount *, struct thread *, const char *,
     int, int);
@@ -393,9 +390,6 @@ nfs_getauth(struct nfssockreq *nrp, int 
 {
 	rpc_gss_service_t svc;
 	AUTH *auth;
-#ifdef notyet
-	rpc_gss_options_req_t req_options;
-#endif
 
 	switch (secflavour) {
 	case RPCSEC_GSS_KRB5:
@@ -411,28 +405,16 @@ nfs_getauth(struct nfssockreq *nrp, int 
 			svc = rpc_gss_svc_integrity;
 		else
 			svc = rpc_gss_svc_privacy;
-#ifdef notyet
-		req_options.req_flags = GSS_C_MUTUAL_FLAG;
-		req_options.time_req = 0;
-		req_options.my_cred = GSS_C_NO_CREDENTIAL;
-		req_options.input_channel_bindings = NULL;
-		req_options.enc_type = nfs_keytab_enctype;
-
-		auth = rpc_gss_secfind_call(nrp->nr_client, cred,
-		    clnt_principal, srv_principal, mech_oid, svc,
-		    &req_options);
-#else
-		/*
-		 * Until changes to the rpcsec_gss code are committed,
-		 * there is no support for host based initiator
-		 * principals. As such, that case cannot yet be handled.
-		 */
+
 		if (clnt_principal == NULL)
 			auth = rpc_gss_secfind_call(nrp->nr_client, cred,
 			    srv_principal, mech_oid, svc);
-		else
-			auth = NULL;
-#endif
+		else {
+			auth = rpc_gss_seccreate_call(nrp->nr_client, cred,
+			    clnt_principal, srv_principal, "kerberosv5",
+			    svc, NULL, NULL, NULL);
+			return (auth);
+		}
 		if (auth != NULL)
 			return (auth);
 		/* fallthrough */
@@ -505,7 +487,7 @@ newnfs_request(struct nfsrv_descript *nd
 	struct rpc_callextra ext;
 	enum clnt_stat stat;
 	struct nfsreq *rep = NULL;
-	char *srv_principal = NULL;
+	char *srv_principal = NULL, *clnt_principal = NULL;
 	sigset_t oldset;
 	struct ucred *authcred;
 
@@ -568,6 +550,7 @@ newnfs_request(struct nfsrv_descript *nd
 			 */
 			if (nmp->nm_krbnamelen > 0) {
 				usegssname = 1;
+				clnt_principal = nmp->nm_krbname;
 			} else if (nmp->nm_uid != (uid_t)-1) {
 				KASSERT(nmp->nm_sockreq.nr_cred != NULL,
 				    ("newnfs_request: NULL nr_cred"));
@@ -622,10 +605,19 @@ newnfs_request(struct nfsrv_descript *nd
 
 	if (nd->nd_procnum == NFSPROC_NULL)
 		auth = authnone_create();
-	else if (usegssname)
-		auth = nfs_getauth(nrp, secflavour, nmp->nm_krbname,
-		    srv_principal, NULL, authcred);
-	else
+	else if (usegssname) {
+		/*
+		 * For this case, the authenticator is held in the
+		 * nfssockreq structure, so don't release the reference count
+		 * held on it. --> Don't AUTH_DESTROY() it in this function.
+		 */
+		if (nrp->nr_auth == NULL)
+			nrp->nr_auth = nfs_getauth(nrp, secflavour,
+			    clnt_principal, srv_principal, NULL, authcred);
+		else
+			rpc_gss_refresh_auth_call(nrp->nr_auth);
+		auth = nrp->nr_auth;
+	} else
 		auth = nfs_getauth(nrp, secflavour, NULL,
 		    srv_principal, NULL, authcred);
 	crfree(authcred);
@@ -781,7 +773,8 @@ tryagain:
 	}
 	if (error) {
 		m_freem(nd->nd_mreq);
-		AUTH_DESTROY(auth);
+		if (usegssname == 0)
+			AUTH_DESTROY(auth);
 		if (rep != NULL)
 			FREE((caddr_t)rep, M_NFSDREQ);
 		if (set_sigset)
@@ -991,7 +984,8 @@ tryagain:
 #endif
 
 	m_freem(nd->nd_mreq);
-	AUTH_DESTROY(auth);
+	if (usegssname == 0)
+		AUTH_DESTROY(auth);
 	if (rep != NULL)
 		FREE((caddr_t)rep, M_NFSDREQ);
 	if (set_sigset)
@@ -1000,7 +994,8 @@ tryagain:
 nfsmout:
 	mbuf_freem(nd->nd_mrep);
 	mbuf_freem(nd->nd_mreq);
-	AUTH_DESTROY(auth);
+	if (usegssname == 0)
+		AUTH_DESTROY(auth);
 	if (rep != NULL)
 		FREE((caddr_t)rep, M_NFSDREQ);
 	if (set_sigset)

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvfsops.c	Mon Jul  8 21:25:12 2013	(r253048)
+++ head/sys/fs/nfsclient/nfs_clvfsops.c	Tue Jul  9 01:05:28 2013	(r253049)
@@ -1446,6 +1446,8 @@ bad:
 		nfscl_clientrelease(clp);
 	newnfs_disconnect(&nmp->nm_sockreq);
 	crfree(nmp->nm_sockreq.nr_cred);
+	if (nmp->nm_sockreq.nr_auth != NULL)
+		AUTH_DESTROY(nmp->nm_sockreq.nr_auth);
 	mtx_destroy(&nmp->nm_sockreq.nr_mtx);
 	mtx_destroy(&nmp->nm_mtx);
 	if (nmp->nm_clp != NULL) {
@@ -1516,7 +1518,8 @@ nfs_unmount(struct mount *mp, int mntfla
 	newnfs_disconnect(&nmp->nm_sockreq);
 	crfree(nmp->nm_sockreq.nr_cred);
 	FREE(nmp->nm_nam, M_SONAME);
-
+	if (nmp->nm_sockreq.nr_auth != NULL)
+		AUTH_DESTROY(nmp->nm_sockreq.nr_auth);
 	mtx_destroy(&nmp->nm_sockreq.nr_mtx);
 	mtx_destroy(&nmp->nm_mtx);
 	TAILQ_FOREACH_SAFE(dsp, &nmp->nm_sess, nfsclds_list, tdsp)

Modified: head/sys/kgssapi/gss_impl.c
==============================================================================
--- head/sys/kgssapi/gss_impl.c	Mon Jul  8 21:25:12 2013	(r253048)
+++ head/sys/kgssapi/gss_impl.c	Tue Jul  9 01:05:28 2013	(r253049)
@@ -286,6 +286,7 @@ kgssapi_modevent(module_t mod, int type,
 
 	switch (type) {
 	case MOD_LOAD:
+		rpc_gss_entries.rpc_gss_refresh_auth = rpc_gss_refresh_auth;
 		rpc_gss_entries.rpc_gss_secfind = rpc_gss_secfind;
 		rpc_gss_entries.rpc_gss_secpurge = rpc_gss_secpurge;
 		rpc_gss_entries.rpc_gss_seccreate = rpc_gss_seccreate;

Modified: head/sys/rpc/rpcsec_gss.h
==============================================================================
--- head/sys/rpc/rpcsec_gss.h	Mon Jul  8 21:25:12 2013	(r253048)
+++ head/sys/rpc/rpcsec_gss.h	Tue Jul  9 01:05:28 2013	(r253049)
@@ -153,9 +153,9 @@ typedef AUTH	*rpc_gss_secfind_ftype(CLIE
 		    rpc_gss_service_t service);
 typedef void	rpc_gss_secpurge_ftype(CLIENT *clnt);
 typedef AUTH	*rpc_gss_seccreate_ftype(CLIENT *clnt, struct ucred *cred,
-		    const char *principal, const char *mechanism,
-		    rpc_gss_service_t service, const char *qop,
-		    rpc_gss_options_req_t *options_req,
+		    const char *clnt_principal, const char *principal,
+		    const char *mechanism, rpc_gss_service_t service,
+		    const char *qop, rpc_gss_options_req_t *options_req,
 		    rpc_gss_options_ret_t *options_ret);
 typedef bool_t	rpc_gss_set_defaults_ftype(AUTH *auth,
 		    rpc_gss_service_t service, const char *qop);
@@ -183,6 +183,7 @@ typedef bool_t	rpc_gss_get_principal_nam
 		    const char *domain);
 typedef int	rpc_gss_svc_max_data_length_ftype(struct svc_req *req,
 		    int max_tp_unit_len);
+typedef void	rpc_gss_refresh_auth_ftype(AUTH *auth);
 
 struct rpc_gss_entries {
 	rpc_gss_secfind_ftype		*rpc_gss_secfind;
@@ -204,6 +205,7 @@ struct rpc_gss_entries {
 	rpc_gss_clear_callback_ftype	*rpc_gss_clear_callback;
 	rpc_gss_get_principal_name_ftype *rpc_gss_get_principal_name;
 	rpc_gss_svc_max_data_length_ftype *rpc_gss_svc_max_data_length;
+	rpc_gss_refresh_auth_ftype	*rpc_gss_refresh_auth;
 };
 extern struct rpc_gss_entries	rpc_gss_entries;
 
@@ -229,16 +231,17 @@ rpc_gss_secpurge_call(CLIENT *clnt)
 }
 
 static __inline AUTH *
-rpc_gss_seccreate_call(CLIENT *clnt, struct ucred *cred, const char *principal,
-    const char *mechanism, rpc_gss_service_t service, const char *qop,
+rpc_gss_seccreate_call(CLIENT *clnt, struct ucred *cred,
+    const char *clnt_principal, const char *principal, const char *mechanism,
+    rpc_gss_service_t service, const char *qop,
     rpc_gss_options_req_t *options_req, rpc_gss_options_ret_t *options_ret)
 {
 	AUTH *ret = NULL;
 
 	if (rpc_gss_entries.rpc_gss_seccreate != NULL)
 		ret = (*rpc_gss_entries.rpc_gss_seccreate)(clnt, cred,
-		    principal, mechanism, service, qop, options_req,
-		    options_ret);
+		    clnt_principal, principal, mechanism, service, qop,
+		    options_req, options_ret);
 	return (ret);
 }
 
@@ -406,14 +409,29 @@ rpc_gss_svc_max_data_length_call(struct 
 	return (ret);
 }
 
+static __inline void
+rpc_gss_refresh_auth_call(AUTH *auth)
+{
+
+	if (rpc_gss_entries.rpc_gss_refresh_auth != NULL)
+		(*rpc_gss_entries.rpc_gss_refresh_auth)(auth);
+}
+
 AUTH	*rpc_gss_secfind(CLIENT *clnt, struct ucred *cred,
     const char *principal, gss_OID mech_oid, rpc_gss_service_t service);
 void	rpc_gss_secpurge(CLIENT *clnt);
-#endif
+void	rpc_gss_refresh_auth(AUTH *auth);
+AUTH	*rpc_gss_seccreate(CLIENT *clnt, struct ucred *cred,
+    const char *clnt_principal, const char *principal,
+    const char *mechanism, rpc_gss_service_t service,
+    const char *qop, rpc_gss_options_req_t *options_req,
+    rpc_gss_options_ret_t *options_ret);
+#else	/* !_KERNEL */
 AUTH	*rpc_gss_seccreate(CLIENT *clnt, struct ucred *cred,
     const char *principal, const char *mechanism, rpc_gss_service_t service,
     const char *qop, rpc_gss_options_req_t *options_req,
     rpc_gss_options_ret_t *options_ret);
+#endif	/* _KERNEL */
 bool_t	rpc_gss_set_defaults(AUTH *auth, rpc_gss_service_t service,
     const char *qop);
 int	rpc_gss_max_data_length(AUTH *handle, int max_tp_unit_len);

Modified: head/sys/rpc/rpcsec_gss/rpcsec_gss.c
==============================================================================
--- head/sys/rpc/rpcsec_gss/rpcsec_gss.c	Mon Jul  8 21:25:12 2013	(r253048)
+++ head/sys/rpc/rpcsec_gss/rpcsec_gss.c	Tue Jul  9 01:05:28 2013	(r253049)
@@ -82,6 +82,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 #include "rpcsec_gss_int.h"
 
 static void	rpc_gss_nextverf(AUTH*);
@@ -122,6 +124,7 @@ struct rpc_gss_data {
 	AUTH			*gd_auth;	/* link back to AUTH */
 	struct ucred		*gd_ucred;	/* matching local cred */
 	char			*gd_principal;	/* server principal name */
+	char			*gd_clntprincipal; /* client principal name */
 	rpc_gss_options_req_t	gd_options;	/* GSS context options */
 	enum rpcsec_gss_state	gd_state;	/* connection state */
 	gss_buffer_desc		gd_verf;	/* save GSS_S_COMPLETE
@@ -153,7 +156,7 @@ static struct sx rpc_gss_lock;
 static int rpc_gss_count;
 
 static AUTH *rpc_gss_seccreate_int(CLIENT *, struct ucred *, const char *,
-    gss_OID, rpc_gss_service_t, u_int, rpc_gss_options_req_t *,
+    const char *, gss_OID, rpc_gss_service_t, u_int, rpc_gss_options_req_t *,
     rpc_gss_options_ret_t *);
 
 static void
@@ -251,8 +254,8 @@ again:
 	/*
 	 * We missed in the cache - create a new association.
 	 */
-	auth = rpc_gss_seccreate_int(clnt, cred, principal, mech_oid, service,
-	    GSS_C_QOP_DEFAULT, NULL, NULL);
+	auth = rpc_gss_seccreate_int(clnt, cred, NULL, principal, mech_oid,
+	    service, GSS_C_QOP_DEFAULT, NULL, NULL);
 	if (!auth)
 		return (NULL);
 
@@ -304,9 +307,10 @@ rpc_gss_secpurge(CLIENT *clnt)
 }
 
 AUTH *
-rpc_gss_seccreate(CLIENT *clnt, struct ucred *cred, const char *principal,
-    const char *mechanism, rpc_gss_service_t service, const char *qop,
-    rpc_gss_options_req_t *options_req, rpc_gss_options_ret_t *options_ret)
+rpc_gss_seccreate(CLIENT *clnt, struct ucred *cred, const char *clnt_principal,
+    const char *principal, const char *mechanism, rpc_gss_service_t service,
+    const char *qop, rpc_gss_options_req_t *options_req,
+    rpc_gss_options_ret_t *options_ret)
 {
 	gss_OID			oid;
 	u_int			qop_num;
@@ -324,13 +328,33 @@ rpc_gss_seccreate(CLIENT *clnt, struct u
 		qop_num = GSS_C_QOP_DEFAULT;
 	}
 
-	return (rpc_gss_seccreate_int(clnt, cred, principal, oid, service,
-		qop_num, options_req, options_ret));
+	return (rpc_gss_seccreate_int(clnt, cred, clnt_principal, principal,
+		oid, service, qop_num, options_req, options_ret));
+}
+
+void
+rpc_gss_refresh_auth(AUTH *auth)
+{
+	struct rpc_gss_data	*gd;
+	rpc_gss_options_ret_t	options;
+
+	gd = AUTH_PRIVATE(auth);
+	/*
+	 * If the state != ESTABLISHED, try and initialize
+	 * the authenticator again. This will happen if the
+	 * user's credentials have expired. It may succeed now,
+	 * if they have done a kinit or similar.
+	 */
+	if (gd->gd_state != RPCSEC_GSS_ESTABLISHED) {
+		memset(&options, 0, sizeof (options));
+		(void) rpc_gss_init(auth, &options);
+	}
 }
 
 static AUTH *
-rpc_gss_seccreate_int(CLIENT *clnt, struct ucred *cred, const char *principal,
-    gss_OID mech_oid, rpc_gss_service_t service, u_int qop_num,
+rpc_gss_seccreate_int(CLIENT *clnt, struct ucred *cred,
+    const char *clnt_principal, const char *principal, gss_OID mech_oid,
+    rpc_gss_service_t service, u_int qop_num,
     rpc_gss_options_req_t *options_req, rpc_gss_options_ret_t *options_ret)
 {
 	AUTH			*auth;
@@ -379,6 +403,10 @@ rpc_gss_seccreate_int(CLIENT *clnt, stru
 	gd->gd_auth = auth;
 	gd->gd_ucred = crdup(cred);
 	gd->gd_principal = strdup(principal, M_RPC);
+	if (clnt_principal != NULL)
+		gd->gd_clntprincipal = strdup(clnt_principal, M_RPC);
+	else
+		gd->gd_clntprincipal = NULL;
 
 
 	if (options_req) {
@@ -719,6 +747,8 @@ rpc_gss_init(AUTH *auth, rpc_gss_options
 	OM_uint32		 maj_stat, min_stat, call_stat;
 	const char		*mech;
 	struct rpc_callextra	 ext;
+	gss_OID			mech_oid;
+	gss_OID_set		mechlist;
 
 	rpc_gss_log_debug("in rpc_gss_refresh()");
 	
@@ -745,6 +775,65 @@ rpc_gss_init(AUTH *auth, rpc_gss_options
 	gd->gd_cred.gc_proc = RPCSEC_GSS_INIT;
 	gd->gd_cred.gc_seq = 0;
 
+	/*
+	 * For KerberosV, if there is a client principal name, that implies
+	 * that this is a host based initiator credential in the default
+	 * keytab file. For this case, it is necessary to do a
+	 * gss_acquire_cred(). When this is done, the gssd daemon will
+	 * do the equivalent of "kinit -k" to put a TGT for the name in
+	 * the credential cache file for the gssd daemon.
+	 */
+	if (gd->gd_clntprincipal != NULL &&
+	    rpc_gss_mech_to_oid("kerberosv5", &mech_oid) &&
+	    gd->gd_mech == mech_oid) {
+		/* Get rid of any old credential. */
+		if (gd->gd_options.my_cred != GSS_C_NO_CREDENTIAL) {
+			gss_release_cred(&min_stat, &gd->gd_options.my_cred);
+			gd->gd_options.my_cred = GSS_C_NO_CREDENTIAL;
+		}
+	
+		/*
+		 * The mechanism must be set to KerberosV for acquisition
+		 * of credentials to work reliably.
+		 */
+		maj_stat = gss_create_empty_oid_set(&min_stat, &mechlist);
+		if (maj_stat != GSS_S_COMPLETE) {
+			options_ret->major_status = maj_stat;
+			options_ret->minor_status = min_stat;
+			goto out;
+		}
+		maj_stat = gss_add_oid_set_member(&min_stat, gd->gd_mech,
+		    &mechlist);
+		if (maj_stat != GSS_S_COMPLETE) {
+			options_ret->major_status = maj_stat;
+			options_ret->minor_status = min_stat;
+			gss_release_oid_set(&min_stat, &mechlist);
+			goto out;
+		}
+	
+		principal_desc.value = (void *)gd->gd_clntprincipal;
+		principal_desc.length = strlen(gd->gd_clntprincipal);
+		maj_stat = gss_import_name(&min_stat, &principal_desc,
+		    GSS_C_NT_HOSTBASED_SERVICE, &name);
+		if (maj_stat != GSS_S_COMPLETE) {
+			options_ret->major_status = maj_stat;
+			options_ret->minor_status = min_stat;
+			gss_release_oid_set(&min_stat, &mechlist);
+			goto out;
+		}
+		/* Acquire the credentials. */
+		maj_stat = gss_acquire_cred(&min_stat, name, 0,
+		    mechlist, GSS_C_INITIATE,
+		    &gd->gd_options.my_cred, NULL, NULL);
+		gss_release_name(&min_stat, &name);
+		gss_release_oid_set(&min_stat, &mechlist);
+		if (maj_stat != GSS_S_COMPLETE) {
+			options_ret->major_status = maj_stat;
+			options_ret->minor_status = min_stat;
+			goto out;
+		}
+	}
+
 	principal_desc.value = (void *)gd->gd_principal;
 	principal_desc.length = strlen(gd->gd_principal);
 	maj_stat = gss_import_name(&min_stat, &principal_desc,
@@ -1036,6 +1125,8 @@ rpc_gss_destroy(AUTH *auth)
 	CLNT_RELEASE(gd->gd_clnt);
 	crfree(gd->gd_ucred);
 	free(gd->gd_principal, M_RPC);
+	if (gd->gd_clntprincipal != NULL)
+		free(gd->gd_clntprincipal, M_RPC);
 	if (gd->gd_verf.value)
 		xdr_free((xdrproc_t) xdr_gss_buffer_desc,
 		    (char *) &gd->gd_verf);

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Mon Jul  8 21:25:12 2013	(r253048)
+++ head/sys/sys/param.h	Tue Jul  9 01:05:28 2013	(r253049)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1000035	/* Master, propagated to newvers */
+#define __FreeBSD_version 1000036	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 01:07:07 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 8456557E;
 Tue,  9 Jul 2013 01:07:07 +0000 (UTC) (envelope-from gad@FreeBSD.org)
Received: from smtp9.server.rpi.edu (smtp9.server.rpi.edu [128.113.2.229])
 by mx1.freebsd.org (Postfix) with ESMTP id 308411A3A;
 Tue,  9 Jul 2013 01:07:06 +0000 (UTC)
Received: from gilead.netel.rpi.edu (gilead.netel.rpi.edu [128.113.124.121])
 by smtp9.server.rpi.edu (8.14.3/8.14.3/Debian-9.4) with ESMTP id
 r6916xOx016902; Mon, 8 Jul 2013 21:07:00 -0400
Message-ID: <51DB6233.1040003@FreeBSD.org>
Date: Mon, 08 Jul 2013 21:06:59 -0400
From: Garance A Drosehn 
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
 rv:1.9.1.9) Gecko/20100722 Eudora/3.0.4
MIME-Version: 1.0
To: Alfred Perlstein 
Subject: Re: svn commit: r253002 - head
References: <201307072039.r67KdCdR028908@svn.freebsd.org>
In-Reply-To: <201307072039.r67KdCdR028908@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Bayes-Prob: 0.1473 (Score 0, tokens from: local, @@RPTN)
X-Spam-Score: 3.00 (***) [Hold at 10.10] SPF(softfail:3)
X-CanIt-Incident-Id: 02JW16Xd7
X-CanIt-Geo: ip=128.113.124.121; country=US; region=NY; city=Troy;
 postalcode=12180; latitude=42.7495; longitude=-73.5951; metrocode=532;
 areacode=518; http://maps.google.com/maps?q=42.7495,-73.5951&z=6
X-CanItPRO-Stream: local
X-Canit-Stats-ID: Bayes signature not available
X-Scanned-By: CanIt (www . roaringpenguin . com) on 128.113.2.229
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 01:07:07 -0000

On 7/7/13 4:39 PM, Alfred Perlstein wrote:
>
> Log:
>    Document tip on how to build all kernels quickly.
>
>
> Modified: head/Makefile
> ==============================================================================
> --- head/Makefile	Sun Jul  7 19:58:14 2013	(r253001)
> +++ head/Makefile	Sun Jul  7 20:39:11 2013	(r253002)
> @@ -32,6 +32,12 @@
>   # targets             - Print a list of supported TARGET/TARGET_ARCH pairs
>   #                       for world and kernel targets.
>   # toolchains          - Build a toolchain for all world and kernel targets.
> +#
> +# "quick" way to test all kernel builds:
> +# 	_jflag=`sysctl -n hw.ncpu`
> +# 	_jflag=$(($_jflag * 2))
> +# 	[ $_jflag -gt 12 ]&&  _jflag=12
> +# 	make universe -DMAKE_JUST_KERNELS JFLAG=${jflag}
>   #
>   # This makefile is simple by design. [...]

I think it's probably helpful to point out the -j flag, but I'm
not sure I would phrase it as if we're sure that the values here
are the ideal ones.  I expect the ideal values depend too much on
hardware (e.g.: the CPU, type of disk used, and amount of memory
on the machine).  I did a lot of benchmarks of -j a few years
ago on the few machines I owned.  In my case, when I averaged
the results across my machines, the ideal value was more like
ncpu+1, not ncpu*2.

It wouldn't surprise me at all if the ideal value has changed
since I did that.  And it wouldn't surprise me if the ideal
value changes again in the next two years, especially when
one considers the variety of hardware architectures that
FreeBSD runs on.

It's good to mention the make command, the -DMAKE_JUST_KERNELS,
and that using the JFLAG can speed things up.  But I think it
should be said that this min(jcpu*2, 12) recommendation works
well for some hardware, but that people might need to do their
own checking to see what value will work best on their hardware.

Put some short and generic recommendation in the makefile, and
then point people at a man page or some other documentation
for a more detailed explanation.  IMO.

-- 
Garance Alistair Drosehn                =     drosih@rpi.edu
Senior Systems Programmer               or   gad@FreeBSD.org
Rensselaer Polytechnic Institute;             Troy, NY;  USA

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 01:41:22 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 25C03C4F;
 Tue,  9 Jul 2013 01:41:22 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 167A81BA4;
 Tue,  9 Jul 2013 01:41:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r691fLbX092827;
 Tue, 9 Jul 2013 01:41:21 GMT (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r691VaIA090189;
 Tue, 9 Jul 2013 01:31:36 GMT (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201307090131.r691VaIA090189@svn.freebsd.org>
From: Rick Macklem 
Date: Tue, 9 Jul 2013 01:31:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253051 - head/sbin/mount_nfs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 01:41:22 -0000

Author: rmacklem
Date: Tue Jul  9 01:31:36 2013
New Revision: 253051
URL: http://svnweb.freebsd.org/changeset/base/253051

Log:
  Document the "gssname" and "allgssname" mount options added by the
  host-based initiator credential patches.
  This is a content change.

Modified:
  head/sbin/mount_nfs/mount_nfs.8

Modified: head/sbin/mount_nfs/mount_nfs.8
==============================================================================
--- head/sbin/mount_nfs/mount_nfs.8	Tue Jul  9 01:31:04 2013	(r253050)
+++ head/sbin/mount_nfs/mount_nfs.8	Tue Jul  9 01:31:36 2013	(r253051)
@@ -28,7 +28,7 @@
 .\"	@(#)mount_nfs.8	8.3 (Berkeley) 3/29/95
 .\" $FreeBSD$
 .\"
-.Dd December 9, 2012
+.Dd July 8, 2013
 .Dt MOUNT_NFS 8
 .Os
 .Sh NAME
@@ -118,6 +118,13 @@ for regular files, and 30 -> 60 seconds 
 The algorithm to calculate the timeout is based on the age of the file.
 The older the file,
 the longer the cache is considered valid, subject to the limits above.
+.It Cm allgssname
+This option can be used along with
+.Fl o Cm gssname
+to specify that all operations should use the host-based initiator
+credential.
+This may be used for clients that run system daemons that need to
+access files on the NFSv4 mounted volume.
 .It Cm bg
 If an initial attempt to contact the server fails, fork off a child to keep
 trying the mount in the background.
@@ -138,6 +145,23 @@ short.
 .It Cm fg
 Same as not specifying
 .Cm bg .
+.It Cm gssname Ns = Ns Aq Ar service-principal-name
+This option can be used with the KerberosV security flavors for NFSv4 mounts
+to specify the
+.Dq "service-principal-name"
+of a host-based entry in the default
+keytab file that is used for system operations.
+It allows the mount to be performed by
+.Dq "root"
+and avoids problems with
+cached credentials for the system operations expiring.
+The
+.Dq "service-prinicpal-name"
+should be specified without instance or domain and is typically
+.Dq "host" ,
+.Dq "nfs"
+or
+.Dq "root" .
 .It Cm hard
 Same as not specifying
 .Cm soft .

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 01:41:22 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 5987AC50;
 Tue,  9 Jul 2013 01:41:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 32BBD1BA5;
 Tue,  9 Jul 2013 01:41:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r691fLbZ092827;
 Tue, 9 Jul 2013 01:41:22 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r691V4wJ090149;
 Tue, 9 Jul 2013 01:31:04 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201307090131.r691V4wJ090149@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Tue, 9 Jul 2013 01:31:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253050 - head/sys/fs/ext2fs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 01:41:22 -0000

Author: pfg
Date: Tue Jul  9 01:31:04 2013
New Revision: 253050
URL: http://svnweb.freebsd.org/changeset/base/253050

Log:
  Enhancement when writing an entire block of a file.
  
  Merge from UFS r231313:
  
  This change first attempts the uiomove() to the newly allocated
  (and dirty) buffer and only zeros it if the uiomove() fails. The
  effect is to eliminate the gratuitous zeroing of the buffer in
  the usual case where the uiomove() successfully fills it.
  
  MFC after:	3 days

Modified:
  head/sys/fs/ext2fs/ext2_vnops.c

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vnops.c	Tue Jul  9 01:05:28 2013	(r253049)
+++ head/sys/fs/ext2fs/ext2_vnops.c	Tue Jul  9 01:31:04 2013	(r253050)
@@ -1812,15 +1812,6 @@ ext2_write(struct vop_write_args *ap)
 		if (error != 0)
 			break;
 
-		/*
-		 * If the buffer is not valid and we did not clear garbage
-		 * out above, we have to do so here even though the write
-		 * covers the entire buffer in order to avoid a mmap()/write
-		 * race where another process may see the garbage prior to
-		 * the uiomove() for a write replacing it.
-		 */
-		if ((bp->b_flags & B_CACHE) == 0 && fs->e2fs_bsize <= xfersize)
-			vfs_bio_clrbuf(bp);
 		if ((ioflag & (IO_SYNC|IO_INVAL)) == (IO_SYNC|IO_INVAL))
 			bp->b_flags |= B_NOCACHE;
 		if (uio->uio_offset + xfersize > ip->i_size)
@@ -1831,6 +1822,26 @@ ext2_write(struct vop_write_args *ap)
 
 		error =
 		    uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio);
+		/*
+		 * If the buffer is not already filled and we encounter an
+		 * error while trying to fill it, we have to clear out any
+		 * garbage data from the pages instantiated for the buffer.
+		 * If we do not, a failed uiomove() during a write can leave
+		 * the prior contents of the pages exposed to a userland mmap.
+		 *
+		 * Note that we need only clear buffers with a transfer size
+		 * equal to the block size because buffers with a shorter
+		 * transfer size were cleared above by the call to ext2_balloc()
+		 * with the BA_CLRBUF flag set.
+		 *
+		 * If the source region for uiomove identically mmaps the
+		 * buffer, uiomove() performed the NOP copy, and the buffer
+		 * content remains valid because the page fault handler
+		 * validated the pages.
+		 */
+		if (error != 0 && (bp->b_flags & B_CACHE) == 0 &&
+		    fs->e2fs_bsize == xfersize)
+			vfs_bio_clrbuf(bp);
 		if (ioflag & (IO_VMIO|IO_DIRECT)) {
 			bp->b_flags |= B_RELBUF;
 		}

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 01:55:35 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 735D0263;
 Tue,  9 Jul 2013 01:55:35 +0000 (UTC)
 (envelope-from emaste@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 661691C73;
 Tue,  9 Jul 2013 01:55:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r691tZ4H096176;
 Tue, 9 Jul 2013 01:55:35 GMT (envelope-from emaste@svn.freebsd.org)
Received: (from emaste@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r691tZBD096175;
 Tue, 9 Jul 2013 01:55:35 GMT (envelope-from emaste@svn.freebsd.org)
Message-Id: <201307090155.r691tZBD096175@svn.freebsd.org>
From: Ed Maste 
Date: Tue, 9 Jul 2013 01:55:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253052 - head/sys/arm/arm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 01:55:35 -0000

Author: emaste
Date: Tue Jul  9 01:55:34 2013
New Revision: 253052
URL: http://svnweb.freebsd.org/changeset/base/253052

Log:
  Remove extraneous format string converison specifier
  
  Submitted by:	wxs@

Modified:
  head/sys/arm/arm/pmap-v6.c

Modified: head/sys/arm/arm/pmap-v6.c
==============================================================================
--- head/sys/arm/arm/pmap-v6.c	Tue Jul  9 01:31:36 2013	(r253051)
+++ head/sys/arm/arm/pmap-v6.c	Tue Jul  9 01:55:34 2013	(r253052)
@@ -3336,7 +3336,7 @@ pmap_pv_reclaim(pmap_t locked_pmap)
 				m = PHYS_TO_VM_PAGE(l2pte_pa(*ptep));
 				KASSERT((vm_offset_t)m >= KERNBASE,
 				    ("Trying to access non-existent page "
-				     "va %x pte %x in %s", va, *ptep));
+				     "va %x pte %x", va, *ptep));
 				*ptep = 0;
 				PTE_SYNC(ptep);
 				pmap_nuke_pv(m, pmap, pv);

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 02:50:05 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 9D628F85;
 Tue,  9 Jul 2013 02:50:05 +0000 (UTC)
 (envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 908591FDA;
 Tue,  9 Jul 2013 02:50:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r692o5D3011561;
 Tue, 9 Jul 2013 02:50:05 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r692o5sG011560;
 Tue, 9 Jul 2013 02:50:05 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201307090250.r692o5sG011560@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 9 Jul 2013 02:50:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253053 - head/sys/arm/ti
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 02:50:05 -0000

Author: rpaulo
Date: Tue Jul  9 02:50:05 2013
New Revision: 253053
URL: http://svnweb.freebsd.org/changeset/base/253053

Log:
  Improve a comment.

Modified:
  head/sys/arm/ti/ti_mmchs.c

Modified: head/sys/arm/ti/ti_mmchs.c
==============================================================================
--- head/sys/arm/ti/ti_mmchs.c	Tue Jul  9 01:55:34 2013	(r253052)
+++ head/sys/arm/ti/ti_mmchs.c	Tue Jul  9 02:50:05 2013	(r253053)
@@ -212,11 +212,9 @@ ti_mmchs_reset_controller(struct ti_mmch
 
 	sysctl = ti_mmchs_read_4(sc, MMCHS_SYSCTL);
 	ti_mmchs_write_4(sc, MMCHS_SYSCTL, sysctl | bit);
-
-
 	/* 
-	 * AM335x and OMAP4 ES2 and greater has an updated reset logic.
-	 * Monitor a 0->1 transition first
+	 * AM335x and OMAP4 >= ES2 have an updated reset logic.
+	 * Monitor a 0->1 transition first.
 	 */
 	if ((ti_chip() == CHIP_AM335X) || 
 	    ((ti_chip() == CHIP_OMAP_4) && (ti_revision() > OMAP4430_REV_ES1_0))) {

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 03:00:06 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id B20AE33F;
 Tue,  9 Jul 2013 03:00:06 +0000 (UTC)
 (envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id A519A1090;
 Tue,  9 Jul 2013 03:00:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69306nf014319;
 Tue, 9 Jul 2013 03:00:06 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69306mq014318;
 Tue, 9 Jul 2013 03:00:06 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201307090300.r69306mq014318@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 9 Jul 2013 03:00:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253054 - head/sys/dev/mmc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 03:00:06 -0000

Author: rpaulo
Date: Tue Jul  9 03:00:06 2013
New Revision: 253054
URL: http://svnweb.freebsd.org/changeset/base/253054

Log:
  Use meaningful names when creating mmc/sd threads.
  
  This can be useful when we want to be able to identify which mmcsd is stuck.

Modified:
  head/sys/dev/mmc/mmcsd.c

Modified: head/sys/dev/mmc/mmcsd.c
==============================================================================
--- head/sys/dev/mmc/mmcsd.c	Tue Jul  9 02:50:05 2013	(r253053)
+++ head/sys/dev/mmc/mmcsd.c	Tue Jul  9 03:00:06 2013	(r253054)
@@ -199,7 +199,8 @@ mmcsd_attach(device_t dev)
 	sc->running = 1;
 	sc->suspend = 0;
 	sc->eblock = sc->eend = 0;
-	kproc_create(&mmcsd_task, sc, &sc->p, 0, 0, "task: mmc/sd card");
+	kproc_create(&mmcsd_task, sc, &sc->p, 0, 0, "%s: mmc/sd card", 
+	    device_get_nameunit(dev));
 
 	return (0);
 }
@@ -260,7 +261,8 @@ mmcsd_resume(device_t dev)
 	if (sc->running <= 0) {
 		sc->running = 1;
 		MMCSD_UNLOCK(sc);
-		kproc_create(&mmcsd_task, sc, &sc->p, 0, 0, "task: mmc/sd card");
+		kproc_create(&mmcsd_task, sc, &sc->p, 0, 0, "%s: mmc/sd card",
+		    device_get_nameunit(dev));
 	} else
 		MMCSD_UNLOCK(sc);
 	return (0);

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 05:01:41 2013
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 02EF084D;
 Tue,  9 Jul 2013 05:01:41 +0000 (UTC) (envelope-from sjg@juniper.net)
Received: from db9outboundpool.messaging.microsoft.com
 (mail-db9lp0251.outbound.messaging.microsoft.com [213.199.154.251])
 by mx1.freebsd.org (Postfix) with ESMTP id 646C217DB;
 Tue,  9 Jul 2013 05:01:39 +0000 (UTC)
Received: from mail96-db9-R.bigfish.com (10.174.16.237) by
 DB9EHSOBE014.bigfish.com (10.174.14.77) with Microsoft SMTP Server id
 14.1.225.22; Tue, 9 Jul 2013 04:31:21 +0000
Received: from mail96-db9 (localhost [127.0.0.1])	by mail96-db9-R.bigfish.com
 (Postfix) with ESMTP id 2E24A2400BD;
 Tue,  9 Jul 2013 04:31:21 +0000 (UTC)
X-Forefront-Antispam-Report: CIP:66.129.224.50; KIP:(null); UIP:(null); IPV:NLI;
 H:P-EMHUB02-HQ.jnpr.net; RD:none; EFVD:NLI
X-SpamScore: 3
X-BigFish: VPS3(zzzz1f42h1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6h1082kzzz2fh2a8h668h839hd25hf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14ddh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b88h1d0ch1d2eh1d3fh1de2h1dfeh1dffh1e23h1155h)
Received-SPF: pass (mail96-db9: domain of juniper.net designates 66.129.224.50
 as permitted sender) client-ip=66.129.224.50; envelope-from=sjg@juniper.net;
 helo=P-EMHUB02-HQ.jnpr.net ; -HQ.jnpr.net ; 
Received: from mail96-db9 (localhost.localdomain [127.0.0.1]) by mail96-db9
 (MessageSwitch) id 1373344280130171_4924; Tue,  9 Jul 2013 04:31:20 +0000
 (UTC)
Received: from DB9EHSMHS030.bigfish.com (unknown [10.174.16.238])	by
 mail96-db9.bigfish.com (Postfix) with ESMTP id 1A2ED80046;	Tue,  9 Jul 2013
 04:31:20 +0000 (UTC)
Received: from P-EMHUB02-HQ.jnpr.net (66.129.224.50) by
 DB9EHSMHS030.bigfish.com (10.174.14.40) with Microsoft SMTP Server (TLS) id
 14.16.227.3; Tue, 9 Jul 2013 04:31:19 +0000
Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB02-HQ.jnpr.net
 (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Mon, 8 Jul
 2013 21:31:18 -0700
Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229])	by
 magenta.juniper.net (8.11.3/8.11.3) with ESMTP id r694VIL63577;	Mon, 8 Jul
 2013 21:31:18 -0700 (PDT)	(envelope-from sjg@juniper.net)
Received: from chaos.jnpr.net (localhost [127.0.0.1])	by chaos.jnpr.net
 (Postfix) with ESMTP id C181758097;	Mon,  8 Jul 2013 21:31:17 -0700 (PDT)
To: Devin Teske 
Subject: Re: svn commit: r253002 - head
In-Reply-To: <13CA24D6AB415D428143D44749F57D7201FB7609@ltcfiswmsgmb21>
References: <201307072039.r67KdCdR028908@svn.freebsd.org>
 <9D4C7540-A3B0-45E5-8219-6A455D41DF70@gmail.com>
 <51D9DA55.2090808@freebsd.org>
 <13CA24D6AB415D428143D44749F57D7201FB7609@ltcfiswmsgmb21>
Comments: In-reply-to: "Teske, Devin" 
 message dated "Tue, 09 Jul 2013 00:12:22 -0000."
From: "Simon J. Gerraty" 
X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1
Date: Mon, 8 Jul 2013 21:31:17 -0700
Message-ID: <20130709043117.C181758097@chaos.jnpr.net>
MIME-Version: 1.0
Content-Type: text/plain
X-OriginatorOrg: juniper.net
X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn%
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 Alfred Perlstein ,
 "src-committers@freebsd.org" ,
 Garrett Cooper 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 05:01:41 -0000

>We've run as high as -j48 ... number of logical cpu's "times-two" (it was o=
>n a box with 24 logical CPUs).

We've (ok dhw@ has) done a lot of empirical measurement
to determine optimal jobs_factor numbers for various machines.
Right now we are using .75 for boxes with > 16 cores.
For smaller boxes we use up to 1.5

Scaling on NUMA boxes is a sore point ;-)
If someone could get FreeBSD to scale on larger (64 core) NUMA boxes
that would be excellent.



From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 05:36:25 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 08AE1C56;
 Tue,  9 Jul 2013 05:36:25 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au
 [211.29.132.246])
 by mx1.freebsd.org (Postfix) with ESMTP id 7A97318D2;
 Tue,  9 Jul 2013 05:36:23 +0000 (UTC)
Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au
 (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23])
 by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 9C4BA420985;
 Tue,  9 Jul 2013 15:36:15 +1000 (EST)
Date: Tue, 9 Jul 2013 15:36:13 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: "Pedro F. Giffuni" 
Subject: Re: svn commit: r253045 - head/sys/fs/ext2fs
In-Reply-To: <201307082021.r68KLanT005030@svn.freebsd.org>
Message-ID: <20130709131546.K1312@besplex.bde.org>
References: <201307082021.r68KLanT005030@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.0 cv=Q6eKePKa c=1 sm=1 a=Ot8oeJroF2sA:10
 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=AD96D3NyImQA:10
 a=UqKkTzXlbx42FBnIQX8A:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, kib@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 05:36:25 -0000

On Mon, 8 Jul 2013, Pedro F. Giffuni wrote:

> Log:
>  Avoid a panic and return EINVAL instead.
>
>  Merge from UFS r232692:
>  syscall() fuzzing can trigger this panic.

This breaks the assertion without fixing the bug.

I don't know what is in the inscrutable reference r232692, but UFS doesn't
exist, and ffs still has the assertions.  Even ext2fs_write() still has
the assertions.

> Modified: head/sys/fs/ext2fs/ext2_vnops.c
> ==============================================================================
> --- head/sys/fs/ext2fs/ext2_vnops.c	Mon Jul  8 19:40:50 2013	(r253044)
> +++ head/sys/fs/ext2fs/ext2_vnops.c	Mon Jul  8 20:21:36 2013	(r253045)
> @@ -1598,11 +1598,11 @@ ext2_read(struct vop_read_args *ap)
> 	} else if (vp->v_type != VREG && vp->v_type != VDIR)
> 		panic("%s: type %d", "ext2_read", vp->v_type);
> #endif
> +	if (uio->uio_resid < 0 || uio->uio_offset < 0)
> +		return (EINVAL);
> 	orig_resid = uio->uio_resid;
> -	KASSERT(orig_resid >= 0, ("ext2_read: uio->uio_resid < 0"));
> 	if (orig_resid == 0)
> 		return (0);

Syscall fuzzing doesn't trigger this panic.  One of the many type errors
in ext2fs used to be trigger this panic.  Now this type error just gives
EINVAL for valid syscalls.

The type error is that orig_resid stil has type int, but uio->uio_resid
has type ssize_t.  SSIZE_MAX is is perfectly broken to POSIX spec, so
on 64-bit arches ssize_t is int64_t and SSIZE_MAX is 2**63-1.  So on
64-bit arches, anyone can easily trigger the panic using invalid syscall
args where uio->uio_resid is larger than INT_MAX and this is larger
than the buffer; anyone with a large amount of virtual memory and a
large data segment size limit can not quite so easily trigger the panic
using valid syscall args where uio->uio_resid is larger than INT_MAX
and this is not larger than the buffer.  Assignment to orig_resid then
overflows.  The behaviour is implementation-defined and is normally
to truncate the value (the FreeBSD implementation is missing
documentation to say this).  Sometimes the result is negative so the
error is detected.  Othertimes a truncated positive or zero value is
used, and the final result either a too-short i/o (if more than the
truncated count could be done) or actually correct (if the i/o is a
read() and EOF is reached before the non-truncated part of the count
is needed).

> -	KASSERT(uio->uio_offset >= 0, ("ext2_read: uio->uio_offset < 0"));
> 	fs = ip->i_e2fs;
> 	if (uio->uio_offset < ip->i_size &&
> 	    uio->uio_offset >= fs->e2fs_maxfilesize)

This part of the change is just wrong.  uio->uio_offset is not copied to
a local variable of either the correct type or a wrong type, and there are
no problems with checking it directly.  Also, it has been 64 bits on all
arches in FreeBSD since FreeBSD-2, so doing a wrong check of it here is
presumably not necessary for avoiding worse problems later.

This commit doesn't change the KASSERT()s in ext2_write().  Now the
truncation bug doesn't affect the first KASSERT(), since uio->uio_resid
is not corrupted before checking it.

I thought that kib swept the tree to fix all the resid types to ssize_t
when he expanded the limit for read() and write(), etc.  Grep shows
that orig_resid has the correct type in all file systems in /sys/fs
except ext2fs.  It is spelled the same in ext2fs, msdosfs and nfsclient.
udf doesn't need it since its only use in the other file systems is to
handle setting of atime at the end, and udf is read-only.  But udf has
the following bugs handling uio->uio_resid: in udf_read():
- uio->uio_resid < 0 is not checked on entry, either to return EINVAL
   or panic.  Of course, this can't happen and the check doesn't belong
   in every file system.  Perhaps it could be moved to VOP_READ() and
   VOP_WRITE(), and omitted there more often than most KASSERT()s.
- uio->uio_resid == 0 is checked on entry.  Most or all file systems do
   this, but I think this can't happen either.
- uio->uio_offset < 0 is checked on entry, but not under a KASSERT() as
   on most file systems.  Putting it under KASSERT() saves space when
   invariants are not configured.
- uio->uio_resid is assigned to a variable n of the correct type.  The
   code using this seems to be OK.
- there is the following very bad code:
 		n = min((u_int)(udfmp->bsize - on),
 			uio->uio_resid);
   Here n has the correct type, but min() corrupts its uio->uio_resid arg
   to u_int.  The corruption gives much the same implementation-defined
   bugs as truncation by assignment to "int uio_resid", except more than
   1 of the misbehaviours may occur in a single syscall as uio->resid
   mod 2**32 crosses the 0 boundary.

   This and related code has many style bugs:
   - bogus cast to u_int.  min() converts both its args to u_int.  The
     conversion is normally (too) silent and the cast is even more silent.
     So the cast can at most break warnings about dubious types.
   - dubious and wrong types include:
        ssize_t n
        long size, on
     Except for the previous unrelated use of n, these variables are all for
     the block size and small offsets within a block.  They should have type
     int or u_int.  'on' is short for "old n".  It should have the same type
     as n.  I think the type of n was changed to ssize_t so that its other
     use was correct.  But it shouldn't have been used for unrelated variables.
   - n is bogusly cast to int in the call to uiomove() later.  I think this
     dates from 1980's code that this was cloned from (n had type long for
     bogus reasons, but fitted on an int, and uiomove() wasn't prototyped
     so this cast was required to support K&R).

Not quite similarly in cd9660_read().  It was just like udf_read() except
its n is not aboved for an unrelated purpose and it still has type long.
'long' is accidentally the same as ssize_t on all supported arches, but
isn't used to hold uio->uio_resid, and using it for n is bogus too, as
above above.  cd9660_read() used to use min() in the same place as
udf_read().  But someone fixed the corruption of uio->uio_resid in
min() by changing min() to MIN().  Using MIN() is a style bug.  It was
intentionally left out of 4.4BSD in the kernel, but contribed code kept
using this deprecated KPI and the KPI was broken to match and then non-
contribed code started using it too :-(.  MIN() has the disadvantages
of being unsafe and ugly.  The min() family has the disadantage of not
being type-generic; type errors using it are common.

Not similarly in devfs.  devfs_read() spells orig_resid worse as plain
resid, but doesn't have the type error.

Not similarly in fdescfs.  It uses uio_resid in fdesc_readdir().  It
has a lower limit of UIO_MAX instead of 1.  Similarly in fuse.

Not similarly in nandfs.  It doesn't check for uio_resid < 0.  It
replaces min() by omin().  This gives another type that is harmless
in practice.  omin() is for off_t's, but is used with an ssize_t
resid and an off_t filesize, after previously corrupting the filesize
variable from a uint64_t to an off_t.  64 bits signed should be enough
for anyone.  The logic seems to be broken if uio_resid < 0 actually
occurs.

Not similarly in pseudofs.  pfs_read() checks correctly for uio_resid < 0,
but handles this by returning EINVAL instead of KASSERT().  It has a
variable resid of type ssize_t, but doesn't do anything with this except
assign uio_resid to it so as to get an overflow if the types are broken
and the value doesn't fit.  This made more  sense when resid had type int.
It still has an INT_MAX limit on buflen and a bogus overflow check for
buflen (check for overflow after overflow has already caused undefined
behaviour).  The undefined behaviour can still easily occur on 32-bit
systems, since exoanding resid and buflen to ssize_t doesn't really
change them on 32-bit systems.  pfs_readdir() still assigns uio_resid
to "int resid".  Then it has a lower limit of more than 0 on resid,
as in fdesc_readdir() but now the check is broken since uio_resid was
corrupted by assignment to resid.

Not similarly in tmpfs.  tmpfs manages to combine most of the bugs.
tmpfs_read() starts with "int resid".  Then it has null sanity checking
for uio_resid (it does check uio_offset and handles it using EINVAL
instead of KASSERT().) Then it corrupts uio_resid by assigning it to
resid in the main loop.  The loop continuation criterion is that
corrupted resid is > 0.  Of course it uses the MIN() style bug.  It
doesn't use the old 'n' and 'on' variable names.  tmpfs_write() also
uses "int resid", but first does some checks using the uncorrupted
uio_resid.  The one for EFBIG depends on undefined behaviour to work.
Where ffs carefully casts the offset + resid expression to use uoff_t,
tmpfs lets it overflow and then converts the result to u_int64_t (sic),
provided off_t is no larger than 64 bits.  Normally the overflow is
benign and off_t is 64 bits, so this works.  Many cases where uio_resid
< 0 are detected accidentally here, since they cause offset + resid
to be negative and converting this this to u_int64_t often overflows
to a value > maxfilesize.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 05:39:37 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id C4044DB6;
 Tue,  9 Jul 2013 05:39:37 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au
 [211.29.132.97])
 by mx1.freebsd.org (Postfix) with ESMTP id 72BED18E6;
 Tue,  9 Jul 2013 05:39:37 +0000 (UTC)
Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au
 (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23])
 by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 16B6978104C;
 Tue,  9 Jul 2013 15:39:30 +1000 (EST)
Date: Tue, 9 Jul 2013 15:39:29 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: "Pedro F. Giffuni" 
Subject: Re: svn commit: r253050 - head/sys/fs/ext2fs
In-Reply-To: <201307090131.r691V4wJ090149@svn.freebsd.org>
Message-ID: <20130709153911.R1312@besplex.bde.org>
References: <201307090131.r691V4wJ090149@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.0 cv=eqSHVfVX c=1 sm=1 a=90iWynEP2-8A:10
 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=AD96D3NyImQA:10
 a=6I5d2MoRAAAA:8 a=KuIX9Q-2l-uLVCl-5lUA:9 a=CjuIK1q_8ugA:10
 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 05:39:37 -0000



On Tue, 9 Jul 2013, Pedro F. Giffuni wrote:

> Author: pfg
> Date: Tue Jul  9 01:31:04 2013
> New Revision: 253050
> URL: http://svnweb.freebsd.org/changeset/base/253050
>
> Log:
>  Enhancement when writing an entire block of a file.
>
>  Merge from UFS r231313:
>
>  This change first attempts the uiomove() to the newly allocated
>  (and dirty) buffer and only zeros it if the uiomove() fails. The
>  effect is to eliminate the gratuitous zeroing of the buffer in
>  the usual case where the uiomove() successfully fills it.
>
>  MFC after:	3 days
>
> Modified:
>  head/sys/fs/ext2fs/ext2_vnops.c
>
> Modified: head/sys/fs/ext2fs/ext2_vnops.c
> ==============================================================================
> --- head/sys/fs/ext2fs/ext2_vnops.c	Tue Jul  9 01:05:28 2013	(r253049)
> +++ head/sys/fs/ext2fs/ext2_vnops.c	Tue Jul  9 01:31:04 2013	(r253050)
> @@ -1812,15 +1812,6 @@ ext2_write(struct vop_write_args *ap)
> 		if (error != 0)
> 			break;
>
> -		/*
> -		 * If the buffer is not valid and we did not clear garbage
> -		 * out above, we have to do so here even though the write
> -		 * covers the entire buffer in order to avoid a mmap()/write
> -		 * race where another process may see the garbage prior to
> -		 * the uiomove() for a write replacing it.
> -		 */
> -		if ((bp->b_flags & B_CACHE) == 0 && fs->e2fs_bsize <= xfersize)
> -			vfs_bio_clrbuf(bp);
> 		if ((ioflag & (IO_SYNC|IO_INVAL)) == (IO_SYNC|IO_INVAL))
> 			bp->b_flags |= B_NOCACHE;
> 		if (uio->uio_offset + xfersize > ip->i_size)
> @@ -1831,6 +1822,26 @@ ext2_write(struct vop_write_args *ap)
>
> 		error =
> 		    uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio);
> +		/*
> +		 * If the buffer is not already filled and we encounter an
> +		 * error while trying to fill it, we have to clear out any
> +		 * garbage data from the pages instantiated for the buffer.
> +		 * If we do not, a failed uiomove() during a write can leave
> +		 * the prior contents of the pages exposed to a userland mmap.
> +		 *
> +		 * Note that we need only clear buffers with a transfer size
> +		 * equal to the block size because buffers with a shorter
> +		 * transfer size were cleared above by the call to ext2_balloc()
> +		 * with the BA_CLRBUF flag set.
> +		 *
> +		 * If the source region for uiomove identically mmaps the
> +		 * buffer, uiomove() performed the NOP copy, and the buffer
> +		 * content remains valid because the page fault handler
> +		 * validated the pages.
> +		 */
> +		if (error != 0 && (bp->b_flags & B_CACHE) == 0 &&
> +		    fs->e2fs_bsize == xfersize)
> +			vfs_bio_clrbuf(bp);
> 		if (ioflag & (IO_VMIO|IO_DIRECT)) {
> 			bp->b_flags |= B_RELBUF;
> 		}
>

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 05:42:53 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id E6767F23;
 Tue,  9 Jul 2013 05:42:53 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au
 [211.29.132.246])
 by mx1.freebsd.org (Postfix) with ESMTP id 95CCA190B;
 Tue,  9 Jul 2013 05:42:53 +0000 (UTC)
Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au
 (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23])
 by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id BA825420417;
 Tue,  9 Jul 2013 15:42:51 +1000 (EST)
Date: Tue, 9 Jul 2013 15:42:50 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Bruce Evans 
Subject: Re: svn commit: r253050 - head/sys/fs/ext2fs
In-Reply-To: <20130709153911.R1312@besplex.bde.org>
Message-ID: <20130709154027.R1664@besplex.bde.org>
References: <201307090131.r691V4wJ090149@svn.freebsd.org>
 <20130709153911.R1312@besplex.bde.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.0 cv=Q6eKePKa c=1 sm=1 a=90iWynEP2-8A:10
 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=AD96D3NyImQA:10
 a=wVVh87SqMG8e3yxj5-0A:9 a=CjuIK1q_8ugA:10 a=8VGHg2_nSw8A:10
 a=_91Mhe1s9AIA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 "Pedro F. Giffuni" , src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 05:42:54 -0000

On Tue, 9 Jul 2013, Bruce Evans wrote:

> On Tue, 9 Jul 2013, Pedro F. Giffuni wrote:
>> ...
>> Log:
>>  Enhancement when writing an entire block of a file.
>> 
>>  Merge from UFS r231313:
>> ...

Oops, I didn't mean to reply to that (it seemed to be correct :-), and
just quoted it all.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 05:45:16 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 3C07F10A
 for ; Tue,  9 Jul 2013 05:45:16 +0000 (UTC)
 (envelope-from peter@wemm.org)
Received: from mail-vb0-x230.google.com (mail-vb0-x230.google.com
 [IPv6:2607:f8b0:400c:c02::230])
 by mx1.freebsd.org (Postfix) with ESMTP id EE0CE1921
 for ; Tue,  9 Jul 2013 05:45:15 +0000 (UTC)
Received: by mail-vb0-f48.google.com with SMTP id w15so4023217vbf.21
 for ; Mon, 08 Jul 2013 22:45:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=gYHq3ku4q4DQYe5BqaWU1PCPRkNohmxzDi8vafFtyCI=;
 b=MX/kqkgv+XKVRIsAVHzAMWy90ZJ5n98SPo9KKR2PZ01IEp4npqGCkT2OKa6pcevBoN
 jBpbstT+VJIGW2vGoJS7DCwUD0Pzqxj+tIGIt6bEGoLLwmEISxOe2nZW1zGeab0RWl6H
 yGy1YaHdyIYyvv52orCbYKrbJAMvewr1CZVjw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=google.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type:x-gm-message-state;
 bh=gYHq3ku4q4DQYe5BqaWU1PCPRkNohmxzDi8vafFtyCI=;
 b=KOBaZR5GnU+75Cn/NpqdyfC/5hhe8CW8R4jfQZvHtabd6Xh124FCRBbGRUHRA82sIl
 cPDloO7U/FFwmOhClcQllma3PNGCxtOt210t6Qec3c7mueqJ3nKRC6htqjI2vobniooJ
 bkyZJ8g7lhuqH9Mbfutr4TSxRtNhX0eD4wqKQn51+5tzc1TlqdZwZu+gLLa7lGuXYzo2
 qI5fGp/GA8F2yMONH4q7QGd5gpddk+FtNEEqTny1hSYw3aOFFHP8d1jvdXa8zCJSEk8x
 l2yZeTQk5Mex74JLe9ClV/C28OqPx8i20Wvjczznxh10B7hw5TdtYX2UV/BeXse0WakV
 65DQ==
MIME-Version: 1.0
X-Received: by 10.220.47.131 with SMTP id n3mr15677249vcf.7.1373348715408;
 Mon, 08 Jul 2013 22:45:15 -0700 (PDT)
Received: by 10.221.37.198 with HTTP; Mon, 8 Jul 2013 22:45:15 -0700 (PDT)
In-Reply-To: <13CA24D6AB415D428143D44749F57D7201FB7609@ltcfiswmsgmb21>
References: <201307072039.r67KdCdR028908@svn.freebsd.org>
 <9D4C7540-A3B0-45E5-8219-6A455D41DF70@gmail.com>
 <51D9DA55.2090808@freebsd.org>
 <13CA24D6AB415D428143D44749F57D7201FB7609@ltcfiswmsgmb21>
Date: Mon, 8 Jul 2013 22:45:15 -0700
Message-ID: 
Subject: Re: svn commit: r253002 - head
From: Peter Wemm 
To: Devin Teske 
Content-Type: text/plain; charset=ISO-8859-1
X-Gm-Message-State: ALoCoQk3OBOkcSdj0Del3XWEE2VC6MU38ZA4GUHzacSnaOZpd2Kv0lyS5JTm7v60eyPcKC9b0F12
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 Alfred Perlstein ,
 "src-committers@freebsd.org" ,
 Garrett Cooper 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 05:45:16 -0000

On Mon, Jul 8, 2013 at 5:12 PM, Teske, Devin  wrote:
> On Jul 7, 2013, at 2:15 PM, Alfred Perlstein wrote:
>
>> On 7/7/13 2:01 PM, Garrett Cooper wrote:
>>> Why the magic number 12?
>>
>> Numbers higher seem to result in worse performance as reported by some members of my team.
>>
>
> We've run as high as -j48 ... number of logical cpu's "times-two" (it was on a box with 24 logical CPUs).

There's an additional constraint.  -j48 and 48 running instances of
clang++ and its memory demands when compiling C++ code each starts to
get non-trivial.

> We did buildworld in under 9 minutes. Beyond the "times-two" rule we saw a slow-down.
>
> NOTE: I might also mention this was on RAID-1 SSD.

On the cluster we get about 9 minutes on RELENG_9 with WITHOUT_CLANG.
About 11 minutes including the kernel.  Boring old disks with -j24.

I'd be pleasantly surprised if you were doing HEAD in < 9 minutes
given that it frequently fails to build with more than -j8 or -j10.
(I've heard this might be fixed.. but I'm skeptical as I had a -j2
race last week)

But we are talking about a commit giving advice for building kernels
here, right?

>>>> Log:
>>>>  Document tip on how to build all kernels quickly.

I used to use -j1000 to stress test context switching with a LINT
build - that was when we ran into FD_SETSIZE vs make.  Kernel builds
have always been highly tolerant of  very large -j values because
idiots like me used to use it to try and break things.

-- 
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV
UTF-8: So you can \342\200\231 .. for when a ' just won't do
 ZFS must be the bacon of file systems. "everything's better with ZFS"

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 07:03:54 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id ED72FF5C;
 Tue,  9 Jul 2013 07:03:54 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id E0DBE1C10;
 Tue,  9 Jul 2013 07:03:54 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6973st4087504;
 Tue, 9 Jul 2013 07:03:54 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6973sKc087503;
 Tue, 9 Jul 2013 07:03:54 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307090703.r6973sKc087503@svn.freebsd.org>
From: Hiroki Sato 
Date: Tue, 9 Jul 2013 07:03:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253057 - head/usr.sbin/rtadvd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 07:03:55 -0000

Author: hrs
Date: Tue Jul  9 07:03:54 2013
New Revision: 253057
URL: http://svnweb.freebsd.org/changeset/base/253057

Log:
  Add a missing white space.

Modified:
  head/usr.sbin/rtadvd/config.c

Modified: head/usr.sbin/rtadvd/config.c
==============================================================================
--- head/usr.sbin/rtadvd/config.c	Tue Jul  9 06:51:41 2013	(r253056)
+++ head/usr.sbin/rtadvd/config.c	Tue Jul  9 07:03:54 2013	(r253057)
@@ -1286,7 +1286,7 @@ make_prefix(struct rainfo *rai, int ifin
 
 	memset(&ipr, 0, sizeof(ipr));
 	if (if_indextoname(ifindex, ipr.ipr_name) == NULL) {
-		syslog(LOG_ERR, "<%s> Prefix added interface No.%d doesn't"
+		syslog(LOG_ERR, "<%s> Prefix added interface No.%d doesn't "
 		    "exist. This should not happen! %s", __func__,
 		    ifindex, strerror(errno));
 		exit(1);

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 07:08:36 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id BA7DC1C1;
 Tue,  9 Jul 2013 07:08:36 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id AD4F11C3D;
 Tue,  9 Jul 2013 07:08:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6978ae5088348;
 Tue, 9 Jul 2013 07:08:36 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6978aK3088347;
 Tue, 9 Jul 2013 07:08:36 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307090708.r6978aK3088347@svn.freebsd.org>
From: Hiroki Sato 
Date: Tue, 9 Jul 2013 07:08:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253058 - head/usr.sbin/rtadvd
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 07:08:36 -0000

Author: hrs
Date: Tue Jul  9 07:08:36 2013
New Revision: 253058
URL: http://svnweb.freebsd.org/changeset/base/253058

Log:
  - Add missing "static" keywords.
  - Add a check for ifindex to if_indextoifinfo().  It returns NULL when
    if_indextoname() fails.
  
  MFC after:	3 days

Modified:
  head/usr.sbin/rtadvd/rtadvd.c

Modified: head/usr.sbin/rtadvd/rtadvd.c
==============================================================================
--- head/usr.sbin/rtadvd/rtadvd.c	Tue Jul  9 07:03:54 2013	(r253057)
+++ head/usr.sbin/rtadvd/rtadvd.c	Tue Jul  9 07:08:36 2013	(r253058)
@@ -95,7 +95,7 @@ struct sockaddr_in6 rcvfrom;
 static const char *pidfilename = _PATH_RTADVDPID;
 const char *conffile = _PATH_RTADVDCONF;
 static struct pidfh *pfh;
-int dflag = 0, sflag = 0;
+static int dflag, sflag;
 static int wait_shutdown;
 
 #define	PFD_RAWSOCK	0
@@ -139,7 +139,7 @@ union nd_opt {
 #define NDOPT_FLAG_RDNSS	(1 << 5)
 #define NDOPT_FLAG_DNSSL	(1 << 6)
 
-uint32_t ndopt_flags[] = {
+static uint32_t ndopt_flags[] = {
 	[ND_OPT_SOURCE_LINKADDR]	= NDOPT_FLAG_SRCLINKADDR,
 	[ND_OPT_TARGET_LINKADDR]	= NDOPT_FLAG_TGTLINKADDR,
 	[ND_OPT_PREFIX_INFORMATION]	= NDOPT_FLAG_PREFIXINFO,
@@ -1637,6 +1637,11 @@ struct ifinfo *
 if_indextoifinfo(int idx)
 {
 	struct ifinfo *ifi;
+	char *name, name0[IFNAMSIZ];
+
+	/* Check if the interface has a valid name or not. */
+	if (if_indextoname(idx, name0) == NULL)
+		return (NULL);
 
 	TAILQ_FOREACH(ifi, &ifilist, ifi_next) {
 		if (ifi->ifi_ifindex == idx)

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 07:51:11 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id CB9FA502;
 Tue,  9 Jul 2013 07:51:11 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id BE1E81E64;
 Tue,  9 Jul 2013 07:51:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r697pBhR002093;
 Tue, 9 Jul 2013 07:51:11 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r697pBX3002091;
 Tue, 9 Jul 2013 07:51:11 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307090751.r697pBX3002091@svn.freebsd.org>
From: Hiroki Sato 
Date: Tue, 9 Jul 2013 07:51:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253059 - in stable/9/sys/dev/usb: . quirk
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 07:51:11 -0000

Author: hrs
Date: Tue Jul  9 07:51:11 2013
New Revision: 253059
URL: http://svnweb.freebsd.org/changeset/base/253059

Log:
  MFC r252501:
  
  Add Planex MZK-UE150N.
  
  Submitted by:	Yusuke Tanaka

Modified:
  stable/9/sys/dev/usb/quirk/usb_quirk.c
  stable/9/sys/dev/usb/usbdevs
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c
==============================================================================
--- stable/9/sys/dev/usb/quirk/usb_quirk.c	Tue Jul  9 07:08:36 2013	(r253058)
+++ stable/9/sys/dev/usb/quirk/usb_quirk.c	Tue Jul  9 07:51:11 2013	(r253059)
@@ -94,6 +94,7 @@ static struct usb_quirk_entry usb_quirks
 	USB_QUIRK(SILICONPORTALS, YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC),
 	USB_QUIRK(LOGITECH, UN53B, 0x0000, 0xffff, UQ_NO_STRINGS),
 	USB_QUIRK(ELSA, MODEM1, 0x0000, 0xffff, UQ_CFG_INDEX_1),
+	USB_QUIRK(PLANEX2, MZKUE150N, 0x0000, 0xffff, UQ_CFG_INDEX_1),
 	/* Quirks for printer devices */
 	USB_QUIRK(HP, 895C, 0x0000, 0xffff, UQ_BROKEN_BIDIR),
 	USB_QUIRK(HP, 880C, 0x0000, 0xffff, UQ_BROKEN_BIDIR),

Modified: stable/9/sys/dev/usb/usbdevs
==============================================================================
--- stable/9/sys/dev/usb/usbdevs	Tue Jul  9 07:08:36 2013	(r253058)
+++ stable/9/sys/dev/usb/usbdevs	Tue Jul  9 07:51:11 2013	(r253059)
@@ -3271,6 +3271,7 @@ product PLANEX2 GW_US54GXS	0x5303	GW-US5
 product PLANEX2 GWUS54HP	0xab01	GW-US54HP
 product PLANEX2 GWUS300MINIS	0xab24	GW-US300MiniS
 product PLANEX2	RT3070		0xab25	RT3070
+product PLANEX2 MZKUE150N	0xab2f	MZK-UE150N
 product PLANEX2 GWUS54MINI2	0xab50	GW-US54Mini2
 product PLANEX2 GWUS54SG	0xc002	GW-US54SG
 product PLANEX2 GWUS54GZL	0xc007	GW-US54GZL

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 07:55:47 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id E42766DF;
 Tue,  9 Jul 2013 07:55:47 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id BCCBD1E90;
 Tue,  9 Jul 2013 07:55:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r697tlXi002775;
 Tue, 9 Jul 2013 07:55:47 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r697tls1002774;
 Tue, 9 Jul 2013 07:55:47 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307090755.r697tls1002774@svn.freebsd.org>
From: Hiroki Sato 
Date: Tue, 9 Jul 2013 07:55:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253060 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 07:55:48 -0000

Author: hrs
Date: Tue Jul  9 07:55:47 2013
New Revision: 253060
URL: http://svnweb.freebsd.org/changeset/base/253060

Log:
  Document IPv6 support.

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

Modified: head/share/man/man4/bridge.4
==============================================================================
--- head/share/man/man4/bridge.4	Tue Jul  9 07:51:11 2013	(r253059)
+++ head/share/man/man4/bridge.4	Tue Jul  9 07:55:47 2013	(r253060)
@@ -35,7 +35,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 9, 2010
+.Dd July 3, 2013
 .Dt IF_BRIDGE 4
 .Os
 .Sh NAME
@@ -142,6 +142,79 @@ This can be used to multiplex the input 
 stream.
 This is useful for reconstructing the traffic for network taps
 that transmit the RX/TX signals out through two separate interfaces.
+.Sh IPV6 SUPPORT
+.Nm
+supports the
+.Li AF_INET6
+address family on bridge interfaces.
+The following
+.Xr rc.conf 5
+variable configures an IPv6 link-local address on
+.Li bridge0
+interface: 
+.Bd -literal -offset indent
+ifconfig_bridge0_ipv6="up"
+.Ed
+.Pp
+or in a more explicit manner:
+.Bd -literal -offset indent
+ifconfig_bridge0_ipv6="inet6 auto_linklocal"
+.Ed
+.Pp
+However, the
+.Li AF_INET6
+address family has a concept of scope zone.
+Bridging multiple interfaces change the zone configuration because
+multiple links are merged to each other and form a new single link
+while the member interfaces still work individually.
+This means each member interface still has a separate link-local scope
+zone and the
+.Nm
+interface has another single,
+aggregated link-local scope zone at the same time.
+This situation is clearly against the description
+.Qq zones of the same scope cannot overlap
+in Section 5,
+RFC 4007.
+Although it works in most cases,
+it can cause some conterintuitive or undesirable behavior in some
+edge cases when both of the
+.Nm
+interface and one of the member interface have an IPv6 address
+and applications use both of them.
+.Pp
+To prevent this situation,
+.Nm
+checks whether an link-local scoped IPv6 address is configured on
+a member interface to be added and the 
+.Nm
+interface.
+When the
+.Nm
+interface has IPv6 addresses,
+IPv6 addresses on the member interface will be automatically removed
+before the interface is added.
+When both
+.Nm
+interface and the existing member interfaces do not have one,
+adding an interface with IPv6 addresses as a new member interface is allowed.
+These means only one interface in the link-local scope zone where the
+.Nm
+interface forms can have link-local scoped IPv6 addresses.
+.Pp
+Note that
+.Li ACCEPT_RTADV
+and
+.Li AUTO_LINKLOCAL
+interface flag are not enabled by default on
+.Nm
+interface even when
+.Va net.inet6.ip6.accept_rtadv
+and/or
+.Va net.inet6.ip6.auto_linklocal
+is set to
+.Li 1 .
+.Ed
 .Sh SPANNING TREE
 The
 .Nm

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 07:57:11 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 12AFC832;
 Tue,  9 Jul 2013 07:57:11 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 05B3A1E9F;
 Tue,  9 Jul 2013 07:57:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r697vAGm002975;
 Tue, 9 Jul 2013 07:57:10 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r697vALh002974;
 Tue, 9 Jul 2013 07:57:10 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307090757.r697vALh002974@svn.freebsd.org>
From: Hiroki Sato 
Date: Tue, 9 Jul 2013 07:57:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253061 - head/share/man/man5
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 07:57:11 -0000

Author: hrs
Date: Tue Jul  9 07:57:10 2013
New Revision: 253061
URL: http://svnweb.freebsd.org/changeset/base/253061

Log:
  Remove $swapfile and $geli_swap_flags.

Modified:
  head/share/man/man5/rc.conf.5

Modified: head/share/man/man5/rc.conf.5
==============================================================================
--- head/share/man/man5/rc.conf.5	Tue Jul  9 07:55:47 2013	(r253060)
+++ head/share/man/man5/rc.conf.5	Tue Jul  9 07:57:10 2013	(r253061)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 25, 2013
+.Dd July 9, 2013
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -161,12 +161,6 @@ Setting this option will bypass that che
 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
-.Dq Li NO ,
-no swapfile is installed, otherwise the value is used as the full
-pathname to a file to use for additional swap space.
 .It Ao Ar name Ac Ns Va _chroot
 .Pq Vt str
 .Xr chroot
@@ -1890,12 +1884,6 @@ Default is
 This can be changed for every device separately by defining
 .Va geli_ Ns Ao Ar device Ac Ns Va _autodetach
 variable.
-.It Va geli_swap_flags
-Options passed to the
-.Xr geli 8
-utility when encrypted GEOM providers for swap partitions are created.
-The default is
-.Dq Li "-e aes -l 256 -s 4096 -d" .
 .It Va root_rw_mount
 .Pq Vt bool
 Set to

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 07:59:48 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 54997980;
 Tue,  9 Jul 2013 07:59:48 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 45AC51EB2;
 Tue,  9 Jul 2013 07:59:48 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r697xmm7003323;
 Tue, 9 Jul 2013 07:59:48 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r697xmCr003322;
 Tue, 9 Jul 2013 07:59:48 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307090759.r697xmCr003322@svn.freebsd.org>
From: Hiroki Sato 
Date: Tue, 9 Jul 2013 07:59:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253062 - stable/9/sbin/ifconfig
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 07:59:48 -0000

Author: hrs
Date: Tue Jul  9 07:59:47 2013
New Revision: 253062
URL: http://svnweb.freebsd.org/changeset/base/253062

Log:
  MFC 252408, 252557:
  
  Do not display a warning message in a jail without AF_INET6 support.

Modified:
  stable/9/sbin/ifconfig/af_nd6.c
Directory Properties:
  stable/9/sbin/ifconfig/   (props changed)

Modified: stable/9/sbin/ifconfig/af_nd6.c
==============================================================================
--- stable/9/sbin/ifconfig/af_nd6.c	Tue Jul  9 07:57:10 2013	(r253061)
+++ stable/9/sbin/ifconfig/af_nd6.c	Tue Jul  9 07:59:47 2013	(r253062)
@@ -148,7 +148,7 @@ nd6_status(int s)
 	memset(&nd, 0, sizeof(nd));
 	strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname));
 	if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
-		if (errno != EPROTONOSUPPORT)
+		if (errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT)
 			warn("socket(AF_INET6, SOCK_DGRAM)");
 		return;
 	}

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 08:23:44 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 9CE7E36D;
 Tue,  9 Jul 2013 08:23:44 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 757E21FB0;
 Tue,  9 Jul 2013 08:23:44 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r698Nilo012010;
 Tue, 9 Jul 2013 08:23:44 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r698NiRj012008;
 Tue, 9 Jul 2013 08:23:44 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307090823.r698NiRj012008@svn.freebsd.org>
From: Hiroki Sato 
Date: Tue, 9 Jul 2013 08:23:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253066 - head/lib/libc/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 08:23:44 -0000

Author: hrs
Date: Tue Jul  9 08:23:43 2013
New Revision: 253066
URL: http://svnweb.freebsd.org/changeset/base/253066

Log:
  Update references.

Modified:
  head/lib/libc/net/getaddrinfo.3
  head/lib/libc/net/getnameinfo.3

Modified: head/lib/libc/net/getaddrinfo.3
==============================================================================
--- head/lib/libc/net/getaddrinfo.3	Tue Jul  9 08:17:43 2013	(r253065)
+++ head/lib/libc/net/getaddrinfo.3	Tue Jul  9 08:23:43 2013	(r253066)
@@ -255,7 +255,7 @@ member points to a filled-in socket addr
 This implementation of
 .Fn getaddrinfo
 allows numeric IPv6 address notation with scope identifier,
-as documented in chapter 11 of draft-ietf-ipv6-scoping-arch-02.txt.
+as documented in chapter 11 of RFC 4007.
 By appending the percent character and scope identifier to addresses,
 one can fill the
 .Li sin6_scope_id
@@ -441,9 +441,8 @@ freeaddrinfo(res0);
 .%A E. Nordmark
 .%A B. Zill
 .%T "IPv6 Scoped Address Architecture"
-.%R internet draft
-.%N draft-ietf-ipv6-scoping-arch-02.txt
-.%O work in progress material
+.%R RFC 4007
+.%D March 2005
 .Re
 .Rs
 .%A Craig Metz

Modified: head/lib/libc/net/getnameinfo.3
==============================================================================
--- head/lib/libc/net/getnameinfo.3	Tue Jul  9 08:17:43 2013	(r253065)
+++ head/lib/libc/net/getnameinfo.3	Tue Jul  9 08:23:43 2013	(r253066)
@@ -191,10 +191,11 @@ printf("host=%s\en", hbuf);
 .%A R. Gilligan
 .%A S. Thomson
 .%A J. Bound
+.%A J. McCann
 .%A W. Stevens
 .%T Basic Socket Interface Extensions for IPv6
-.%R RFC 2553
-.%D March 1999
+.%R RFC 3493
+.%D February 2003
 .Re
 .Rs
 .%A S. Deering
@@ -203,9 +204,8 @@ printf("host=%s\en", hbuf);
 .%A E. Nordmark
 .%A B. Zill
 .%T "IPv6 Scoped Address Architecture"
-.%R internet draft
-.%N draft-ietf-ipv6-scoping-arch-02.txt
-.%O work in progress material
+.%R RFC 4007
+.%D March 2005
 .Re
 .Rs
 .%A Craig Metz
@@ -217,9 +217,9 @@ printf("host=%s\en", hbuf);
 The
 .Fn getnameinfo
 function is defined by the
-.St -p1003.1g-2000
-draft specification and documented in
-.Tn "RFC 2553" ,
+.St -p1003.1-2004
+specification and documented in
+.Tn "RFC 3493" ,
 .Dq Basic Socket Interface Extensions for IPv6 .
 .Sh CAVEATS
 .Fn getnameinfo

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 08:29:15 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 533755F9;
 Tue,  9 Jul 2013 08:29:15 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 456DA1013;
 Tue,  9 Jul 2013 08:29:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r698TFOs012688;
 Tue, 9 Jul 2013 08:29:15 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r698TFob012687;
 Tue, 9 Jul 2013 08:29:15 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201307090829.r698TFob012687@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 9 Jul 2013 08:29:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253067 - head/tools/tools/zfsboottest
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 08:29:15 -0000

Author: avg
Date: Tue Jul  9 08:29:14 2013
New Revision: 253067
URL: http://svnweb.freebsd.org/changeset/base/253067

Log:
  zfsboottest: sync with changes in zfs boot code
  
  - spa status can not be called before spa init
  - libzfs.h inclusion is now required
  - fix alternative code for explicit root dataset lookup
  
  MFC after:	10 days

Modified:
  head/tools/tools/zfsboottest/zfsboottest.c

Modified: head/tools/tools/zfsboottest/zfsboottest.c
==============================================================================
--- head/tools/tools/zfsboottest/zfsboottest.c	Tue Jul  9 08:23:43 2013	(r253066)
+++ head/tools/tools/zfsboottest/zfsboottest.c	Tue Jul  9 08:29:14 2013	(r253067)
@@ -52,6 +52,7 @@ pager_output(const char *line)
 
 #define ZFS_TEST
 #define	printf(...)	 fprintf(stderr, __VA_ARGS__)
+#include "libzfs.h"
 #include "zfsimpl.c"
 #undef printf
 
@@ -134,7 +135,6 @@ main(int argc, char** argv)
 			close(fd[i - 1]);
 		}
 	}
-	spa_all_status();
 
 	spa = STAILQ_FIRST(&zfs_pools);
 	if (spa == NULL) {
@@ -147,7 +147,10 @@ main(int argc, char** argv)
 		exit(1);
 	}
 
+	spa_all_status();
+
 #if 0
+	uint64_t rootobj;
 	if (zfs_get_root(spa, &rootobj)) {
 		fprintf(stderr, "can't get root\n");
 		exit(1);
@@ -158,8 +161,8 @@ main(int argc, char** argv)
 	if (zfs_mount(spa, 0, &zfsmnt)) {
 		fprintf(stderr, "can't mount\n");
 		exit(1);
-	}
 #endif
+	}
 
 	printf("\n");
 	for (++i, failures = 0; i < argc; i++) {

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 08:30:32 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id F206A777;
 Tue,  9 Jul 2013 08:30:31 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id CB64A1029;
 Tue,  9 Jul 2013 08:30:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r698UV1d013112;
 Tue, 9 Jul 2013 08:30:31 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r698UVsG013111;
 Tue, 9 Jul 2013 08:30:31 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201307090830.r698UVsG013111@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 9 Jul 2013 08:30:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253068 - head/tools/tools/zfsboottest
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 08:30:32 -0000

Author: avg
Date: Tue Jul  9 08:30:31 2013
New Revision: 253068
URL: http://svnweb.freebsd.org/changeset/base/253068

Log:
  zfsboottest.sh: remove checks for things that are not strictly required
  
  MFC after:	10 days

Modified:
  head/tools/tools/zfsboottest/zfsboottest.sh

Modified: head/tools/tools/zfsboottest/zfsboottest.sh
==============================================================================
--- head/tools/tools/zfsboottest/zfsboottest.sh	Tue Jul  9 08:29:14 2013	(r253067)
+++ head/tools/tools/zfsboottest/zfsboottest.sh	Tue Jul  9 08:30:31 2013	(r253068)
@@ -54,11 +54,6 @@ bootfs=`zpool get bootfs "${pool}" | tai
 if [ "${bootfs}" = "-" ]; then
 	bootfs="${pool}"
 fi
-# Dataset's mountpoint property should be set to 'legacy'.
-if [ "`zfs get -H -o value mountpoint ${bootfs}`" != "legacy" ]; then
-	echo "The \"mountpoint\" property of dataset \"${bootfs}\" should be set to \"legacy\"." >&2
-	exit 1
-fi
 mountpoint=`df -t zfs "${bootfs}" 2>/dev/null | tail -1 | awk '{print $6}'`
 if [ -z "${mountpoint}" ]; then
 	echo "The \"${bootfs}\" dataset is not mounted." >&2
@@ -68,19 +63,6 @@ if [ ! -d "${mountpoint}${startdir}" ]; 
 	echo "The \"${mountpoint}${startdir}\" directory doesn't exist." >&2
 	exit 1
 fi
-# To be able to mount root ZFS file system we need either /etc/fstab entry
-# or vfs.root.mountfrom variable set in /boot/loader.conf.
-egrep -q '^'"${bootfs}"'[[:space:]]+/[[:space:]]+zfs[[:space:]]+' "${mountpoint}/etc/fstab" 2>/dev/null
-if [ $? -ne 0 ]; then
-	egrep -q 'vfs.root.mountfrom="?'"zfs:${bootfs}"'"?[[:space:]]*$' "${mountpoint}/boot/loader.conf" 2>/dev/null
-	if [ $? -ne 0 ]; then
-		echo "To be able to boot from \"${bootfs}\", you need to declare" >&2
-		echo "\"${bootfs}\" as being root file system in ${mountpoint}/etc/fstab" >&2
-		echo "or add \"vfs.root.mountfrom\" variable set to \"zfs:${bootfs}\" to" >&2
-		echo "${mountpoint}/boot/loader.conf." >&2
-		exit 1
-	fi
-fi
 vdevs=""
 for vdev in `zpool status "${pool}" | grep ONLINE | awk '{print $1}'`; do
 	vdev="/dev/${vdev#/dev/}"

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 08:32:18 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 27E738D5;
 Tue,  9 Jul 2013 08:32:18 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 1A2581041;
 Tue,  9 Jul 2013 08:32:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r698WHHJ014779;
 Tue, 9 Jul 2013 08:32:17 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r698WHiT014778;
 Tue, 9 Jul 2013 08:32:17 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201307090832.r698WHiT014778@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 9 Jul 2013 08:32:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253069 - head/sys/dev/ahci
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 08:32:18 -0000

Author: mav
Date: Tue Jul  9 08:32:17 2013
New Revision: 253069
URL: http://svnweb.freebsd.org/changeset/base/253069

Log:
  Add one more ID of Marvell SATA controller.
  
  Submitted by:	marck
  MFC after:	3 days

Modified:
  head/sys/dev/ahci/ahci.c

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Tue Jul  9 08:30:31 2013	(r253068)
+++ head/sys/dev/ahci/ahci.c	Tue Jul  9 08:32:17 2013	(r253069)
@@ -228,6 +228,7 @@ static struct {
 	{0x91301b4b, 0x00, "Marvell 88SE9130",  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
 	{0x91721b4b, 0x00, "Marvell 88SE9172",	AHCI_Q_NOBSYRES},
 	{0x91821b4b, 0x00, "Marvell 88SE9182",	AHCI_Q_NOBSYRES},
+	{0x91a01b4b, 0x00, "Marvell 88SE91Ax",	AHCI_Q_NOBSYRES},
 	{0x92201b4b, 0x00, "Marvell 88SE9220",  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
 	{0x92301b4b, 0x00, "Marvell 88SE9230",  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
 	{0x92351b4b, 0x00, "Marvell 88SE9235",  AHCI_Q_NOBSYRES},

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 08:36:16 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id E491CC90;
 Tue,  9 Jul 2013 08:36:16 +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 739C31098;
 Tue,  9 Jul 2013 08:36:16 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id r698aFKO002756;
 Tue, 9 Jul 2013 12:36:15 +0400 (MSK) (envelope-from marck@rinet.ru)
Date: Tue, 9 Jul 2013 12:36:15 +0400 (MSK)
From: Dmitry Morozovsky 
To: Alexander Motin 
Subject: Re: svn commit: r253069 - head/sys/dev/ahci
In-Reply-To: <201307090832.r698WHiT014778@svn.freebsd.org>
Message-ID: 
References: <201307090832.r698WHiT014778@svn.freebsd.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.4.3
 (woozle.rinet.ru [0.0.0.0]); Tue, 09 Jul 2013 12:36:15 +0400 (MSK)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 08:36:17 -0000

On Tue, 9 Jul 2013, Alexander Motin wrote:

> Author: mav
> Date: Tue Jul  9 08:32:17 2013
> New Revision: 253069
> URL: http://svnweb.freebsd.org/changeset/base/253069
> 
> Log:
>   Add one more ID of Marvell SATA controller.
>   
>   Submitted by:	marck
>   MFC after:	3 days

Thanks a lot for lightning-fast commit! ;)

-- 
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-all@FreeBSD.ORG  Tue Jul  9 08:37:43 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 68E16DE4;
 Tue,  9 Jul 2013 08:37:43 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 5AE8210AE;
 Tue,  9 Jul 2013 08:37:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r698bhU7015572;
 Tue, 9 Jul 2013 08:37:43 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r698bhqa015571;
 Tue, 9 Jul 2013 08:37:43 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201307090837.r698bhqa015571@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 9 Jul 2013 08:37:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253070 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 08:37:43 -0000

Author: avg
Date: Tue Jul  9 08:37:42 2013
New Revision: 253070
URL: http://svnweb.freebsd.org/changeset/base/253070

Log:
  zfs: load zpool.cache after a root fs is mounted
  
  MFC after:	3 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c	Tue Jul  9 08:32:17 2013	(r253069)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c	Tue Jul  9 08:37:42 2013	(r253070)
@@ -1697,6 +1697,10 @@ spa_boot_init()
 	spa_config_load();
 }
 
+#ifdef _KERNEL
+EVENTHANDLER_DEFINE(mountroot, spa_boot_init, NULL, 0);
+#endif
+
 void
 spa_init(int mode)
 {

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 08:40:05 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id AA1F9F40;
 Tue,  9 Jul 2013 08:40:05 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 9D03510C6;
 Tue,  9 Jul 2013 08:40:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r698e5VM015921;
 Tue, 9 Jul 2013 08:40:05 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r698e5lw015920;
 Tue, 9 Jul 2013 08:40:05 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201307090840.r698e5lw015920@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 9 Jul 2013 08:40:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253071 - head/sys/boot/forth
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 08:40:05 -0000

Author: avg
Date: Tue Jul  9 08:40:05 2013
New Revision: 253071
URL: http://svnweb.freebsd.org/changeset/base/253071

Log:
  default loader.conf: there is no need to load zpool.cache now
  
  kernel does not need it for importing a root pool.
  
  MFC after:	4 weeks

Modified:
  head/sys/boot/forth/loader.conf

Modified: head/sys/boot/forth/loader.conf
==============================================================================
--- head/sys/boot/forth/loader.conf	Tue Jul  9 08:37:42 2013	(r253070)
+++ head/sys/boot/forth/loader.conf	Tue Jul  9 08:40:05 2013	(r253071)
@@ -518,11 +518,3 @@ mac_seeotheruids_load="NO"	# UID visbili
 #module_before="cmd"		# executes "cmd" before loading the module
 #module_after="cmd"		# executes "cmd" after loading the module
 #module_error="cmd"		# executes "cmd" if load fails
-
-##############################################################
-###  Always try to load ZFS pool cache file  #################
-##############################################################
-
-zpool_cache_load="YES"
-zpool_cache_type="/boot/zfs/zpool.cache"
-zpool_cache_name="/boot/zfs/zpool.cache"

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 08:42:03 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 2D08F12B;
 Tue,  9 Jul 2013 08:42:03 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 1FE5610DB;
 Tue,  9 Jul 2013 08:42:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r698g3R2017762;
 Tue, 9 Jul 2013 08:42:03 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r698g2CU017760;
 Tue, 9 Jul 2013 08:42:02 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201307090842.r698g2CU017760@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 9 Jul 2013 08:42:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253072 - head/sys/conf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 08:42:03 -0000

Author: avg
Date: Tue Jul  9 08:42:02 2013
New Revision: 253072
URL: http://svnweb.freebsd.org/changeset/base/253072

Log:
  amd64: use -mno-omit-leaf-frame-pointer in addition to -fno-omit-frame-pointer
  
  ... in kernel builds.  This is to make behavior of clang consistent with
  behavior of gcc.
  
  MFC after:	2 weeks

Modified:
  head/sys/conf/Makefile.amd64
  head/sys/conf/kmod.mk

Modified: head/sys/conf/Makefile.amd64
==============================================================================
--- head/sys/conf/Makefile.amd64	Tue Jul  9 08:40:05 2013	(r253071)
+++ head/sys/conf/Makefile.amd64	Tue Jul  9 08:42:02 2013	(r253072)
@@ -34,7 +34,7 @@ S=	../../..
 INCLUDES+= -I$S/contrib/libfdt
 
 .if !empty(DDB_ENABLED) || !empty(DTR_ENABLED) || !empty(HWPMC_ENABLED)
-CFLAGS+=	-fno-omit-frame-pointer
+CFLAGS+=	-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
 .endif
 
 MKMODULESENV+= MACHINE=amd64

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk	Tue Jul  9 08:40:05 2013	(r253071)
+++ head/sys/conf/kmod.mk	Tue Jul  9 08:42:02 2013	(r253072)
@@ -122,7 +122,7 @@ LDFLAGS+=	-d -warn-common
 
 CFLAGS+=	${DEBUG_FLAGS}
 .if ${MACHINE_CPUARCH} == amd64
-CFLAGS+=	-fno-omit-frame-pointer
+CFLAGS+=	-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
 .endif
 
 .if ${MACHINE_CPUARCH} == powerpc

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 08:47:11 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id BEC79327;
 Tue,  9 Jul 2013 08:47:11 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id B15851114;
 Tue,  9 Jul 2013 08:47:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r698lBPB018446;
 Tue, 9 Jul 2013 08:47:11 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r698lBLR018445;
 Tue, 9 Jul 2013 08:47:11 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201307090847.r698lBLR018445@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 9 Jul 2013 08:47:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253073 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 08:47:11 -0000

Author: avg
Date: Tue Jul  9 08:47:11 2013
New Revision: 253073
URL: http://svnweb.freebsd.org/changeset/base/253073

Log:
  zfs: try to properly handle i/o errors in mappedread_sf
  
  Unconditionally freeing a page is not good, especially if it is the page
  that was wired by the caller.  The checks are picked up from
  kern_sendfile.
  
  MFC after:	3 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Tue Jul  9 08:42:02 2013	(r253072)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Tue Jul  9 08:47:11 2013	(r253073)
@@ -546,7 +546,9 @@ mappedread_sf(vnode_t *vp, int nbytes, u
 			vm_page_io_finish(pp);
 			vm_page_lock(pp);
 			if (error) {
-				vm_page_free(pp);
+				if (pp->wire_count == 0 && pp->valid == 0 &&
+				    pp->busy == 0 && !(pp->oflags & VPO_BUSY))
+					vm_page_free(pp);
 			} else {
 				pp->valid = VM_PAGE_BITS_ALL;
 				vm_page_activate(pp);

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 08:49:17 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id D5BA4504;
 Tue,  9 Jul 2013 08:49:17 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id C8A2D112B;
 Tue,  9 Jul 2013 08:49:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r698nHqx018762;
 Tue, 9 Jul 2013 08:49:17 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r698nHLf018761;
 Tue, 9 Jul 2013 08:49:17 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201307090849.r698nHLf018761@svn.freebsd.org>
From: Alexander Motin 
Date: Tue, 9 Jul 2013 08:49:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253074 - head/sys/dev/ahci
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 08:49:17 -0000

Author: mav
Date: Tue Jul  9 08:49:17 2013
New Revision: 253074
URL: http://svnweb.freebsd.org/changeset/base/253074

Log:
  Add ID for Marvell 88SE9215 AHCI SATA controller.
  
  MFC after:	3 days

Modified:
  head/sys/dev/ahci/ahci.c

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Tue Jul  9 08:47:11 2013	(r253073)
+++ head/sys/dev/ahci/ahci.c	Tue Jul  9 08:49:17 2013	(r253074)
@@ -229,6 +229,7 @@ static struct {
 	{0x91721b4b, 0x00, "Marvell 88SE9172",	AHCI_Q_NOBSYRES},
 	{0x91821b4b, 0x00, "Marvell 88SE9182",	AHCI_Q_NOBSYRES},
 	{0x91a01b4b, 0x00, "Marvell 88SE91Ax",	AHCI_Q_NOBSYRES},
+	{0x92151b4b, 0x00, "Marvell 88SE9215",  AHCI_Q_NOBSYRES},
 	{0x92201b4b, 0x00, "Marvell 88SE9220",  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
 	{0x92301b4b, 0x00, "Marvell 88SE9230",  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
 	{0x92351b4b, 0x00, "Marvell 88SE9235",  AHCI_Q_NOBSYRES},

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 08:54:02 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id E3057819;
 Tue,  9 Jul 2013 08:54:02 +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 6D9AE1167;
 Tue,  9 Jul 2013 08:54:02 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id r698s1mG003636;
 Tue, 9 Jul 2013 12:54:01 +0400 (MSK) (envelope-from marck@rinet.ru)
Date: Tue, 9 Jul 2013 12:54:01 +0400 (MSK)
From: Dmitry Morozovsky 
To: Garance A Drosehn 
Subject: Re: svn commit: r253002 - head
In-Reply-To: <51DB6233.1040003@FreeBSD.org>
Message-ID: 
References: <201307072039.r67KdCdR028908@svn.freebsd.org>
 <51DB6233.1040003@FreeBSD.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.4.3
 (woozle.rinet.ru [0.0.0.0]); Tue, 09 Jul 2013 12:54:01 +0400 (MSK)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 Alfred Perlstein , src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 08:54:03 -0000

On Mon, 8 Jul 2013, Garance A Drosehn wrote:

> I think it's probably helpful to point out the -j flag, but I'm
> not sure I would phrase it as if we're sure that the values here
> are the ideal ones.  I expect the ideal values depend too much on
> hardware (e.g.: the CPU, type of disk used, and amount of memory
> on the machine).

Just a quick note on the last sentense: building world with clang on core2Q 
with 8 gigs of RAM with even -j4 starts intense swapping, especially if using ZFS...


-- 
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-all@FreeBSD.ORG  Tue Jul  9 08:58:34 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id B8CDC9C4;
 Tue,  9 Jul 2013 08:58:34 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id AB9B011A5;
 Tue,  9 Jul 2013 08:58:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r698wYwT021604;
 Tue, 9 Jul 2013 08:58:34 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r698wYsq021603;
 Tue, 9 Jul 2013 08:58:34 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201307090858.r698wYsq021603@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 9 Jul 2013 08:58:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253075 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 08:58:34 -0000

Author: avg
Date: Tue Jul  9 08:58:34 2013
New Revision: 253075
URL: http://svnweb.freebsd.org/changeset/base/253075

Log:
  namecache sdt: freebsd doesn't support structured characters yet
  
  :-)
  
  MFC after:	 7 days

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c	Tue Jul  9 08:49:17 2013	(r253074)
+++ head/sys/kern/vfs_cache.c	Tue Jul  9 08:58:34 2013	(r253075)
@@ -68,10 +68,10 @@ SDT_PROBE_DEFINE2(vfs, namecache, enter_
     "char *");
 SDT_PROBE_DEFINE1(vfs, namecache, fullpath, entry, entry, "struct vnode *");
 SDT_PROBE_DEFINE3(vfs, namecache, fullpath, hit, hit, "struct vnode *",
-    "struct char *", "struct vnode *");
+    "char *", "struct vnode *");
 SDT_PROBE_DEFINE1(vfs, namecache, fullpath, miss, miss, "struct vnode *");
 SDT_PROBE_DEFINE3(vfs, namecache, fullpath, return, return, "int",
-    "struct vnode *", "struct char *");
+    "struct vnode *", "char *");
 SDT_PROBE_DEFINE3(vfs, namecache, lookup, hit, hit, "struct vnode *", "char *",
     "struct vnode *");
 SDT_PROBE_DEFINE2(vfs, namecache, lookup, hit_negative, hit-negative,

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 08:59:40 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 479D2B0C;
 Tue,  9 Jul 2013 08:59:40 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 3A47E11B3;
 Tue,  9 Jul 2013 08:59:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r698xehS021761;
 Tue, 9 Jul 2013 08:59:40 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r698xebN021760;
 Tue, 9 Jul 2013 08:59:40 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201307090859.r698xebN021760@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 9 Jul 2013 08:59:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253076 - head/etc/rc.d
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 08:59:40 -0000

Author: avg
Date: Tue Jul  9 08:59:39 2013
New Revision: 253076
URL: http://svnweb.freebsd.org/changeset/base/253076

Log:
  rc.d/zfs: pass -v option to zfs mount
  
  this should make boot process more informative (and entertaining)
  on systems with lots of zfs filesystems.
  
  MFC after:	7 days

Modified:
  head/etc/rc.d/zfs

Modified: head/etc/rc.d/zfs
==============================================================================
--- head/etc/rc.d/zfs	Tue Jul  9 08:58:34 2013	(r253075)
+++ head/etc/rc.d/zfs	Tue Jul  9 08:59:39 2013	(r253076)
@@ -23,7 +23,7 @@ zfs_start_jail()
 
 zfs_start_main()
 {
-	zfs mount -a
+	zfs mount -va
 	zfs share -a
 	if [ ! -r /etc/zfs/exports ]; then
 		touch /etc/zfs/exports

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 09:01:45 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 5DE42C8D;
 Tue,  9 Jul 2013 09:01:45 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 5082711D3;
 Tue,  9 Jul 2013 09:01:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6991juI023942;
 Tue, 9 Jul 2013 09:01:45 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6991j64023941;
 Tue, 9 Jul 2013 09:01:45 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201307090901.r6991j64023941@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 9 Jul 2013 09:01:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253077 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 09:01:45 -0000

Author: avg
Date: Tue Jul  9 09:01:44 2013
New Revision: 253077
URL: http://svnweb.freebsd.org/changeset/base/253077

Log:
  should_yield: protect from td_swvoltick being uninitialized or too stale
  
  The distance between ticks and td_swvoltick should be calculated as
  an unsigned number.  Previously we could end up comparing a negative
  number with hogticks in which case should_yield() would give incorrect
  answer.
  
  We should probably ensure that td_swvoltick is properly initialized.
  
  Sponsored by:	HybridCluster
  MFC after:	5 days

Modified:
  head/sys/kern/kern_synch.c

Modified: head/sys/kern/kern_synch.c
==============================================================================
--- head/sys/kern/kern_synch.c	Tue Jul  9 08:59:39 2013	(r253076)
+++ head/sys/kern/kern_synch.c	Tue Jul  9 09:01:44 2013	(r253077)
@@ -581,7 +581,7 @@ int
 should_yield(void)
 {
 
-	return (ticks - curthread->td_swvoltick >= hogticks);
+	return ((unsigned int)(ticks - curthread->td_swvoltick) >= hogticks);
 }
 
 void

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 09:03:02 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 090A9EB9;
 Tue,  9 Jul 2013 09:03:02 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id F06F711EA;
 Tue,  9 Jul 2013 09:03:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69931EP024185;
 Tue, 9 Jul 2013 09:03:01 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69931Qq024184;
 Tue, 9 Jul 2013 09:03:01 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201307090903.r69931Qq024184@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 9 Jul 2013 09:03:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253078 - head/sys/security/audit
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 09:03:02 -0000

Author: avg
Date: Tue Jul  9 09:03:01 2013
New Revision: 253078
URL: http://svnweb.freebsd.org/changeset/base/253078

Log:
  audit_proc_coredump: check return value of audit_new
  
  audit_new may return NULL if audit is disabled or suspended.
  
  Sponsored by:	HybridCluster
  MFC after:	7 days

Modified:
  head/sys/security/audit/audit.c

Modified: head/sys/security/audit/audit.c
==============================================================================
--- head/sys/security/audit/audit.c	Tue Jul  9 09:01:44 2013	(r253077)
+++ head/sys/security/audit/audit.c	Tue Jul  9 09:03:01 2013	(r253078)
@@ -701,6 +701,8 @@ audit_proc_coredump(struct thread *td, c
 	 * (signal) tokens.
 	 */
 	ar = audit_new(AUE_CORE, td);
+	if (ar == NULL)
+		return;
 	if (path != NULL) {
 		pathp = &ar->k_ar.ar_arg_upath1;
 		*pathp = malloc(MAXPATHLEN, M_AUDITPATH, M_WAITOK);

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 09:05:00 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id B2B3E1F3;
 Tue,  9 Jul 2013 09:05:00 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id A53BE1211;
 Tue,  9 Jul 2013 09:05:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69950Zl024634;
 Tue, 9 Jul 2013 09:05:00 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69950Bt024633;
 Tue, 9 Jul 2013 09:05:00 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201307090905.r69950Bt024633@svn.freebsd.org>
From: Andriy Gapon 
Date: Tue, 9 Jul 2013 09:05:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253079 -
 head/sys/cddl/contrib/opensolaris/uts/common/dtrace
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 09:05:00 -0000

Author: avg
Date: Tue Jul  9 09:05:00 2013
New Revision: 253079
URL: http://svnweb.freebsd.org/changeset/base/253079

Log:
  dtrace/fasttrap: install hook functions only after all data is
  initialized
  
  Sponsored by:	HybridCluster
  MFC after:	 7 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c	Tue Jul  9 09:03:01 2013	(r253078)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c	Tue Jul  9 09:05:00 2013	(r253079)
@@ -2283,13 +2283,6 @@ fasttrap_load(void)
 		return (ret);
 	}
 
-	/*
-	 * Install our hooks into fork(2), exec(2), and exit(2).
-	 */
-	dtrace_fasttrap_fork = &fasttrap_fork;
-	dtrace_fasttrap_exit = &fasttrap_exec_exit;
-	dtrace_fasttrap_exec = &fasttrap_exec_exit;
-
 #if defined(sun)
 	fasttrap_max = ddi_getprop(DDI_DEV_T_ANY, devi, DDI_PROP_DONTPASS,
 	    "fasttrap-max-probes", FASTTRAP_MAX_DEFAULT);
@@ -2366,6 +2359,13 @@ fasttrap_load(void)
 	}
 #endif
 
+	/*
+	 * Install our hooks into fork(2), exec(2), and exit(2).
+	 */
+	dtrace_fasttrap_fork = &fasttrap_fork;
+	dtrace_fasttrap_exit = &fasttrap_exec_exit;
+	dtrace_fasttrap_exec = &fasttrap_exec_exit;
+
 	(void) dtrace_meta_register("fasttrap", &fasttrap_mops, NULL,
 	    &fasttrap_meta_id);
 

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 09:32:10 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 809FDD9B;
 Tue,  9 Jul 2013 09:32:10 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 712571373;
 Tue,  9 Jul 2013 09:32:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r699WALI034281;
 Tue, 9 Jul 2013 09:32:10 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r699W6Ks034249;
 Tue, 9 Jul 2013 09:32:06 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201307090932.r699W6Ks034249@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 9 Jul 2013 09:32:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253081 - in head: sys/net sys/netinet sys/netinet6
 sys/netipsec tools/tools/crypto usr.bin/netstat
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 09:32:10 -0000

Author: ae
Date: Tue Jul  9 09:32:06 2013
New Revision: 253081
URL: http://svnweb.freebsd.org/changeset/base/253081

Log:
  Prepare network statistics structures for migration to PCPU counters.
  Use uint64_t as type for all fields of structures.
  
  Changed structures: ahstat, arpstat, espstat, icmp6_ifstat, icmp6stat,
  in6_ifstat, ip6stat, ipcompstat, ipipstat, ipsecstat, mrt6stat, mrtstat,
  pfkeystat, pim6stat, pimstat, rip6stat, udpstat.
  
  Discussed with:	arch@

Modified:
  head/sys/net/if_arp.h
  head/sys/netinet/icmp6.h
  head/sys/netinet/ip_mroute.h
  head/sys/netinet/pim_var.h
  head/sys/netinet/udp_var.h
  head/sys/netinet6/in6_var.h
  head/sys/netinet6/ip6_mroute.h
  head/sys/netinet6/ip6_var.h
  head/sys/netinet6/pim6_var.h
  head/sys/netinet6/raw_ip6.h
  head/sys/netipsec/ah_var.h
  head/sys/netipsec/esp_var.h
  head/sys/netipsec/ipcomp_var.h
  head/sys/netipsec/ipip_var.h
  head/sys/netipsec/ipsec.h
  head/sys/netipsec/keysock.h
  head/sys/netipsec/xform_ipcomp.c
  head/tools/tools/crypto/ipsecstats.c
  head/usr.bin/netstat/inet.c
  head/usr.bin/netstat/ipsec.c
  head/usr.bin/netstat/mroute.c

Modified: head/sys/net/if_arp.h
==============================================================================
--- head/sys/net/if_arp.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/net/if_arp.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -113,18 +113,18 @@ struct	arpcom {
 
 struct arpstat {
 	/* Normal things that happen: */
-	u_long txrequests;	/* # of ARP requests sent by this host. */
-	u_long txreplies;	/* # of ARP replies sent by this host. */
-	u_long rxrequests;	/* # of ARP requests received by this host. */
-	u_long rxreplies;	/* # of ARP replies received by this host. */
-	u_long received;	/* # of ARP packets received by this host. */
+	uint64_t txrequests;	/* # of ARP requests sent by this host. */
+	uint64_t txreplies;	/* # of ARP replies sent by this host. */
+	uint64_t rxrequests;	/* # of ARP requests received by this host. */
+	uint64_t rxreplies;	/* # of ARP replies received by this host. */
+	uint64_t received;	/* # of ARP packets received by this host. */
 
-	u_long arp_spares[4];	/* For either the upper or lower half. */
+	uint64_t arp_spares[4];	/* For either the upper or lower half. */
 	/* Abnormal event and error  counting: */
-	u_long dropped;		/* # of packets dropped waiting for a reply. */
-	u_long timeouts;	/* # of times with entries removed */
+	uint64_t dropped;	/* # of packets dropped waiting for a reply. */
+	uint64_t timeouts;	/* # of times with entries removed */
 				/* due to timeout. */
-	u_long dupips;		/* # of duplicate IPs detected. */
+	uint64_t dupips;	/* # of duplicate IPs detected. */
 };
 
 /*

Modified: head/sys/netinet/icmp6.h
==============================================================================
--- head/sys/netinet/icmp6.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netinet/icmp6.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -555,39 +555,39 @@ do {								\
  * of the internet control message protocol version 6.
  */
 struct icmp6errstat {
-	u_quad_t icp6errs_dst_unreach_noroute;
-	u_quad_t icp6errs_dst_unreach_admin;
-	u_quad_t icp6errs_dst_unreach_beyondscope;
-	u_quad_t icp6errs_dst_unreach_addr;
-	u_quad_t icp6errs_dst_unreach_noport;
-	u_quad_t icp6errs_packet_too_big;
-	u_quad_t icp6errs_time_exceed_transit;
-	u_quad_t icp6errs_time_exceed_reassembly;
-	u_quad_t icp6errs_paramprob_header;
-	u_quad_t icp6errs_paramprob_nextheader;
-	u_quad_t icp6errs_paramprob_option;
-	u_quad_t icp6errs_redirect; /* we regard redirect as an error here */
-	u_quad_t icp6errs_unknown;
+	uint64_t icp6errs_dst_unreach_noroute;
+	uint64_t icp6errs_dst_unreach_admin;
+	uint64_t icp6errs_dst_unreach_beyondscope;
+	uint64_t icp6errs_dst_unreach_addr;
+	uint64_t icp6errs_dst_unreach_noport;
+	uint64_t icp6errs_packet_too_big;
+	uint64_t icp6errs_time_exceed_transit;
+	uint64_t icp6errs_time_exceed_reassembly;
+	uint64_t icp6errs_paramprob_header;
+	uint64_t icp6errs_paramprob_nextheader;
+	uint64_t icp6errs_paramprob_option;
+	uint64_t icp6errs_redirect; /* we regard redirect as an error here */
+	uint64_t icp6errs_unknown;
 };
 
 struct icmp6stat {
 /* statistics related to icmp6 packets generated */
-	u_quad_t icp6s_error;		/* # of calls to icmp6_error */
-	u_quad_t icp6s_canterror;	/* no error 'cuz old was icmp */
-	u_quad_t icp6s_toofreq;		/* no error 'cuz rate limitation */
-	u_quad_t icp6s_outhist[256];
+	uint64_t icp6s_error;		/* # of calls to icmp6_error */
+	uint64_t icp6s_canterror;	/* no error 'cuz old was icmp */
+	uint64_t icp6s_toofreq;		/* no error 'cuz rate limitation */
+	uint64_t icp6s_outhist[256];
 /* statistics related to input message processed */
-	u_quad_t icp6s_badcode;		/* icmp6_code out of range */
-	u_quad_t icp6s_tooshort;	/* packet < sizeof(struct icmp6_hdr) */
-	u_quad_t icp6s_checksum;	/* bad checksum */
-	u_quad_t icp6s_badlen;		/* calculated bound mismatch */
+	uint64_t icp6s_badcode;		/* icmp6_code out of range */
+	uint64_t icp6s_tooshort;	/* packet < sizeof(struct icmp6_hdr) */
+	uint64_t icp6s_checksum;	/* bad checksum */
+	uint64_t icp6s_badlen;		/* calculated bound mismatch */
 	/*
 	 * number of responses: this member is inherited from netinet code, but
 	 * for netinet6 code, it is already available in icp6s_outhist[].
 	 */
-	u_quad_t icp6s_reflect;
-	u_quad_t icp6s_inhist[256];	
-	u_quad_t icp6s_nd_toomanyopt;	/* too many ND options */
+	uint64_t icp6s_reflect;
+	uint64_t icp6s_inhist[256];	
+	uint64_t icp6s_nd_toomanyopt;	/* too many ND options */
 	struct icmp6errstat icp6s_outerrhist;
 #define icp6s_odst_unreach_noroute \
 	icp6s_outerrhist.icp6errs_dst_unreach_noroute
@@ -607,13 +607,13 @@ struct icmp6stat {
 #define icp6s_oparamprob_option icp6s_outerrhist.icp6errs_paramprob_option
 #define icp6s_oredirect icp6s_outerrhist.icp6errs_redirect
 #define icp6s_ounknown icp6s_outerrhist.icp6errs_unknown
-	u_quad_t icp6s_pmtuchg;		/* path MTU changes */
-	u_quad_t icp6s_nd_badopt;	/* bad ND options */
-	u_quad_t icp6s_badns;		/* bad neighbor solicitation */
-	u_quad_t icp6s_badna;		/* bad neighbor advertisement */
-	u_quad_t icp6s_badrs;		/* bad router advertisement */
-	u_quad_t icp6s_badra;		/* bad router advertisement */
-	u_quad_t icp6s_badredirect;	/* bad redirect message */
+	uint64_t icp6s_pmtuchg;		/* path MTU changes */
+	uint64_t icp6s_nd_badopt;	/* bad ND options */
+	uint64_t icp6s_badns;		/* bad neighbor solicitation */
+	uint64_t icp6s_badna;		/* bad neighbor advertisement */
+	uint64_t icp6s_badrs;		/* bad router advertisement */
+	uint64_t icp6s_badra;		/* bad router advertisement */
+	uint64_t icp6s_badredirect;	/* bad redirect message */
 };
 
 #ifdef _KERNEL

Modified: head/sys/netinet/ip_mroute.h
==============================================================================
--- head/sys/netinet/ip_mroute.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netinet/ip_mroute.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -206,19 +206,19 @@ struct bw_upcall {
  * The kernel's multicast routing statistics.
  */
 struct mrtstat {
-    u_long	mrts_mfc_lookups;	/* # forw. cache hash table hits   */
-    u_long	mrts_mfc_misses;	/* # forw. cache hash table misses */
-    u_long	mrts_upcalls;		/* # calls to multicast routing daemon */
-    u_long	mrts_no_route;		/* no route for packet's origin    */
-    u_long	mrts_bad_tunnel;	/* malformed tunnel options        */
-    u_long	mrts_cant_tunnel;	/* no room for tunnel options      */
-    u_long	mrts_wrong_if;		/* arrived on wrong interface	   */
-    u_long	mrts_upq_ovflw;		/* upcall Q overflow		   */
-    u_long	mrts_cache_cleanups;	/* # entries with no upcalls	   */
-    u_long	mrts_drop_sel;		/* pkts dropped selectively        */
-    u_long	mrts_q_overflow;	/* pkts dropped - Q overflow       */
-    u_long	mrts_pkt2large;		/* pkts dropped - size > BKT SIZE  */
-    u_long	mrts_upq_sockfull;	/* upcalls dropped - socket full */
+	uint64_t mrts_mfc_lookups;    /* # forw. cache hash table hits   */
+	uint64_t mrts_mfc_misses;     /* # forw. cache hash table misses */
+	uint64_t mrts_upcalls;	      /* # calls to multicast routing daemon */
+	uint64_t mrts_no_route;	      /* no route for packet's origin    */
+	uint64_t mrts_bad_tunnel;     /* malformed tunnel options        */
+	uint64_t mrts_cant_tunnel;    /* no room for tunnel options      */
+	uint64_t mrts_wrong_if;	      /* arrived on wrong interface	 */
+	uint64_t mrts_upq_ovflw;      /* upcall Q overflow		 */
+	uint64_t mrts_cache_cleanups; /* # entries with no upcalls	 */
+	uint64_t mrts_drop_sel;	      /* pkts dropped selectively        */
+	uint64_t mrts_q_overflow;     /* pkts dropped - Q overflow       */
+	uint64_t mrts_pkt2large;      /* pkts dropped - size > BKT SIZE  */
+	uint64_t mrts_upq_sockfull;   /* upcalls dropped - socket full   */
 };
 
 #ifdef _KERNEL

Modified: head/sys/netinet/pim_var.h
==============================================================================
--- head/sys/netinet/pim_var.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netinet/pim_var.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -46,17 +46,17 @@
  * PIM statistics kept in the kernel
  */
 struct pimstat {
-	u_quad_t pims_rcv_total_msgs;	   /* total PIM messages received    */
-	u_quad_t pims_rcv_total_bytes;	   /* total PIM bytes received	     */
-	u_quad_t pims_rcv_tooshort;	   /* rcvd with too few bytes	     */
-	u_quad_t pims_rcv_badsum;	   /* rcvd with bad checksum	     */
-	u_quad_t pims_rcv_badversion;	   /* rcvd bad PIM version	     */
-	u_quad_t pims_rcv_registers_msgs;  /* rcvd regs. msgs (data only)    */
-	u_quad_t pims_rcv_registers_bytes; /* rcvd regs. bytes (data only)   */
-	u_quad_t pims_rcv_registers_wrongiif; /* rcvd regs. on wrong iif     */
-	u_quad_t pims_rcv_badregisters;	   /* rcvd invalid registers	     */
-	u_quad_t pims_snd_registers_msgs;  /* sent regs. msgs (data only)    */
-	u_quad_t pims_snd_registers_bytes; /* sent regs. bytes (data only)   */
+	uint64_t pims_rcv_total_msgs;	   /* total PIM messages received    */
+	uint64_t pims_rcv_total_bytes;	   /* total PIM bytes received	     */
+	uint64_t pims_rcv_tooshort;	   /* rcvd with too few bytes	     */
+	uint64_t pims_rcv_badsum;	   /* rcvd with bad checksum	     */
+	uint64_t pims_rcv_badversion;	   /* rcvd bad PIM version	     */
+	uint64_t pims_rcv_registers_msgs;  /* rcvd regs. msgs (data only)    */
+	uint64_t pims_rcv_registers_bytes; /* rcvd regs. bytes (data only)   */
+	uint64_t pims_rcv_registers_wrongiif; /* rcvd regs. on wrong iif     */
+	uint64_t pims_rcv_badregisters;	   /* rcvd invalid registers	     */
+	uint64_t pims_snd_registers_msgs;  /* sent regs. msgs (data only)    */
+	uint64_t pims_snd_registers_bytes; /* sent regs. bytes (data only)   */
 };
 
 #ifdef _KERNEL

Modified: head/sys/netinet/udp_var.h
==============================================================================
--- head/sys/netinet/udp_var.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netinet/udp_var.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -75,22 +75,22 @@ struct udpcb {
 
 struct udpstat {
 				/* input statistics: */
-	u_long	udps_ipackets;		/* total input packets */
-	u_long	udps_hdrops;		/* packet shorter than header */
-	u_long	udps_badsum;		/* checksum error */
-	u_long	udps_nosum;		/* no checksum */
-	u_long	udps_badlen;		/* data length larger than packet */
-	u_long	udps_noport;		/* no socket on port */
-	u_long	udps_noportbcast;	/* of above, arrived as broadcast */
-	u_long	udps_fullsock;		/* not delivered, input socket full */
-	u_long	udpps_pcbcachemiss;	/* input packets missing pcb cache */
-	u_long	udpps_pcbhashmiss;	/* input packets not for hashed pcb */
+	uint64_t udps_ipackets;		/* total input packets */
+	uint64_t udps_hdrops;		/* packet shorter than header */
+	uint64_t udps_badsum;		/* checksum error */
+	uint64_t udps_nosum;		/* no checksum */
+	uint64_t udps_badlen;		/* data length larger than packet */
+	uint64_t udps_noport;		/* no socket on port */
+	uint64_t udps_noportbcast;	/* of above, arrived as broadcast */
+	uint64_t udps_fullsock;		/* not delivered, input socket full */
+	uint64_t udpps_pcbcachemiss;	/* input packets missing pcb cache */
+	uint64_t udpps_pcbhashmiss;	/* input packets not for hashed pcb */
 				/* output statistics: */
-	u_long	udps_opackets;		/* total output packets */
-	u_long	udps_fastout;		/* output packets on fast path */
+	uint64_t udps_opackets;		/* total output packets */
+	uint64_t udps_fastout;		/* output packets on fast path */
 	/* of no socket on port, arrived as multicast */
-	u_long	udps_noportmcast;
-	u_long	udps_filtermcast;	/* blocked by multicast filter */
+	uint64_t udps_noportmcast;
+	uint64_t udps_filtermcast;	/* blocked by multicast filter */
 };
 
 #ifdef _KERNEL

Modified: head/sys/netinet6/in6_var.h
==============================================================================
--- head/sys/netinet6/in6_var.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netinet6/in6_var.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -153,37 +153,37 @@ struct in6_addrpolicy {
  * IPv6 interface statistics, as defined in RFC2465 Ipv6IfStatsEntry (p12).
  */
 struct in6_ifstat {
-	u_quad_t ifs6_in_receive;	/* # of total input datagram */
-	u_quad_t ifs6_in_hdrerr;	/* # of datagrams with invalid hdr */
-	u_quad_t ifs6_in_toobig;	/* # of datagrams exceeded MTU */
-	u_quad_t ifs6_in_noroute;	/* # of datagrams with no route */
-	u_quad_t ifs6_in_addrerr;	/* # of datagrams with invalid dst */
-	u_quad_t ifs6_in_protounknown;	/* # of datagrams with unknown proto */
+	uint64_t ifs6_in_receive;	/* # of total input datagram */
+	uint64_t ifs6_in_hdrerr;	/* # of datagrams with invalid hdr */
+	uint64_t ifs6_in_toobig;	/* # of datagrams exceeded MTU */
+	uint64_t ifs6_in_noroute;	/* # of datagrams with no route */
+	uint64_t ifs6_in_addrerr;	/* # of datagrams with invalid dst */
+	uint64_t ifs6_in_protounknown;	/* # of datagrams with unknown proto */
 					/* NOTE: increment on final dst if */
-	u_quad_t ifs6_in_truncated;	/* # of truncated datagrams */
-	u_quad_t ifs6_in_discard;	/* # of discarded datagrams */
+	uint64_t ifs6_in_truncated;	/* # of truncated datagrams */
+	uint64_t ifs6_in_discard;	/* # of discarded datagrams */
 					/* NOTE: fragment timeout is not here */
-	u_quad_t ifs6_in_deliver;	/* # of datagrams delivered to ULP */
+	uint64_t ifs6_in_deliver;	/* # of datagrams delivered to ULP */
 					/* NOTE: increment on final dst if */
-	u_quad_t ifs6_out_forward;	/* # of datagrams forwarded */
+	uint64_t ifs6_out_forward;	/* # of datagrams forwarded */
 					/* NOTE: increment on outgoing if */
-	u_quad_t ifs6_out_request;	/* # of outgoing datagrams from ULP */
+	uint64_t ifs6_out_request;	/* # of outgoing datagrams from ULP */
 					/* NOTE: does not include forwrads */
-	u_quad_t ifs6_out_discard;	/* # of discarded datagrams */
-	u_quad_t ifs6_out_fragok;	/* # of datagrams fragmented */
-	u_quad_t ifs6_out_fragfail;	/* # of datagrams failed on fragment */
-	u_quad_t ifs6_out_fragcreat;	/* # of fragment datagrams */
+	uint64_t ifs6_out_discard;	/* # of discarded datagrams */
+	uint64_t ifs6_out_fragok;	/* # of datagrams fragmented */
+	uint64_t ifs6_out_fragfail;	/* # of datagrams failed on fragment */
+	uint64_t ifs6_out_fragcreat;	/* # of fragment datagrams */
 					/* NOTE: this is # after fragment */
-	u_quad_t ifs6_reass_reqd;	/* # of incoming fragmented packets */
+	uint64_t ifs6_reass_reqd;	/* # of incoming fragmented packets */
 					/* NOTE: increment on final dst if */
-	u_quad_t ifs6_reass_ok;		/* # of reassembled packets */
+	uint64_t ifs6_reass_ok;		/* # of reassembled packets */
 					/* NOTE: this is # after reass */
 					/* NOTE: increment on final dst if */
-	u_quad_t ifs6_reass_fail;	/* # of reass failures */
+	uint64_t ifs6_reass_fail;	/* # of reass failures */
 					/* NOTE: may not be packet count */
 					/* NOTE: increment on final dst if */
-	u_quad_t ifs6_in_mcast;		/* # of inbound multicast datagrams */
-	u_quad_t ifs6_out_mcast;	/* # of outbound multicast datagrams */
+	uint64_t ifs6_in_mcast;		/* # of inbound multicast datagrams */
+	uint64_t ifs6_out_mcast;	/* # of outbound multicast datagrams */
 };
 
 /*
@@ -195,77 +195,77 @@ struct icmp6_ifstat {
 	 * Input statistics
 	 */
 	/* ipv6IfIcmpInMsgs, total # of input messages */
-	u_quad_t ifs6_in_msg;
+	uint64_t ifs6_in_msg;
 	/* ipv6IfIcmpInErrors, # of input error messages */
-	u_quad_t ifs6_in_error;
+	uint64_t ifs6_in_error;
 	/* ipv6IfIcmpInDestUnreachs, # of input dest unreach errors */
-	u_quad_t ifs6_in_dstunreach;
+	uint64_t ifs6_in_dstunreach;
 	/* ipv6IfIcmpInAdminProhibs, # of input administratively prohibited errs */
-	u_quad_t ifs6_in_adminprohib;
+	uint64_t ifs6_in_adminprohib;
 	/* ipv6IfIcmpInTimeExcds, # of input time exceeded errors */
-	u_quad_t ifs6_in_timeexceed;
+	uint64_t ifs6_in_timeexceed;
 	/* ipv6IfIcmpInParmProblems, # of input parameter problem errors */
-	u_quad_t ifs6_in_paramprob;
+	uint64_t ifs6_in_paramprob;
 	/* ipv6IfIcmpInPktTooBigs, # of input packet too big errors */
-	u_quad_t ifs6_in_pkttoobig;
+	uint64_t ifs6_in_pkttoobig;
 	/* ipv6IfIcmpInEchos, # of input echo requests */
-	u_quad_t ifs6_in_echo;
+	uint64_t ifs6_in_echo;
 	/* ipv6IfIcmpInEchoReplies, # of input echo replies */
-	u_quad_t ifs6_in_echoreply;
+	uint64_t ifs6_in_echoreply;
 	/* ipv6IfIcmpInRouterSolicits, # of input router solicitations */
-	u_quad_t ifs6_in_routersolicit;
+	uint64_t ifs6_in_routersolicit;
 	/* ipv6IfIcmpInRouterAdvertisements, # of input router advertisements */
-	u_quad_t ifs6_in_routeradvert;
+	uint64_t ifs6_in_routeradvert;
 	/* ipv6IfIcmpInNeighborSolicits, # of input neighbor solicitations */
-	u_quad_t ifs6_in_neighborsolicit;
+	uint64_t ifs6_in_neighborsolicit;
 	/* ipv6IfIcmpInNeighborAdvertisements, # of input neighbor advertisements */
-	u_quad_t ifs6_in_neighboradvert;
+	uint64_t ifs6_in_neighboradvert;
 	/* ipv6IfIcmpInRedirects, # of input redirects */
-	u_quad_t ifs6_in_redirect;
+	uint64_t ifs6_in_redirect;
 	/* ipv6IfIcmpInGroupMembQueries, # of input MLD queries */
-	u_quad_t ifs6_in_mldquery;
+	uint64_t ifs6_in_mldquery;
 	/* ipv6IfIcmpInGroupMembResponses, # of input MLD reports */
-	u_quad_t ifs6_in_mldreport;
+	uint64_t ifs6_in_mldreport;
 	/* ipv6IfIcmpInGroupMembReductions, # of input MLD done */
-	u_quad_t ifs6_in_mlddone;
+	uint64_t ifs6_in_mlddone;
 
 	/*
 	 * Output statistics. We should solve unresolved routing problem...
 	 */
 	/* ipv6IfIcmpOutMsgs, total # of output messages */
-	u_quad_t ifs6_out_msg;
+	uint64_t ifs6_out_msg;
 	/* ipv6IfIcmpOutErrors, # of output error messages */
-	u_quad_t ifs6_out_error;
+	uint64_t ifs6_out_error;
 	/* ipv6IfIcmpOutDestUnreachs, # of output dest unreach errors */
-	u_quad_t ifs6_out_dstunreach;
+	uint64_t ifs6_out_dstunreach;
 	/* ipv6IfIcmpOutAdminProhibs, # of output administratively prohibited errs */
-	u_quad_t ifs6_out_adminprohib;
+	uint64_t ifs6_out_adminprohib;
 	/* ipv6IfIcmpOutTimeExcds, # of output time exceeded errors */
-	u_quad_t ifs6_out_timeexceed;
+	uint64_t ifs6_out_timeexceed;
 	/* ipv6IfIcmpOutParmProblems, # of output parameter problem errors */
-	u_quad_t ifs6_out_paramprob;
+	uint64_t ifs6_out_paramprob;
 	/* ipv6IfIcmpOutPktTooBigs, # of output packet too big errors */
-	u_quad_t ifs6_out_pkttoobig;
+	uint64_t ifs6_out_pkttoobig;
 	/* ipv6IfIcmpOutEchos, # of output echo requests */
-	u_quad_t ifs6_out_echo;
+	uint64_t ifs6_out_echo;
 	/* ipv6IfIcmpOutEchoReplies, # of output echo replies */
-	u_quad_t ifs6_out_echoreply;
+	uint64_t ifs6_out_echoreply;
 	/* ipv6IfIcmpOutRouterSolicits, # of output router solicitations */
-	u_quad_t ifs6_out_routersolicit;
+	uint64_t ifs6_out_routersolicit;
 	/* ipv6IfIcmpOutRouterAdvertisements, # of output router advertisements */
-	u_quad_t ifs6_out_routeradvert;
+	uint64_t ifs6_out_routeradvert;
 	/* ipv6IfIcmpOutNeighborSolicits, # of output neighbor solicitations */
-	u_quad_t ifs6_out_neighborsolicit;
+	uint64_t ifs6_out_neighborsolicit;
 	/* ipv6IfIcmpOutNeighborAdvertisements, # of output neighbor advertisements */
-	u_quad_t ifs6_out_neighboradvert;
+	uint64_t ifs6_out_neighboradvert;
 	/* ipv6IfIcmpOutRedirects, # of output redirects */
-	u_quad_t ifs6_out_redirect;
+	uint64_t ifs6_out_redirect;
 	/* ipv6IfIcmpOutGroupMembQueries, # of output MLD queries */
-	u_quad_t ifs6_out_mldquery;
+	uint64_t ifs6_out_mldquery;
 	/* ipv6IfIcmpOutGroupMembResponses, # of output MLD reports */
-	u_quad_t ifs6_out_mldreport;
+	uint64_t ifs6_out_mldreport;
 	/* ipv6IfIcmpOutGroupMembReductions, # of output MLD done */
-	u_quad_t ifs6_out_mlddone;
+	uint64_t ifs6_out_mlddone;
 };
 
 struct	in6_ifreq {

Modified: head/sys/netinet6/ip6_mroute.h
==============================================================================
--- head/sys/netinet6/ip6_mroute.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netinet6/ip6_mroute.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -121,19 +121,19 @@ struct mf6cctl {
  * The kernel's multicast routing statistics.
  */
 struct mrt6stat {
-	u_quad_t mrt6s_mfc_lookups;	/* # forw. cache hash table hits   */
-	u_quad_t mrt6s_mfc_misses;	/* # forw. cache hash table misses */
-	u_quad_t mrt6s_upcalls;		/* # calls to multicast routing daemon */
-	u_quad_t mrt6s_no_route;	/* no route for packet's origin    */
-	u_quad_t mrt6s_bad_tunnel;	/* malformed tunnel options        */
-	u_quad_t mrt6s_cant_tunnel;	/* no room for tunnel options      */
-	u_quad_t mrt6s_wrong_if;	/* arrived on wrong interface	   */
-	u_quad_t mrt6s_upq_ovflw;	/* upcall Q overflow		   */
-	u_quad_t mrt6s_cache_cleanups;	/* # entries with no upcalls	   */
-	u_quad_t mrt6s_drop_sel;	/* pkts dropped selectively        */
-	u_quad_t mrt6s_q_overflow;	/* pkts dropped - Q overflow       */
-	u_quad_t mrt6s_pkt2large;	/* pkts dropped - size > BKT SIZE  */
-	u_quad_t mrt6s_upq_sockfull;	/* upcalls dropped - socket full   */
+	uint64_t mrt6s_mfc_lookups;	/* # forw. cache hash table hits   */
+	uint64_t mrt6s_mfc_misses;	/* # forw. cache hash table misses */
+	uint64_t mrt6s_upcalls;		/* # calls to multicast routing daemon */
+	uint64_t mrt6s_no_route;	/* no route for packet's origin    */
+	uint64_t mrt6s_bad_tunnel;	/* malformed tunnel options        */
+	uint64_t mrt6s_cant_tunnel;	/* no room for tunnel options      */
+	uint64_t mrt6s_wrong_if;	/* arrived on wrong interface	   */
+	uint64_t mrt6s_upq_ovflw;	/* upcall Q overflow		   */
+	uint64_t mrt6s_cache_cleanups;	/* # entries with no upcalls	   */
+	uint64_t mrt6s_drop_sel;	/* pkts dropped selectively        */
+	uint64_t mrt6s_q_overflow;	/* pkts dropped - Q overflow       */
+	uint64_t mrt6s_pkt2large;	/* pkts dropped - size > BKT SIZE  */
+	uint64_t mrt6s_upq_sockfull;	/* upcalls dropped - socket full   */
 };
 
 #ifdef MRT6_OINIT

Modified: head/sys/netinet6/ip6_var.h
==============================================================================
--- head/sys/netinet6/ip6_var.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netinet6/ip6_var.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -181,39 +181,39 @@ struct	ip6_pktopts {
  */
 
 struct	ip6stat {
-	u_quad_t ip6s_total;		/* total packets received */
-	u_quad_t ip6s_tooshort;		/* packet too short */
-	u_quad_t ip6s_toosmall;		/* not enough data */
-	u_quad_t ip6s_fragments;	/* fragments received */
-	u_quad_t ip6s_fragdropped;	/* frags dropped(dups, out of space) */
-	u_quad_t ip6s_fragtimeout;	/* fragments timed out */
-	u_quad_t ip6s_fragoverflow;	/* fragments that exceeded limit */
-	u_quad_t ip6s_forward;		/* packets forwarded */
-	u_quad_t ip6s_cantforward;	/* packets rcvd for unreachable dest */
-	u_quad_t ip6s_redirectsent;	/* packets forwarded on same net */
-	u_quad_t ip6s_delivered;	/* datagrams delivered to upper level*/
-	u_quad_t ip6s_localout;		/* total ip packets generated here */
-	u_quad_t ip6s_odropped;		/* lost packets due to nobufs, etc. */
-	u_quad_t ip6s_reassembled;	/* total packets reassembled ok */
-	u_quad_t ip6s_fragmented;	/* datagrams successfully fragmented */
-	u_quad_t ip6s_ofragments;	/* output fragments created */
-	u_quad_t ip6s_cantfrag;		/* don't fragment flag was set, etc. */
-	u_quad_t ip6s_badoptions;	/* error in option processing */
-	u_quad_t ip6s_noroute;		/* packets discarded due to no route */
-	u_quad_t ip6s_badvers;		/* ip6 version != 6 */
-	u_quad_t ip6s_rawout;		/* total raw ip packets generated */
-	u_quad_t ip6s_badscope;		/* scope error */
-	u_quad_t ip6s_notmember;	/* don't join this multicast group */
+	uint64_t ip6s_total;		/* total packets received */
+	uint64_t ip6s_tooshort;		/* packet too short */
+	uint64_t ip6s_toosmall;		/* not enough data */
+	uint64_t ip6s_fragments;	/* fragments received */
+	uint64_t ip6s_fragdropped;	/* frags dropped(dups, out of space) */
+	uint64_t ip6s_fragtimeout;	/* fragments timed out */
+	uint64_t ip6s_fragoverflow;	/* fragments that exceeded limit */
+	uint64_t ip6s_forward;		/* packets forwarded */
+	uint64_t ip6s_cantforward;	/* packets rcvd for unreachable dest */
+	uint64_t ip6s_redirectsent;	/* packets forwarded on same net */
+	uint64_t ip6s_delivered;	/* datagrams delivered to upper level*/
+	uint64_t ip6s_localout;		/* total ip packets generated here */
+	uint64_t ip6s_odropped;		/* lost packets due to nobufs, etc. */
+	uint64_t ip6s_reassembled;	/* total packets reassembled ok */
+	uint64_t ip6s_fragmented;	/* datagrams successfully fragmented */
+	uint64_t ip6s_ofragments;	/* output fragments created */
+	uint64_t ip6s_cantfrag;		/* don't fragment flag was set, etc. */
+	uint64_t ip6s_badoptions;	/* error in option processing */
+	uint64_t ip6s_noroute;		/* packets discarded due to no route */
+	uint64_t ip6s_badvers;		/* ip6 version != 6 */
+	uint64_t ip6s_rawout;		/* total raw ip packets generated */
+	uint64_t ip6s_badscope;		/* scope error */
+	uint64_t ip6s_notmember;	/* don't join this multicast group */
 #define	IP6S_HDRCNT		256	/* headers count */
-	u_quad_t ip6s_nxthist[IP6S_HDRCNT]; /* next header history */
-	u_quad_t ip6s_m1;		/* one mbuf */
+	uint64_t ip6s_nxthist[IP6S_HDRCNT]; /* next header history */
+	uint64_t ip6s_m1;		/* one mbuf */
 #define	IP6S_M2MMAX		32
-	u_quad_t ip6s_m2m[IP6S_M2MMAX];	/* two or more mbuf */
-	u_quad_t ip6s_mext1;		/* one ext mbuf */
-	u_quad_t ip6s_mext2m;		/* two or more ext mbuf */
-	u_quad_t ip6s_exthdrtoolong;	/* ext hdr are not contiguous */
-	u_quad_t ip6s_nogif;		/* no match gif found */
-	u_quad_t ip6s_toomanyhdr;	/* discarded due to too many headers */
+	uint64_t ip6s_m2m[IP6S_M2MMAX];	/* two or more mbuf */
+	uint64_t ip6s_mext1;		/* one ext mbuf */
+	uint64_t ip6s_mext2m;		/* two or more ext mbuf */
+	uint64_t ip6s_exthdrtoolong;	/* ext hdr are not contiguous */
+	uint64_t ip6s_nogif;		/* no match gif found */
+	uint64_t ip6s_toomanyhdr;	/* discarded due to too many headers */
 
 	/*
 	 * statistics for improvement of the source address selection
@@ -223,26 +223,26 @@ struct	ip6stat {
 #define	IP6S_RULESMAX		16
 #define	IP6S_SCOPECNT		16
 	/* number of times that address selection fails */
-	u_quad_t ip6s_sources_none;
+	uint64_t ip6s_sources_none;
 	/* number of times that an address on the outgoing I/F is chosen */
-	u_quad_t ip6s_sources_sameif[IP6S_SCOPECNT];
+	uint64_t ip6s_sources_sameif[IP6S_SCOPECNT];
 	/* number of times that an address on a non-outgoing I/F is chosen */
-	u_quad_t ip6s_sources_otherif[IP6S_SCOPECNT];
+	uint64_t ip6s_sources_otherif[IP6S_SCOPECNT];
 	/*
 	 * number of times that an address that has the same scope
 	 * from the destination is chosen.
 	 */
-	u_quad_t ip6s_sources_samescope[IP6S_SCOPECNT];
+	uint64_t ip6s_sources_samescope[IP6S_SCOPECNT];
 	/*
 	 * number of times that an address that has a different scope
 	 * from the destination is chosen.
 	 */
-	u_quad_t ip6s_sources_otherscope[IP6S_SCOPECNT];
+	uint64_t ip6s_sources_otherscope[IP6S_SCOPECNT];
 	/* number of times that a deprecated address is chosen */
-	u_quad_t ip6s_sources_deprecated[IP6S_SCOPECNT];
+	uint64_t ip6s_sources_deprecated[IP6S_SCOPECNT];
 
 	/* number of times that each rule of source selection is applied. */
-	u_quad_t ip6s_sources_rule[IP6S_RULESMAX];
+	uint64_t ip6s_sources_rule[IP6S_RULESMAX];
 };
 
 #ifdef _KERNEL

Modified: head/sys/netinet6/pim6_var.h
==============================================================================
--- head/sys/netinet6/pim6_var.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netinet6/pim6_var.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -42,13 +42,13 @@
 #define _NETINET6_PIM6_VAR_H_
 
 struct pim6stat {
-	u_quad_t pim6s_rcv_total;	/* total PIM messages received	*/
-	u_quad_t pim6s_rcv_tooshort;	/* received with too few bytes	*/
-	u_quad_t pim6s_rcv_badsum;	/* received with bad checksum	*/
-	u_quad_t pim6s_rcv_badversion;	/* received bad PIM version	*/
-	u_quad_t pim6s_rcv_registers;	/* received registers		*/
-	u_quad_t pim6s_rcv_badregisters; /* received invalid registers	*/
-	u_quad_t pim6s_snd_registers;	/* sent registers		*/
+	uint64_t pim6s_rcv_total;	/* total PIM messages received	*/
+	uint64_t pim6s_rcv_tooshort;	/* received with too few bytes	*/
+	uint64_t pim6s_rcv_badsum;	/* received with bad checksum	*/
+	uint64_t pim6s_rcv_badversion;	/* received bad PIM version	*/
+	uint64_t pim6s_rcv_registers;	/* received registers		*/
+	uint64_t pim6s_rcv_badregisters; /* received invalid registers	*/
+	uint64_t pim6s_snd_registers;	/* sent registers		*/
 };
 
 #if (defined(KERNEL)) || (defined(_KERNEL))

Modified: head/sys/netinet6/raw_ip6.h
==============================================================================
--- head/sys/netinet6/raw_ip6.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netinet6/raw_ip6.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -37,14 +37,14 @@
  * ICMPv6 stat is counted separately.  see netinet/icmp6.h
  */
 struct rip6stat {
-	u_quad_t rip6s_ipackets;	/* total input packets */
-	u_quad_t rip6s_isum;		/* input checksum computations */
-	u_quad_t rip6s_badsum;		/* of above, checksum error */
-	u_quad_t rip6s_nosock;		/* no matching socket */
-	u_quad_t rip6s_nosockmcast;	/* of above, arrived as multicast */
-	u_quad_t rip6s_fullsock;	/* not delivered, input socket full */
+	uint64_t rip6s_ipackets;	/* total input packets */
+	uint64_t rip6s_isum;		/* input checksum computations */
+	uint64_t rip6s_badsum;		/* of above, checksum error */
+	uint64_t rip6s_nosock;		/* no matching socket */
+	uint64_t rip6s_nosockmcast;	/* of above, arrived as multicast */
+	uint64_t rip6s_fullsock;	/* not delivered, input socket full */
 
-	u_quad_t rip6s_opackets;	/* total output packets */
+	uint64_t rip6s_opackets;	/* total output packets */
 };
 
 #ifdef _KERNEL

Modified: head/sys/netipsec/ah_var.h
==============================================================================
--- head/sys/netipsec/ah_var.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netipsec/ah_var.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -48,26 +48,26 @@
 #define	AH_ALG_MAX	16
 
 struct ahstat {
-	u_int32_t	ahs_hdrops;	/* Packet shorter than header shows */
-	u_int32_t	ahs_nopf;	/* Protocol family not supported */
-	u_int32_t	ahs_notdb;
-	u_int32_t	ahs_badkcr;
-	u_int32_t	ahs_badauth;
-	u_int32_t	ahs_noxform;
-	u_int32_t	ahs_qfull;
-	u_int32_t	ahs_wrap;
-	u_int32_t	ahs_replay;
-	u_int32_t	ahs_badauthl;	/* Bad authenticator length */
-	u_int32_t	ahs_input;	/* Input AH packets */
-	u_int32_t	ahs_output;	/* Output AH packets */
-	u_int32_t	ahs_invalid;	/* Trying to use an invalid TDB */
-	u_int64_t	ahs_ibytes;	/* Input bytes */
-	u_int64_t	ahs_obytes;	/* Output bytes */
-	u_int32_t	ahs_toobig;	/* Packet got larger than IP_MAXPACKET */
-	u_int32_t	ahs_pdrops;	/* Packet blocked due to policy */
-	u_int32_t	ahs_crypto;	/* Crypto processing failure */
-	u_int32_t	ahs_tunnel;	/* Tunnel sanity check failure */
-	u_int32_t	ahs_hist[AH_ALG_MAX];	/* Per-algorithm op count */
+	uint64_t	ahs_hdrops;	/* Packet shorter than header shows */
+	uint64_t	ahs_nopf;	/* Protocol family not supported */
+	uint64_t	ahs_notdb;
+	uint64_t	ahs_badkcr;
+	uint64_t	ahs_badauth;
+	uint64_t	ahs_noxform;
+	uint64_t	ahs_qfull;
+	uint64_t	ahs_wrap;
+	uint64_t	ahs_replay;
+	uint64_t	ahs_badauthl;	/* Bad authenticator length */
+	uint64_t	ahs_input;	/* Input AH packets */
+	uint64_t	ahs_output;	/* Output AH packets */
+	uint64_t	ahs_invalid;	/* Trying to use an invalid TDB */
+	uint64_t	ahs_ibytes;	/* Input bytes */
+	uint64_t	ahs_obytes;	/* Output bytes */
+	uint64_t	ahs_toobig;	/* Packet got larger than IP_MAXPACKET */
+	uint64_t	ahs_pdrops;	/* Packet blocked due to policy */
+	uint64_t	ahs_crypto;	/* Crypto processing failure */
+	uint64_t	ahs_tunnel;	/* Tunnel sanity check failure */
+	uint64_t	ahs_hist[AH_ALG_MAX];	/* Per-algorithm op count */
 };
 
 #ifdef _KERNEL

Modified: head/sys/netipsec/esp_var.h
==============================================================================
--- head/sys/netipsec/esp_var.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netipsec/esp_var.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -48,27 +48,27 @@
 #define	ESP_ALG_MAX	256		/* NB: could be < but skipjack is 249 */
 
 struct espstat {
-	u_int32_t	esps_hdrops;	/* Packet shorter than header shows */
-	u_int32_t	esps_nopf;	/* Protocol family not supported */
-	u_int32_t	esps_notdb;
-	u_int32_t	esps_badkcr;
-	u_int32_t	esps_qfull;
-	u_int32_t	esps_noxform;
-	u_int32_t	esps_badilen;
-	u_int32_t	esps_wrap;	/* Replay counter wrapped around */
-	u_int32_t	esps_badenc;	/* Bad encryption detected */
-	u_int32_t	esps_badauth;	/* Only valid for transforms with auth */
-	u_int32_t	esps_replay;	/* Possible packet replay detected */
-	u_int32_t	esps_input;	/* Input ESP packets */
-	u_int32_t	esps_output;	/* Output ESP packets */
-	u_int32_t	esps_invalid;	/* Trying to use an invalid TDB */
-	u_int64_t	esps_ibytes;	/* Input bytes */
-	u_int64_t	esps_obytes;	/* Output bytes */
-	u_int32_t	esps_toobig;	/* Packet got larger than IP_MAXPACKET */
-	u_int32_t	esps_pdrops;	/* Packet blocked due to policy */
-	u_int32_t	esps_crypto;	/* Crypto processing failure */
-	u_int32_t	esps_tunnel;	/* Tunnel sanity check failure */
-	u_int32_t	esps_hist[ESP_ALG_MAX];	/* Per-algorithm op count */
+	uint64_t	esps_hdrops;	/* Packet shorter than header shows */
+	uint64_t	esps_nopf;	/* Protocol family not supported */
+	uint64_t	esps_notdb;
+	uint64_t	esps_badkcr;
+	uint64_t	esps_qfull;
+	uint64_t	esps_noxform;
+	uint64_t	esps_badilen;
+	uint64_t	esps_wrap;	/* Replay counter wrapped around */
+	uint64_t	esps_badenc;	/* Bad encryption detected */
+	uint64_t	esps_badauth;	/* Only valid for transforms with auth */
+	uint64_t	esps_replay;	/* Possible packet replay detected */
+	uint64_t	esps_input;	/* Input ESP packets */
+	uint64_t	esps_output;	/* Output ESP packets */
+	uint64_t	esps_invalid;	/* Trying to use an invalid TDB */
+	uint64_t	esps_ibytes;	/* Input bytes */
+	uint64_t	esps_obytes;	/* Output bytes */
+	uint64_t	esps_toobig;	/* Packet got larger than IP_MAXPACKET */
+	uint64_t	esps_pdrops;	/* Packet blocked due to policy */
+	uint64_t	esps_crypto;	/* Crypto processing failure */
+	uint64_t	esps_tunnel;	/* Tunnel sanity check failure */
+	uint64_t	esps_hist[ESP_ALG_MAX];	/* Per-algorithm op count */
 };
 
 #ifdef _KERNEL

Modified: head/sys/netipsec/ipcomp_var.h
==============================================================================
--- head/sys/netipsec/ipcomp_var.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netipsec/ipcomp_var.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -41,27 +41,26 @@
  */
 #define	IPCOMP_ALG_MAX	8
 
-#define	IPCOMPSTAT_VERSION	1
+#define	IPCOMPSTAT_VERSION	2
 struct ipcompstat {
-	u_int32_t	ipcomps_hdrops;	/* Packet shorter than header shows */
-	u_int32_t	ipcomps_nopf;	/* Protocol family not supported */
-	u_int32_t	ipcomps_notdb;
-	u_int32_t	ipcomps_badkcr;
-	u_int32_t	ipcomps_qfull;
-	u_int32_t	ipcomps_noxform;
-	u_int32_t	ipcomps_wrap;
-	u_int32_t	ipcomps_input;	/* Input IPcomp packets */
-	u_int32_t	ipcomps_output;	/* Output IPcomp packets */
-	u_int32_t	ipcomps_invalid;/* Trying to use an invalid TDB */
-	u_int64_t	ipcomps_ibytes;	/* Input bytes */
-	u_int64_t	ipcomps_obytes;	/* Output bytes */
-	u_int32_t	ipcomps_toobig;	/* Packet got > IP_MAXPACKET */
-	u_int32_t	ipcomps_pdrops;	/* Packet blocked due to policy */
-	u_int32_t	ipcomps_crypto;	/* "Crypto" processing failure */
-	u_int32_t	ipcomps_hist[IPCOMP_ALG_MAX];/* Per-algorithm op count */
-	u_int32_t	version;	/* Version of this structure. */
-	u_int32_t	ipcomps_threshold; /* Packet < comp. algo. threshold. */
-	u_int32_t	ipcomps_uncompr; /* Compression was useles. */
+	uint64_t	ipcomps_hdrops;	/* Packet shorter than header shows */
+	uint64_t	ipcomps_nopf;	/* Protocol family not supported */
+	uint64_t	ipcomps_notdb;
+	uint64_t	ipcomps_badkcr;
+	uint64_t	ipcomps_qfull;
+	uint64_t	ipcomps_noxform;
+	uint64_t	ipcomps_wrap;
+	uint64_t	ipcomps_input;	/* Input IPcomp packets */
+	uint64_t	ipcomps_output;	/* Output IPcomp packets */
+	uint64_t	ipcomps_invalid;/* Trying to use an invalid TDB */
+	uint64_t	ipcomps_ibytes;	/* Input bytes */
+	uint64_t	ipcomps_obytes;	/* Output bytes */
+	uint64_t	ipcomps_toobig;	/* Packet got > IP_MAXPACKET */
+	uint64_t	ipcomps_pdrops;	/* Packet blocked due to policy */
+	uint64_t	ipcomps_crypto;	/* "Crypto" processing failure */
+	uint64_t	ipcomps_hist[IPCOMP_ALG_MAX];/* Per-algorithm op count */
+	uint64_t	ipcomps_threshold; /* Packet < comp. algo. threshold. */
+	uint64_t	ipcomps_uncompr; /* Compression was useles. */
 };
 
 #ifdef _KERNEL

Modified: head/sys/netipsec/ipip_var.h
==============================================================================
--- head/sys/netipsec/ipip_var.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netipsec/ipip_var.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -44,18 +44,17 @@
  * Not quite all the functionality of RFC-1853, but the main idea is there.
  */
 
-struct ipipstat
-{
-    u_int32_t	ipips_ipackets;		/* total input packets */
-    u_int32_t	ipips_opackets;		/* total output packets */
-    u_int32_t	ipips_hdrops;		/* packet shorter than header shows */
-    u_int32_t	ipips_qfull;
-    u_int64_t   ipips_ibytes;
-    u_int64_t   ipips_obytes;
-    u_int32_t	ipips_pdrops;		/* packet dropped due to policy */
-    u_int32_t	ipips_spoof;		/* IP spoofing attempts */
-    u_int32_t   ipips_family;		/* Protocol family mismatch */
-    u_int32_t   ipips_unspec;            /* Missing tunnel endpoint address */
+struct ipipstat {
+	uint64_t	ipips_ipackets;	/* total input packets */
+	uint64_t	ipips_opackets;	/* total output packets */
+	uint64_t	ipips_hdrops;	/* packet shorter than header shows */
+	uint64_t	ipips_qfull;
+	uint64_t	ipips_ibytes;
+	uint64_t	ipips_obytes;
+	uint64_t	ipips_pdrops;	/* packet dropped due to policy */
+	uint64_t	ipips_spoof;	/* IP spoofing attempts */
+	uint64_t	ipips_family;	/* Protocol family mismatch */
+	uint64_t	ipips_unspec;   /* Missing tunnel endpoint address */
 };
 
 #ifdef _KERNEL

Modified: head/sys/netipsec/ipsec.h
==============================================================================
--- head/sys/netipsec/ipsec.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netipsec/ipsec.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -217,54 +217,54 @@ struct secspacq {
 
 /* statistics for ipsec processing */
 struct ipsecstat {
-	u_quad_t in_success;  /* succeeded inbound process */
-	u_quad_t in_polvio;
+	uint64_t in_success;  /* succeeded inbound process */
+	uint64_t in_polvio;
 			/* security policy violation for inbound process */
-	u_quad_t in_nosa;     /* inbound SA is unavailable */
-	u_quad_t in_inval;    /* inbound processing failed due to EINVAL */
-	u_quad_t in_nomem;    /* inbound processing failed due to ENOBUFS */
-	u_quad_t in_badspi;   /* failed getting a SPI */
-	u_quad_t in_ahreplay; /* AH replay check failed */
-	u_quad_t in_espreplay; /* ESP replay check failed */
-	u_quad_t in_ahauthsucc; /* AH authentication success */
-	u_quad_t in_ahauthfail; /* AH authentication failure */
-	u_quad_t in_espauthsucc; /* ESP authentication success */
-	u_quad_t in_espauthfail; /* ESP authentication failure */
-	u_quad_t in_esphist[256];
-	u_quad_t in_ahhist[256];
-	u_quad_t in_comphist[256];
-	u_quad_t out_success; /* succeeded outbound process */
-	u_quad_t out_polvio;
+	uint64_t in_nosa;     /* inbound SA is unavailable */
+	uint64_t in_inval;    /* inbound processing failed due to EINVAL */
+	uint64_t in_nomem;    /* inbound processing failed due to ENOBUFS */
+	uint64_t in_badspi;   /* failed getting a SPI */
+	uint64_t in_ahreplay; /* AH replay check failed */
+	uint64_t in_espreplay; /* ESP replay check failed */
+	uint64_t in_ahauthsucc; /* AH authentication success */
+	uint64_t in_ahauthfail; /* AH authentication failure */
+	uint64_t in_espauthsucc; /* ESP authentication success */
+	uint64_t in_espauthfail; /* ESP authentication failure */
+	uint64_t in_esphist[256];
+	uint64_t in_ahhist[256];
+	uint64_t in_comphist[256];
+	uint64_t out_success; /* succeeded outbound process */
+	uint64_t out_polvio;
 			/* security policy violation for outbound process */
-	u_quad_t out_nosa;    /* outbound SA is unavailable */
-	u_quad_t out_inval;   /* outbound process failed due to EINVAL */
-	u_quad_t out_nomem;    /* inbound processing failed due to ENOBUFS */
-	u_quad_t out_noroute; /* there is no route */
-	u_quad_t out_esphist[256];
-	u_quad_t out_ahhist[256];
-	u_quad_t out_comphist[256];
-
-	u_quad_t spdcachelookup;
-	u_quad_t spdcachemiss;
-
-	u_int32_t ips_in_polvio;	/* input: sec policy violation */
-	u_int32_t ips_out_polvio;	/* output: sec policy violation */
-	u_int32_t ips_out_nosa;		/* output: SA unavailable  */
-	u_int32_t ips_out_nomem;	/* output: no memory available */
-	u_int32_t ips_out_noroute;	/* output: no route available */
-	u_int32_t ips_out_inval;	/* output: generic error */
-	u_int32_t ips_out_bundlesa;	/* output: bundled SA processed */
-	u_int32_t ips_mbcoalesced;	/* mbufs coalesced during clone */
-	u_int32_t ips_clcoalesced;	/* clusters coalesced during clone */
-	u_int32_t ips_clcopied;		/* clusters copied during clone */
-	u_int32_t ips_mbinserted;	/* mbufs inserted during makespace */
+	uint64_t out_nosa;    /* outbound SA is unavailable */
+	uint64_t out_inval;   /* outbound process failed due to EINVAL */
+	uint64_t out_nomem;    /* inbound processing failed due to ENOBUFS */
+	uint64_t out_noroute; /* there is no route */
+	uint64_t out_esphist[256];
+	uint64_t out_ahhist[256];
+	uint64_t out_comphist[256];
+
+	uint64_t spdcachelookup;
+	uint64_t spdcachemiss;
+
+	uint64_t ips_in_polvio;		/* input: sec policy violation */
+	uint64_t ips_out_polvio;	/* output: sec policy violation */
+	uint64_t ips_out_nosa;		/* output: SA unavailable  */
+	uint64_t ips_out_nomem;		/* output: no memory available */
+	uint64_t ips_out_noroute;	/* output: no route available */
+	uint64_t ips_out_inval;		/* output: generic error */
+	uint64_t ips_out_bundlesa;	/* output: bundled SA processed */
+	uint64_t ips_mbcoalesced;	/* mbufs coalesced during clone */
+	uint64_t ips_clcoalesced;	/* clusters coalesced during clone */
+	uint64_t ips_clcopied;		/* clusters copied during clone */
+	uint64_t ips_mbinserted;	/* mbufs inserted during makespace */
 	/* 
 	 * Temporary statistics for performance analysis.
 	 */
 	/* See where ESP/AH/IPCOMP header land in mbuf on input */
-	u_int32_t ips_input_front;
-	u_int32_t ips_input_middle;
-	u_int32_t ips_input_end;
+	uint64_t ips_input_front;
+	uint64_t ips_input_middle;
+	uint64_t ips_input_end;
 };
 
 /*

Modified: head/sys/netipsec/keysock.h
==============================================================================
--- head/sys/netipsec/keysock.h	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netipsec/keysock.h	Tue Jul  9 09:32:06 2013	(r253081)
@@ -36,26 +36,26 @@
 /* statistics for pfkey socket */
 struct pfkeystat {
 	/* kernel -> userland */
-	u_quad_t out_total;		/* # of total calls */
-	u_quad_t out_bytes;		/* total bytecount */
-	u_quad_t out_msgtype[256];	/* message type histogram */
-	u_quad_t out_invlen;		/* invalid length field */
-	u_quad_t out_invver;		/* invalid version field */
-	u_quad_t out_invmsgtype;	/* invalid message type field */
-	u_quad_t out_tooshort;		/* msg too short */
-	u_quad_t out_nomem;		/* memory allocation failure */
-	u_quad_t out_dupext;		/* duplicate extension */
-	u_quad_t out_invexttype;	/* invalid extension type */
-	u_quad_t out_invsatype;		/* invalid sa type */
-	u_quad_t out_invaddr;		/* invalid address extension */
+	uint64_t out_total;		/* # of total calls */
+	uint64_t out_bytes;		/* total bytecount */
+	uint64_t out_msgtype[256];	/* message type histogram */
+	uint64_t out_invlen;		/* invalid length field */
+	uint64_t out_invver;		/* invalid version field */
+	uint64_t out_invmsgtype;	/* invalid message type field */
+	uint64_t out_tooshort;		/* msg too short */
+	uint64_t out_nomem;		/* memory allocation failure */
+	uint64_t out_dupext;		/* duplicate extension */
+	uint64_t out_invexttype;	/* invalid extension type */
+	uint64_t out_invsatype;		/* invalid sa type */
+	uint64_t out_invaddr;		/* invalid address extension */
 	/* userland -> kernel */
-	u_quad_t in_total;		/* # of total calls */
-	u_quad_t in_bytes;		/* total bytecount */
-	u_quad_t in_msgtype[256];	/* message type histogram */
-	u_quad_t in_msgtarget[3];	/* one/all/registered */
-	u_quad_t in_nomem;		/* memory allocation failure */
+	uint64_t in_total;		/* # of total calls */
+	uint64_t in_bytes;		/* total bytecount */
+	uint64_t in_msgtype[256];	/* message type histogram */
+	uint64_t in_msgtarget[3];	/* one/all/registered */
+	uint64_t in_nomem;		/* memory allocation failure */
 	/* others */
-	u_quad_t sockerr;		/* # of socket related errors */
+	uint64_t sockerr;		/* # of socket related errors */
 };
 
 #define KEY_SENDUP_ONE		0

Modified: head/sys/netipsec/xform_ipcomp.c
==============================================================================
--- head/sys/netipsec/xform_ipcomp.c	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/sys/netipsec/xform_ipcomp.c	Tue Jul  9 09:32:06 2013	(r253081)
@@ -636,8 +636,6 @@ static void
 vnet_ipcomp_attach(const void *unused __unused)
 {
 
-	/* XXX */
-	V_ipcompstat.version = IPCOMPSTAT_VERSION;
 }
 
 VNET_SYSINIT(vnet_ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE,

Modified: head/tools/tools/crypto/ipsecstats.c
==============================================================================
--- head/tools/tools/crypto/ipsecstats.c	Tue Jul  9 09:31:26 2013	(r253080)
+++ head/tools/tools/crypto/ipsecstats.c	Tue Jul  9 09:32:06 2013	(r253081)
@@ -82,7 +82,7 @@ algname(int a, const struct alg algs[], 
 int
 main(int argc, char *argv[])
 {
-#define	STAT(x,fmt)	if (x) printf(fmt "\n", x)
+#define	STAT(x,fmt)	if (x) printf(fmt "\n", (uintmax_t)x)
 	struct ipsecstat ips;
 	struct ahstat ahs;
 	struct espstat esps;
@@ -99,8 +99,7 @@ main(int argc, char *argv[])
 	if (sysctlbyname("net.inet.esp.stats", &esps, &slen, NULL, NULL) < 0)
 		err(1, "net.inet.esp.stats");
 
-#define	AHSTAT(x,fmt)	if (x) printf("ah " fmt ": %u\n", x)
-#define	AHSTAT64(x,fmt)	if (x) printf("ah " fmt ": %llu\n", x)
+#define	AHSTAT(x,fmt)	if (x) printf("ah " fmt ": %ju\n", (uintmax_t)x)
 	AHSTAT(ahs.ahs_input, "input packets processed");
 	AHSTAT(ahs.ahs_output, "output packets processed");
 	AHSTAT(ahs.ahs_hdrops, "headers too short");
@@ -120,17 +119,15 @@ main(int argc, char *argv[])
 	AHSTAT(ahs.ahs_tunnel, "tunnel sanity check failures");
 	for (i = 0; i < AH_ALG_MAX; i++)
 		if (ahs.ahs_hist[i])
-			printf("ah packets with %s: %u\n"
+			printf("ah packets with %s: %ju\n"
 				, algname(i, aalgs, N(aalgs))
-				, ahs.ahs_hist[i]
+				, (uintmax_t)ahs.ahs_hist[i]
 			);
-	AHSTAT64(ahs.ahs_ibytes, "bytes received");
-	AHSTAT64(ahs.ahs_obytes, "bytes transmitted");
-#undef AHSTAT64
+	AHSTAT(ahs.ahs_ibytes, "bytes received");
+	AHSTAT(ahs.ahs_obytes, "bytes transmitted");
 #undef AHSTAT
 
-#define	ESPSTAT(x,fmt)	if (x) printf("esp " fmt ": %u\n", x)
-#define	ESPSTAT64(x,fmt)	if (x) printf("esp " fmt ": %llu\n", x)
+#define	ESPSTAT(x,fmt)	if (x) printf("esp " fmt ": %ju\n", (uintmax_t)x)
 	ESPSTAT(esps.esps_input, "input packets processed");
 	ESPSTAT(esps.esps_output, "output packets processed");
 	ESPSTAT(esps.esps_hdrops, "headers too short");
@@ -151,29 +148,30 @@ main(int argc, char *argv[])
 	ESPSTAT(esps.esps_tunnel, "tunnel sanity check failures");
 	for (i = 0; i < ESP_ALG_MAX; i++)
 		if (esps.esps_hist[i])
-			printf("esp packets with %s: %u\n"
+			printf("esp packets with %s: %ju\n"
 				, algname(i, espalgs, N(espalgs))
-				, esps.esps_hist[i]
+				, (uintmax_t)esps.esps_hist[i]
 			);
-	ESPSTAT64(esps.esps_ibytes, "bytes received");
-	ESPSTAT64(esps.esps_obytes, "bytes transmitted");
-#undef ESPSTAT64
+	ESPSTAT(esps.esps_ibytes, "bytes received");
+	ESPSTAT(esps.esps_obytes, "bytes transmitted");
 #undef ESPSTAT
 
 	printf("\n");
 	if (ips.ips_in_polvio+ips.ips_out_polvio)
-		printf("policy violations: input %u output %u\n",
-			ips.ips_in_polvio, ips.ips_out_polvio);
-	STAT(ips.ips_out_nosa, "no SA found %u (output)");
-	STAT(ips.ips_out_nomem, "no memory available %u (output)");
-	STAT(ips.ips_out_noroute, "no route available %u (output)");
-	STAT(ips.ips_out_inval, "generic error %u (output)");
-	STAT(ips.ips_out_bundlesa, "bundled SA processed %u (output)");
-	printf("m_clone processing: %u mbufs + %u clusters coalesced\n",
-		ips.ips_mbcoalesced, ips.ips_clcoalesced);
-	printf("m_clone processing: %u clusters copied\n", ips.ips_clcopied);
-	printf("m_makespace: %u mbufs inserted\n", ips.ips_mbinserted);
-	printf("header position [front/middle/end]: %u/%u/%u\n",
-		ips.ips_input_front, ips.ips_input_middle, ips.ips_input_end);
+		printf("policy violations: input %ju output %ju\n",
+		    (uintmax_t)ips.ips_in_polvio,
+		    (uintmax_t)ips.ips_out_polvio);

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

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 09:37:22 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 37B8C1F1;
 Tue,  9 Jul 2013 09:37:22 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 1AA051450;
 Tue,  9 Jul 2013 09:37:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r699bL6T034960;
 Tue, 9 Jul 2013 09:37:21 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r699bLVo034958;
 Tue, 9 Jul 2013 09:37:21 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201307090937.r699bLVo034958@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 9 Jul 2013 09:37:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253082 - in head/sys: net sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 09:37:22 -0000

Author: ae
Date: Tue Jul  9 09:37:21 2013
New Revision: 253082
URL: http://svnweb.freebsd.org/changeset/base/253082

Log:
  Add several macros to help migrate statistics structures to PCPU counters.

Modified:
  head/sys/net/vnet.h
  head/sys/sys/counter.h

Modified: head/sys/net/vnet.h
==============================================================================
--- head/sys/net/vnet.h	Tue Jul  9 09:32:06 2013	(r253081)
+++ head/sys/net/vnet.h	Tue Jul  9 09:37:21 2013	(r253082)
@@ -85,6 +85,55 @@ struct vnet {
 
 #ifdef _KERNEL
 
+#define	VNET_PCPUSTAT_DECLARE(type, name)	\
+    VNET_DECLARE(counter_u64_t, name[sizeof(type) / sizeof(uint64_t)])
+
+#define	VNET_PCPUSTAT_DEFINE(type, name)	\
+    VNET_DEFINE(counter_u64_t, name[sizeof(type) / sizeof(uint64_t)])
+
+#define	VNET_PCPUSTAT_ALLOC(name, wait)	\
+    COUNTER_ARRAY_ALLOC(VNET(name), \
+	sizeof(VNET(name)) / sizeof(counter_u64_t), (wait))
+
+#define	VNET_PCPUSTAT_FREE(name)	\
+    COUNTER_ARRAY_FREE(VNET(name), sizeof(VNET(name)) / sizeof(counter_u64_t))
+
+#define	VNET_PCPUSTAT_ADD(type, name, f, v)	\
+    counter_u64_add(VNET(name)[offsetof(type, f) / sizeof(uint64_t)], (v))
+
+#define	VNET_PCPUSTAT_SYSINIT(name)	\
+static void				\
+vnet_##name##_init(const void *unused)	\
+{					\
+	VNET_PCPUSTAT_ALLOC(name, M_WAITOK);	\
+}					\
+VNET_SYSINIT(vnet_ ## name ## _init, SI_SUB_PROTO_IFATTACHDOMAIN,	\
+    SI_ORDER_ANY, vnet_ ## name ## _init, NULL)
+
+#define	VNET_PCPUSTAT_SYSUNINIT(name)					\
+static void								\
+vnet_##name##_uninit(const void *unused)				\
+{									\
+	VNET_PCPUSTAT_FREE(name);					\
+}									\
+VNET_SYSUNINIT(vnet_ ## name ## _uninit, SI_SUB_PROTO_IFATTACHDOMAIN,	\
+    SI_ORDER_ANY, vnet_ ## name ## _uninit, NULL)
+
+#define	SYSCTL_VNET_PCPUSTAT(parent, nbr, name, type, array, desc)	\
+static int								\
+array##_sysctl(SYSCTL_HANDLER_ARGS)					\
+{									\
+	type s;								\
+	CTASSERT(sizeof(type) == sizeof(VNET(array)));			\
+	COUNTER_ARRAY_COPY(VNET(array), &s, sizeof(type) / sizeof(uint64_t));\
+	if (req->newptr)						\
+		COUNTER_ARRAY_ZERO(VNET(array),				\
+		    sizeof(type) / sizeof(uint64_t));			\
+	return (SYSCTL_OUT(req, &s, sizeof(type)));			\
+}									\
+SYSCTL_VNET_PROC(parent, nbr, name, CTLTYPE_OPAQUE | CTLFLAG_RW, NULL,	\
+    0, array ## _sysctl, "I", desc)
+
 #ifdef VIMAGE
 #include 
 #include 			/* for struct thread */

Modified: head/sys/sys/counter.h
==============================================================================
--- head/sys/sys/counter.h	Tue Jul  9 09:32:06 2013	(r253081)
+++ head/sys/sys/counter.h	Tue Jul  9 09:37:21 2013	(r253082)
@@ -39,4 +39,23 @@ void		counter_u64_free(counter_u64_t);
 void		counter_u64_zero(counter_u64_t);
 uint64_t	counter_u64_fetch(counter_u64_t);
 
+#define	COUNTER_ARRAY_ALLOC(a, n, wait)	do {			\
+	for (int i = 0; i < (n); i++)				\
+		(a)[i] = counter_u64_alloc(wait);		\
+} while (0)
+
+#define	COUNTER_ARRAY_FREE(a, n)	do {			\
+	for (int i = 0; i < (n); i++)				\
+		counter_u64_free((a)[i]);			\
+} while (0)
+
+#define	COUNTER_ARRAY_COPY(a, dstp, n)	do {			\
+	for (int i = 0; i < (n); i++)				\
+		((uint64_t *)(dstp))[i] = counter_u64_fetch((a)[i]);\
+} while (0)
+
+#define	COUNTER_ARRAY_ZERO(a, n)	do {			\
+	for (int i = 0; i < (n); i++)				\
+		counter_u64_zero((a)[i]);			\
+} while (0)
 #endif	/* ! __SYS_COUNTER_H__ */

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 09:43:05 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 21BF5536;
 Tue,  9 Jul 2013 09:43:05 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 0E6051497;
 Tue,  9 Jul 2013 09:43:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r699h5RF037256;
 Tue, 9 Jul 2013 09:43:05 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r699h3GV037246;
 Tue, 9 Jul 2013 09:43:03 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201307090943.r699h3GV037246@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 9 Jul 2013 09:43:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253083 - in head: sys/netinet usr.bin/netstat
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 09:43:05 -0000

Author: ae
Date: Tue Jul  9 09:43:03 2013
New Revision: 253083
URL: http://svnweb.freebsd.org/changeset/base/253083

Log:
  Use new macros to implement ipstat and tcpstat using PCPU counters.
  Change interface of kread_counters() similar ot kread() in the netstat(1).

Modified:
  head/sys/netinet/ip_input.c
  head/sys/netinet/ip_var.h
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_var.h
  head/usr.bin/netstat/inet.c
  head/usr.bin/netstat/main.c
  head/usr.bin/netstat/netstat.h

Modified: head/sys/netinet/ip_input.c
==============================================================================
--- head/sys/netinet/ip_input.c	Tue Jul  9 09:37:21 2013	(r253082)
+++ head/sys/netinet/ip_input.c	Tue Jul  9 09:43:03 2013	(r253083)
@@ -208,73 +208,17 @@ SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, 
 static void	ip_freef(struct ipqhead *, struct ipq *);
 
 /*
- * IP statistics are stored in struct ipstat_p, which is
- * an "array" of counter(9)s.  Although it isn't a real
- * array, we treat it as array to reduce code bloat.
+ * IP statistics are stored in the "array" of counter(9)s.
  */
-VNET_DEFINE(struct ipstat_p, ipstatp);
-
-static void
-vnet_ipstatp_init(const void *unused)
-{
-	counter_u64_t *c;
-	int i;
-
-	for (i = 0, c = (counter_u64_t *)&V_ipstatp;
-	    i < sizeof(V_ipstatp) / sizeof(counter_u64_t);
-	    i++, c++) {
-		*c = counter_u64_alloc(M_WAITOK);
-		counter_u64_zero(*c);
-	}
-}
-VNET_SYSINIT(vnet_ipstatp_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY,
-            vnet_ipstatp_init, NULL);
+VNET_PCPUSTAT_DEFINE(struct ipstat, ipstat);
+VNET_PCPUSTAT_SYSINIT(ipstat);
+SYSCTL_VNET_PCPUSTAT(_net_inet_ip, IPCTL_STATS, stats, struct ipstat, ipstat,
+    "IP statistics (struct ipstat, netinet/ip_var.h)");
 
 #ifdef VIMAGE
-static void
-vnet_ipstatp_uninit(const void *unused)
-{
-	counter_u64_t *c;
-	int i;
-
-	for (i = 0, c = (counter_u64_t *)&V_ipstatp;
-	    i < sizeof(V_ipstatp) / sizeof(counter_u64_t);
-	    i++, c++)
-		counter_u64_free(*c);
-}
-VNET_SYSUNINIT(vnet_ipstatp_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY,
-            vnet_ipstatp_uninit, NULL);
+VNET_PCPUSTAT_SYSUNINIT(ipstat);
 #endif /* VIMAGE */
 
-static int
-ipstat_sysctl(SYSCTL_HANDLER_ARGS)
-{
-	struct ipstat ipstat;
-	counter_u64_t *c;
-	uint64_t *v;
-	int i;
-
-	for (i = 0, c = (counter_u64_t *)&V_ipstatp, v = (uint64_t *)&ipstat;
-	    i < sizeof(V_ipstatp) / sizeof(counter_u64_t);
-	    i++, c++, v++) {
-		*v = counter_u64_fetch(*c);
-		/*
-		 * Old interface allowed to rewrite 'struct ipstat', and
-		 * netstat(1) used it to zero the structure. To keep
-		 * compatibility with old netstat(1) we will zero out
-		 * statistics on every write attempt, however we no longer
-		 * support writing arbitrary fake values to the statistics.
-		 */
-		if (req->newptr)
-			counter_u64_zero(*c);
-	}
-
-	return (SYSCTL_OUT(req, &ipstat, sizeof(ipstat)));
-}
-SYSCTL_VNET_PROC(_net_inet_ip, IPCTL_STATS, stats, CTLTYPE_OPAQUE | CTLFLAG_RW,
-    NULL, 0, ipstat_sysctl, "I",
-    "IP statistics (struct ipstat, netinet/ip_var.h)");
-
 /*
  * Kernel module interface for updating ipstat.  The argument is an index
  * into ipstat treated as an array.
@@ -283,14 +227,14 @@ void
 kmod_ipstat_inc(int statnum)
 {
 
-	counter_u64_add(*((counter_u64_t *)&V_ipstatp + statnum), 1);
+	counter_u64_add(VNET(ipstat)[statnum], 1);
 }
 
 void
 kmod_ipstat_dec(int statnum)
 {
 
-	counter_u64_add(*((counter_u64_t *)&V_ipstatp + statnum), -1);
+	counter_u64_add(VNET(ipstat)[statnum], -1);
 }
 
 static int

Modified: head/sys/netinet/ip_var.h
==============================================================================
--- head/sys/netinet/ip_var.h	Tue Jul  9 09:37:21 2013	(r253082)
+++ head/sys/netinet/ip_var.h	Tue Jul  9 09:43:03 2013	(r253083)
@@ -133,46 +133,13 @@ struct	ipstat {
 #include 
 #include 
 
-/* Should match 'struct ipstat' above. */
-struct ipstat_p {
-	counter_u64_t ips_total;
-	counter_u64_t ips_badsum;
-	counter_u64_t ips_tooshort;
-	counter_u64_t ips_toosmall;
-	counter_u64_t ips_badhlen;
-	counter_u64_t ips_badlen;
-	counter_u64_t ips_fragments;
-	counter_u64_t ips_fragdropped;
-	counter_u64_t ips_fragtimeout;
-	counter_u64_t ips_forward;
-	counter_u64_t ips_fastforward;
-	counter_u64_t ips_cantforward;
-	counter_u64_t ips_redirectsent;
-	counter_u64_t ips_noproto;
-	counter_u64_t ips_delivered;
-	counter_u64_t ips_localout;
-	counter_u64_t ips_odropped;
-	counter_u64_t ips_reassembled;
-	counter_u64_t ips_fragmented;
-	counter_u64_t ips_ofragments;
-	counter_u64_t ips_cantfrag;
-	counter_u64_t ips_badoptions;
-	counter_u64_t ips_noroute;
-	counter_u64_t ips_badvers;
-	counter_u64_t ips_rawout;
-	counter_u64_t ips_toolong;
-	counter_u64_t ips_notmember;
-	counter_u64_t ips_nogif;
-	counter_u64_t ips_badaddr;
-};
-VNET_DECLARE(struct ipstat_p, ipstatp);
-#define	V_ipstatp VNET(ipstatp)
-
+VNET_PCPUSTAT_DECLARE(struct ipstat, ipstat);
 /*
  * In-kernel consumers can use these accessor macros directly to update
  * stats.
  */
-#define	IPSTAT_ADD(name, val)	counter_u64_add(V_ipstatp.name, (val))
+#define	IPSTAT_ADD(name, val)	\
+    VNET_PCPUSTAT_ADD(struct ipstat, ipstat, name, (val))
 #define	IPSTAT_SUB(name, val)	IPSTAT_ADD(name, -(val))
 #define	IPSTAT_INC(name)	IPSTAT_ADD(name, 1)
 #define	IPSTAT_DEC(name)	IPSTAT_SUB(name, 1)
@@ -181,11 +148,11 @@ VNET_DECLARE(struct ipstat_p, ipstatp);
  * Kernel module consumers must use this accessor macro.
  */
 void	kmod_ipstat_inc(int statnum);
-#define	KMOD_IPSTAT_INC(name)						\
-	kmod_ipstat_inc(offsetof(struct ipstat_p, name) / sizeof(counter_u64_t))
+#define	KMOD_IPSTAT_INC(name)	\
+    kmod_ipstat_inc(offsetof(struct ipstat, name) / sizeof(uint64_t))
 void	kmod_ipstat_dec(int statnum);
-#define	KMOD_IPSTAT_DEC(name)						\
-	kmod_ipstat_dec(offsetof(struct ipstat_p, name) / sizeof(counter_u64_t))
+#define	KMOD_IPSTAT_DEC(name)	\
+    kmod_ipstat_dec(offsetof(struct ipstat, name) / sizeof(uint64_t))
 
 /* flags passed to ip_output as last parameter */
 #define	IP_FORWARDING		0x1		/* most of ip header exists */

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Tue Jul  9 09:37:21 2013	(r253082)
+++ head/sys/netinet/tcp_input.c	Tue Jul  9 09:43:03 2013	(r253083)
@@ -240,67 +240,16 @@ static void inline	hhook_run_tcp_est_in(
 			    struct tcphdr *th, struct tcpopt *to);
 
 /*
- * TCP statistics are stored in struct tcpstat_p, which is
- * an "array" of counter(9)s.  Although it isn't a real
- * array, we treat it as array to reduce code bloat.
+ * TCP statistics are stored in an "array" of counter(9)s.
  */
-VNET_DEFINE(struct tcpstat_p, tcpstatp);
-
-static void
-vnet_tcpstatp_init(const void *unused)
-{
-	counter_u64_t *c;
-	int i;
-
-	for (i = 0, c = (counter_u64_t *)&V_tcpstatp;
-	    i < sizeof(V_tcpstatp) / sizeof(counter_u64_t);
-	    i++, c++) {
-		*c = counter_u64_alloc(M_WAITOK);
-		counter_u64_zero(*c);
-	}
-}
-VNET_SYSINIT(vnet_tcpstatp_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY,
-	    vnet_tcpstatp_init, NULL);
+VNET_PCPUSTAT_DEFINE(struct tcpstat, tcpstat);
+VNET_PCPUSTAT_SYSINIT(tcpstat);
+SYSCTL_VNET_PCPUSTAT(_net_inet_tcp, TCPCTL_STATS, stats, struct tcpstat,
+    tcpstat, "TCP statistics (struct tcpstat, netinet/tcp_var.h)");
 
 #ifdef VIMAGE
-static void
-vnet_tcpstatp_uninit(const void *unused)
-{
-	counter_u64_t *c;
-	int i;
-
-	for (i = 0, c = (counter_u64_t *)&V_tcpstatp;
-	    i < sizeof(V_tcpstatp) / sizeof(counter_u64_t);
-	    i++, c++)
-		counter_u64_free(*c);
-}
-VNET_SYSUNINIT(vnet_tcpstatp_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY,
-	    vnet_tcpstatp_uninit, NULL);
+VNET_PCPUSTAT_SYSUNINIT(tcpstat);
 #endif /* VIMAGE */
-
-static int
-tcpstat_sysctl(SYSCTL_HANDLER_ARGS)
-{
-	struct tcpstat tcpstat;
-	counter_u64_t *c;
-	uint64_t *v;
-	int i;
-
-	for (i = 0, c = (counter_u64_t *)&V_tcpstatp, v = (uint64_t *)&tcpstat;
-	    i < sizeof(V_tcpstatp) / sizeof(counter_u64_t);
-	    i++, c++, v++) {
-		*v = counter_u64_fetch(*c);
-		if (req->newptr)
-			counter_u64_zero(*c);
-	}
-
-	return (SYSCTL_OUT(req, &tcpstat, sizeof(tcpstat)));
-}
-
-SYSCTL_VNET_PROC(_net_inet_tcp, TCPCTL_STATS, stats, CTLTYPE_OPAQUE |
-    CTLFLAG_RW, NULL, 0, tcpstat_sysctl, "I", 
-    "TCP statistics (struct tcpstat, netinet/tcp_var.h)");
-
 /*
  * Kernel module interface for updating tcpstat.  The argument is an index
  * into tcpstat treated as an array.
@@ -309,7 +258,7 @@ void
 kmod_tcpstat_inc(int statnum)
 {
 
-	counter_u64_add(*((counter_u64_t *)&V_tcpstatp + statnum), 1);
+	counter_u64_add(VNET(tcpstat)[statnum], 1);
 }
 
 /*

Modified: head/sys/netinet/tcp_var.h
==============================================================================
--- head/sys/netinet/tcp_var.h	Tue Jul  9 09:37:21 2013	(r253082)
+++ head/sys/netinet/tcp_var.h	Tue Jul  9 09:43:03 2013	(r253083)
@@ -514,119 +514,15 @@ struct	tcpstat {
 };
 
 #ifdef _KERNEL
-
 #include 
 
-/* Should match 'struct tcpstat' above. */
-struct tcpstat_p {
-	counter_u64_t tcps_connattempt;
-	counter_u64_t tcps_accepts;
-	counter_u64_t tcps_connects;
-	counter_u64_t tcps_drops;
-	counter_u64_t tcps_conndrops;
-	counter_u64_t tcps_minmssdrops;
-	counter_u64_t tcps_closed;
-	counter_u64_t tcps_segstimed;
-	counter_u64_t tcps_rttupdated;
-	counter_u64_t tcps_delack;
-	counter_u64_t tcps_timeoutdrop;
-	counter_u64_t tcps_rexmttimeo;
-	counter_u64_t tcps_persisttimeo;
-	counter_u64_t tcps_keeptimeo;
-	counter_u64_t tcps_keepprobe;
-	counter_u64_t tcps_keepdrops;
-	counter_u64_t tcps_sndtotal;
-	counter_u64_t tcps_sndpack;
-	counter_u64_t tcps_sndbyte;
-	counter_u64_t tcps_sndrexmitpack;
-	counter_u64_t tcps_sndrexmitbyte;
-	counter_u64_t tcps_sndrexmitbad;
-	counter_u64_t tcps_sndacks;
-	counter_u64_t tcps_sndprobe;
-	counter_u64_t tcps_sndurg;
-	counter_u64_t tcps_sndwinup;
-	counter_u64_t tcps_sndctrl;
-	counter_u64_t tcps_rcvtotal;
-	counter_u64_t tcps_rcvpack;
-	counter_u64_t tcps_rcvbyte;
-	counter_u64_t tcps_rcvbadsum;
-	counter_u64_t tcps_rcvbadoff;
-	counter_u64_t tcps_rcvmemdrop;
-	counter_u64_t tcps_rcvshort;
-	counter_u64_t tcps_rcvduppack;
-	counter_u64_t tcps_rcvdupbyte;
-	counter_u64_t tcps_rcvpartduppack;
-	counter_u64_t tcps_rcvpartdupbyte;
-	counter_u64_t tcps_rcvoopack;
-	counter_u64_t tcps_rcvoobyte;
-	counter_u64_t tcps_rcvpackafterwin;
-	counter_u64_t tcps_rcvbyteafterwin;
-	counter_u64_t tcps_rcvafterclose;
-	counter_u64_t tcps_rcvwinprobe;
-	counter_u64_t tcps_rcvdupack;
-	counter_u64_t tcps_rcvacktoomuch;
-	counter_u64_t tcps_rcvackpack;
-	counter_u64_t tcps_rcvackbyte;
-	counter_u64_t tcps_rcvwinupd;
-	counter_u64_t tcps_pawsdrop;
-	counter_u64_t tcps_predack;
-	counter_u64_t tcps_preddat;
-	counter_u64_t tcps_pcbcachemiss;
-	counter_u64_t tcps_cachedrtt;
-	counter_u64_t tcps_cachedrttvar;
-	counter_u64_t tcps_cachedssthresh;
-	counter_u64_t tcps_usedrtt;
-	counter_u64_t tcps_usedrttvar;
-	counter_u64_t tcps_usedssthresh;
-	counter_u64_t tcps_persistdrop;
-	counter_u64_t tcps_badsyn;
-	counter_u64_t tcps_mturesent;
-	counter_u64_t tcps_listendrop;
-	counter_u64_t tcps_badrst;
-	counter_u64_t tcps_sc_added;
-	counter_u64_t tcps_sc_retransmitted;
-	counter_u64_t tcps_sc_dupsyn;
-	counter_u64_t tcps_sc_dropped;
-	counter_u64_t tcps_sc_completed;
-	counter_u64_t tcps_sc_bucketoverflow;
-	counter_u64_t tcps_sc_cacheoverflow;
-	counter_u64_t tcps_sc_reset;
-	counter_u64_t tcps_sc_stale;
-	counter_u64_t tcps_sc_aborted;
-	counter_u64_t tcps_sc_badack;
-	counter_u64_t tcps_sc_unreach;
-	counter_u64_t tcps_sc_zonefail;
-	counter_u64_t tcps_sc_sendcookie;
-	counter_u64_t tcps_sc_recvcookie;
-	counter_u64_t tcps_hc_added;
-	counter_u64_t tcps_hc_bucketoverflow;
-	counter_u64_t tcps_finwait2_drops;
-	counter_u64_t tcps_sack_recovery_episode;
-	counter_u64_t tcps_sack_rexmits;
-	counter_u64_t tcps_sack_rexmit_bytes;
-	counter_u64_t tcps_sack_rcv_blocks;
-	counter_u64_t tcps_sack_send_blocks;
-	counter_u64_t tcps_sack_sboverflow;
-	counter_u64_t tcps_ecn_ce;
-	counter_u64_t tcps_ecn_ect0;
-	counter_u64_t tcps_ecn_ect1;
-	counter_u64_t tcps_ecn_shs;
-	counter_u64_t tcps_ecn_rcwnd;
-	counter_u64_t tcps_sig_rcvgoodsig;
-	counter_u64_t tcps_sig_rcvbadsig;
-	counter_u64_t tcps_sig_err_buildsig;
-	counter_u64_t tcps_sig_err_sigopt;
-	counter_u64_t tcps_sig_err_nosigopt;
-};
-
-VNET_DECLARE(struct tcpstat_p, tcpstatp);	/* tcp statistics */
-#define	V_tcpstatp VNET(tcpstatp)
-
+VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat);	/* tcp statistics */
 /*
  * In-kernel consumers can use these accessor macros directly to update
  * stats.
  */
-#define	TCPSTAT_ADD(name, val)	counter_u64_add(V_tcpstatp.name, (val))
+#define	TCPSTAT_ADD(name, val)	\
+    VNET_PCPUSTAT_ADD(struct tcpstat, tcpstat, name, (val))
 #define	TCPSTAT_INC(name)	TCPSTAT_ADD(name, 1)
 
 /*
@@ -634,8 +530,7 @@ VNET_DECLARE(struct tcpstat_p, tcpstatp)
  */
 void	kmod_tcpstat_inc(int statnum);
 #define	KMOD_TCPSTAT_INC(name)						\
-	kmod_tcpstat_inc(offsetof(struct tcpstat_p, name) /		\
-	sizeof(counter_u64_t))
+    kmod_tcpstat_inc(offsetof(struct tcpstat, name) / sizeof(uint64_t))
 
 /*
  * TCP specific helper hook point identifiers.

Modified: head/usr.bin/netstat/inet.c
==============================================================================
--- head/usr.bin/netstat/inet.c	Tue Jul  9 09:37:21 2013	(r253082)
+++ head/usr.bin/netstat/inet.c	Tue Jul  9 09:43:03 2013	(r253083)
@@ -603,13 +603,8 @@ tcp_stats(u_long off, const char *name, 
 			warn("sysctl: net.inet.tcp.stats");
 			return;
 		}
-	} else {
-		u_long tcpstat_p[sizeof(struct tcpstat)/sizeof(uint64_t)];
- 
-		kread(off, &tcpstat_p, sizeof(tcpstat_p));
-		kread_counters(tcpstat_p, (uint64_t *)&tcpstat,
-		    sizeof(struct tcpstat)/sizeof(uint64_t));
-	}
+	} else
+		kread_counters(off, &tcpstat, len);
 
 	printf ("%s:\n", name);
 
@@ -863,13 +858,8 @@ ip_stats(u_long off, const char *name, i
 			warn("sysctl: net.inet.ip.stats");
 			return;
 		}
-	} else {
-		u_long ipstat_p[sizeof(struct ipstat)/sizeof(uint64_t)];
-
-		kread(off, &ipstat_p, sizeof(ipstat_p));
-		kread_counters(ipstat_p, (uint64_t *)&ipstat,
-		    sizeof(struct ipstat)/sizeof(uint64_t));
-	}
+	} else
+		kread_counters(off, &ipstat, len);
 
 	printf("%s:\n", name);
 

Modified: head/usr.bin/netstat/main.c
==============================================================================
--- head/usr.bin/netstat/main.c	Tue Jul  9 09:37:21 2013	(r253082)
+++ head/usr.bin/netstat/main.c	Tue Jul  9 09:43:03 2013	(r253083)
@@ -147,11 +147,11 @@ static struct nlist nl[] = {
 #define	N_IPCOMPSTAT	37
 	{ .n_name = "_ipcompstat" },
 #define	N_TCPSTAT	38
-	{ .n_name = "_tcpstatp" },
+	{ .n_name = "_tcpstat" },
 #define	N_UDPSTAT	39
 	{ .n_name = "_udpstat" },
 #define	N_IPSTAT	40
-	{ .n_name = "_ipstatp" },
+	{ .n_name = "_ipstat" },
 #define	N_ICMPSTAT	41
 	{ .n_name = "_icmpstat" },
 #define	N_IGMPSTAT	42
@@ -753,15 +753,21 @@ kread(u_long addr, void *buf, size_t siz
  * Read an array of N counters in kernel memory into array of N uint64_t's.
  */
 int
-kread_counters(u_long *addr, uint64_t *rval, size_t count)
+kread_counters(u_long addr, void *buf, size_t size)
 {
+	uint64_t *c = buf;
 
 	if (kvmd_init() < 0)
 		return (-1);
 
-	for (u_int i = 0; i < count; i++, addr++, rval++)
-		*rval = kvm_counter_u64_fetch(kvmd, *addr);
+	if (kread(addr, buf, size) < 0)
+		return (-1);
 
+	while (size != 0) {
+		*c = kvm_counter_u64_fetch(kvmd, *c);
+		size -= sizeof(*c);
+		c++;
+	}
 	return (0);
 }
 

Modified: head/usr.bin/netstat/netstat.h
==============================================================================
--- head/usr.bin/netstat/netstat.h	Tue Jul  9 09:37:21 2013	(r253082)
+++ head/usr.bin/netstat/netstat.h	Tue Jul  9 09:43:03 2013	(r253083)
@@ -60,7 +60,7 @@ extern int	af;	/* address family */
 extern int	live;	/* true if we are examining a live system */
 
 int	kread(u_long addr, void *buf, size_t size);
-int	kread_counters(u_long *addr, uint64_t *rval, size_t count);
+int	kread_counters(u_long addr, void *buf, size_t size);
 const char *plural(uintmax_t);
 const char *plurales(uintmax_t);
 const char *pluralies(uintmax_t);

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 09:50:18 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 7116D75E;
 Tue,  9 Jul 2013 09:50:18 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 62A6815FB;
 Tue,  9 Jul 2013 09:50:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r699oIMW038273;
 Tue, 9 Jul 2013 09:50:18 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r699oFEi038257;
 Tue, 9 Jul 2013 09:50:15 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201307090950.r699oFEi038257@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 9 Jul 2013 09:50:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253084 - in head: sys/net sys/netinet usr.bin/netstat
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 09:50:18 -0000

Author: ae
Date: Tue Jul  9 09:50:15 2013
New Revision: 253084
URL: http://svnweb.freebsd.org/changeset/base/253084

Log:
  Migrate structs arpstat, icmpstat, mrtstat, pimstat and udpstat to PCPU
  counters.

Modified:
  head/sys/net/if_arp.h
  head/sys/netinet/icmp_var.h
  head/sys/netinet/if_ether.c
  head/sys/netinet/in.c
  head/sys/netinet/ip_icmp.c
  head/sys/netinet/ip_mroute.c
  head/sys/netinet/ip_mroute.h
  head/sys/netinet/pim_var.h
  head/sys/netinet/udp_usrreq.c
  head/sys/netinet/udp_var.h
  head/usr.bin/netstat/inet.c
  head/usr.bin/netstat/mroute.c

Modified: head/sys/net/if_arp.h
==============================================================================
--- head/sys/net/if_arp.h	Tue Jul  9 09:43:03 2013	(r253083)
+++ head/sys/net/if_arp.h	Tue Jul  9 09:50:15 2013	(r253084)
@@ -127,13 +127,21 @@ struct arpstat {
 	uint64_t dupips;	/* # of duplicate IPs detected. */
 };
 
+#ifdef _KERNEL
+#include 
+#include 
+
+VNET_PCPUSTAT_DECLARE(struct arpstat, arpstat);
 /*
  * In-kernel consumers can use these accessor macros directly to update
  * stats.
  */
-#define	ARPSTAT_ADD(name, val)	V_arpstat.name += (val)
-#define	ARPSTAT_SUB(name, val)	V_arpstat.name -= (val)
+#define	ARPSTAT_ADD(name, val)	\
+    VNET_PCPUSTAT_ADD(struct arpstat, arpstat, name, (val))
+#define	ARPSTAT_SUB(name, val)	ARPSTAT_ADD(name, -(val))
 #define	ARPSTAT_INC(name)	ARPSTAT_ADD(name, 1)
 #define	ARPSTAT_DEC(name)	ARPSTAT_SUB(name, 1)
 
+#endif /* _KERNEL */
+
 #endif /* !_NET_IF_ARP_H_ */

Modified: head/sys/netinet/icmp_var.h
==============================================================================
--- head/sys/netinet/icmp_var.h	Tue Jul  9 09:43:03 2013	(r253083)
+++ head/sys/netinet/icmp_var.h	Tue Jul  9 09:50:15 2013	(r253084)
@@ -58,11 +58,15 @@ struct	icmpstat {
 };
 
 #ifdef _KERNEL
+#include 
+
+VNET_PCPUSTAT_DECLARE(struct icmpstat, icmpstat);
 /*
  * In-kernel consumers can use these accessor macros directly to update
  * stats.
  */
-#define	ICMPSTAT_ADD(name, val)	V_icmpstat.name += (val)
+#define	ICMPSTAT_ADD(name, val)	\
+    VNET_PCPUSTAT_ADD(struct icmpstat, icmpstat, name, (val))
 #define	ICMPSTAT_INC(name)	ICMPSTAT_ADD(name, 1)
 
 /*
@@ -70,7 +74,7 @@ struct	icmpstat {
  */
 void	kmod_icmpstat_inc(int statnum);
 #define	KMOD_ICMPSTAT_INC(name)						\
-	kmod_icmpstat_inc(offsetof(struct icmpstat, name) / sizeof(u_long))
+    kmod_icmpstat_inc(offsetof(struct icmpstat, name) / sizeof(uint64_t))
 #endif
 
 /*
@@ -91,9 +95,6 @@ void	kmod_icmpstat_inc(int statnum);
 #ifdef _KERNEL
 SYSCTL_DECL(_net_inet_icmp);
 
-VNET_DECLARE(struct icmpstat, icmpstat);	/* icmp statistics. */
-#define	V_icmpstat	VNET(icmpstat)
-
 extern int badport_bandlim(int);
 #define BANDLIM_UNLIMITED -1
 #define BANDLIM_ICMP_UNREACH 0

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c	Tue Jul  9 09:43:03 2013	(r253083)
+++ head/sys/netinet/if_ether.c	Tue Jul  9 09:50:15 2013	(r253084)
@@ -89,7 +89,12 @@ VNET_DEFINE(int, useloopback) = 1;	/* us
 static VNET_DEFINE(int, arp_proxyall) = 0;
 static VNET_DEFINE(int, arpt_down) = 20;	/* keep incomplete entries for
 						 * 20 seconds */
-VNET_DEFINE(struct arpstat, arpstat);  /* ARP statistics, see if_arp.h */
+VNET_PCPUSTAT_DEFINE(struct arpstat, arpstat);  /* ARP statistics, see if_arp.h */
+VNET_PCPUSTAT_SYSINIT(arpstat);
+
+#ifdef VIMAGE
+VNET_PCPUSTAT_SYSUNINIT(arpstat);
+#endif /* VIMAGE */
 
 static VNET_DEFINE(int, arp_maxhold) = 1;
 
@@ -97,7 +102,6 @@ static VNET_DEFINE(int, arp_maxhold) = 1
 #define	V_arpt_down		VNET(arpt_down)
 #define	V_arp_maxtries		VNET(arp_maxtries)
 #define	V_arp_proxyall		VNET(arp_proxyall)
-#define	V_arpstat		VNET(arpstat)
 #define	V_arp_maxhold		VNET(arp_maxhold)
 
 SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_RW,
@@ -115,9 +119,8 @@ SYSCTL_VNET_INT(_net_link_ether_inet, OI
 SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, wait, CTLFLAG_RW,
 	&VNET_NAME(arpt_down), 0,
 	"Incomplete ARP entry lifetime in seconds");
-SYSCTL_VNET_STRUCT(_net_link_ether_arp, OID_AUTO, stats, CTLFLAG_RW,
-	&VNET_NAME(arpstat), arpstat,
-	"ARP statistics (struct arpstat, net/if_arp.h)");
+SYSCTL_VNET_PCPUSTAT(_net_link_ether_arp, OID_AUTO, stats, struct arpstat,
+    arpstat, "ARP statistics (struct arpstat, net/if_arp.h)");
 SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, maxhold, CTLFLAG_RW,
 	&VNET_NAME(arp_maxhold), 0,
 	"Number of packets to hold per ARP entry");

Modified: head/sys/netinet/in.c
==============================================================================
--- head/sys/netinet/in.c	Tue Jul  9 09:43:03 2013	(r253083)
+++ head/sys/netinet/in.c	Tue Jul  9 09:50:15 2013	(r253084)
@@ -85,9 +85,6 @@ SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, 
 VNET_DECLARE(struct inpcbinfo, ripcbinfo);
 #define	V_ripcbinfo			VNET(ripcbinfo)
 
-VNET_DECLARE(struct arpstat, arpstat);  /* ARP statistics, see if_arp.h */
-#define	V_arpstat		VNET(arpstat)
-
 /*
  * Return 1 if an internet address is for a ``local'' host
  * (one to which we have a connection).

Modified: head/sys/netinet/ip_icmp.c
==============================================================================
--- head/sys/netinet/ip_icmp.c	Tue Jul  9 09:43:03 2013	(r253083)
+++ head/sys/netinet/ip_icmp.c	Tue Jul  9 09:50:15 2013	(r253084)
@@ -92,9 +92,14 @@ SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO
 	"Enable logging of ICMP response rate limiting");
 
 #ifdef INET
-VNET_DEFINE(struct icmpstat, icmpstat);
-SYSCTL_VNET_STRUCT(_net_inet_icmp, ICMPCTL_STATS, stats, CTLFLAG_RW,
-	&VNET_NAME(icmpstat), icmpstat, "");
+VNET_PCPUSTAT_DEFINE(struct icmpstat, icmpstat);
+VNET_PCPUSTAT_SYSINIT(icmpstat);
+SYSCTL_VNET_PCPUSTAT(_net_inet_icmp, ICMPCTL_STATS, stats, struct icmpstat,
+    icmpstat, "ICMP statistics (struct icmpstat, netinet/icmp_var.h)");
+
+#ifdef VIMAGE
+VNET_PCPUSTAT_SYSUNINIT(icmpstat);
+#endif /* VIMAGE */
 
 static VNET_DEFINE(int, icmpmaskrepl) = 0;
 #define	V_icmpmaskrepl			VNET(icmpmaskrepl)
@@ -197,7 +202,7 @@ void
 kmod_icmpstat_inc(int statnum)
 {
 
-	(*((u_long *)&V_icmpstat + statnum))++;
+	counter_u64_add(VNET(icmpstat)[statnum], 1);
 }
 
 /*

Modified: head/sys/netinet/ip_mroute.c
==============================================================================
--- head/sys/netinet/ip_mroute.c	Tue Jul  9 09:43:03 2013	(r253083)
+++ head/sys/netinet/ip_mroute.c	Tue Jul  9 09:50:15 2013	(r253084)
@@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -145,11 +146,11 @@ static struct mtx mrouter_mtx;
 static int ip_mrouter_cnt;	/* # of vnets with active mrouters */
 static int ip_mrouter_unloading; /* Allow no more V_ip_mrouter sockets */
 
-static VNET_DEFINE(struct mrtstat, mrtstat);
-#define	V_mrtstat		VNET(mrtstat)
-SYSCTL_VNET_STRUCT(_net_inet_ip, OID_AUTO, mrtstat, CTLFLAG_RW,
-    &VNET_NAME(mrtstat), mrtstat,
-    "IPv4 Multicast Forwarding Statistics (struct mrtstat, "
+static VNET_PCPUSTAT_DEFINE(struct mrtstat, mrtstat);
+VNET_PCPUSTAT_SYSINIT(mrtstat);
+VNET_PCPUSTAT_SYSUNINIT(mrtstat);
+SYSCTL_VNET_PCPUSTAT(_net_inet_ip, OID_AUTO, mrtstat, struct mrtstat,
+    mrtstat, "IPv4 Multicast Forwarding Statistics (struct mrtstat, "
     "netinet/ip_mroute.h)");
 
 static VNET_DEFINE(u_long, mfchash);
@@ -225,13 +226,13 @@ static VNET_DEFINE(struct callout, bw_up
 
 #define BW_UPCALLS_PERIOD (hz)		/* periodical flush of bw upcalls */
 
-static VNET_DEFINE(struct pimstat, pimstat);
-#define	V_pimstat		VNET(pimstat)
+static VNET_PCPUSTAT_DEFINE(struct pimstat, pimstat);
+VNET_PCPUSTAT_SYSINIT(pimstat);
+VNET_PCPUSTAT_SYSUNINIT(pimstat);
 
 SYSCTL_NODE(_net_inet, IPPROTO_PIM, pim, CTLFLAG_RW, 0, "PIM");
-SYSCTL_VNET_STRUCT(_net_inet_pim, PIMCTL_STATS, stats, CTLFLAG_RD,
-    &VNET_NAME(pimstat), pimstat,
-    "PIM Statistics (struct pimstat, netinet/pim_var.h)");
+SYSCTL_VNET_PCPUSTAT(_net_inet_pim, PIMCTL_STATS, stats, struct pimstat,
+    pimstat, "PIM Statistics (struct pimstat, netinet/pim_var.h)");
 
 static u_long	pim_squelch_wholepkt = 0;
 SYSCTL_ULONG(_net_inet_pim, OID_AUTO, squelch_wholepkt, CTLFLAG_RW,

Modified: head/sys/netinet/ip_mroute.h
==============================================================================
--- head/sys/netinet/ip_mroute.h	Tue Jul  9 09:43:03 2013	(r253083)
+++ head/sys/netinet/ip_mroute.h	Tue Jul  9 09:50:15 2013	(r253084)
@@ -222,7 +222,8 @@ struct mrtstat {
 };
 
 #ifdef _KERNEL
-#define	MRTSTAT_ADD(name, val)	V_mrtstat.name += (val)
+#define	MRTSTAT_ADD(name, val)	\
+    VNET_PCPUSTAT_ADD(struct mrtstat, mrtstat, name, (val))
 #define	MRTSTAT_INC(name)	MRTSTAT_ADD(name, 1)
 #endif
 

Modified: head/sys/netinet/pim_var.h
==============================================================================
--- head/sys/netinet/pim_var.h	Tue Jul  9 09:43:03 2013	(r253083)
+++ head/sys/netinet/pim_var.h	Tue Jul  9 09:50:15 2013	(r253084)
@@ -60,7 +60,8 @@ struct pimstat {
 };
 
 #ifdef _KERNEL
-#define	PIMSTAT_ADD(name, val)	V_pimstat.name += (val)
+#define	PIMSTAT_ADD(name, val)	\
+    VNET_PCPUSTAT_ADD(struct pimstat, pimstat, name, (val))
 #define	PIMSTAT_INC(name)	PIMSTAT_ADD(name, 1)
 #endif
 

Modified: head/sys/netinet/udp_usrreq.c
==============================================================================
--- head/sys/netinet/udp_usrreq.c	Tue Jul  9 09:43:03 2013	(r253083)
+++ head/sys/netinet/udp_usrreq.c	Tue Jul  9 09:50:15 2013	(r253084)
@@ -143,11 +143,14 @@ static VNET_DEFINE(uma_zone_t, udpcb_zon
 #define	UDBHASHSIZE	128
 #endif
 
-VNET_DEFINE(struct udpstat, udpstat);		/* from udp_var.h */
-SYSCTL_VNET_STRUCT(_net_inet_udp, UDPCTL_STATS, stats, CTLFLAG_RW,
-    &VNET_NAME(udpstat), udpstat,
-    "UDP statistics (struct udpstat, netinet/udp_var.h)");
+VNET_PCPUSTAT_DEFINE(struct udpstat, udpstat);		/* from udp_var.h */
+VNET_PCPUSTAT_SYSINIT(udpstat);
+SYSCTL_VNET_PCPUSTAT(_net_inet_udp, UDPCTL_STATS, stats, struct udpstat,
+    udpstat, "UDP statistics (struct udpstat, netinet/udp_var.h)");
 
+#ifdef VIMAGE
+VNET_PCPUSTAT_SYSUNINIT(udpstat);
+#endif /* VIMAGE */
 #ifdef INET
 static void	udp_detach(struct socket *so);
 static int	udp_output(struct inpcb *, struct mbuf *, struct sockaddr *,
@@ -207,7 +210,7 @@ void
 kmod_udpstat_inc(int statnum)
 {
 
-	(*((u_long *)&V_udpstat + statnum))++;
+	counter_u64_add(VNET(udpstat)[statnum], 1);
 }
 
 int

Modified: head/sys/netinet/udp_var.h
==============================================================================
--- head/sys/netinet/udp_var.h	Tue Jul  9 09:43:03 2013	(r253083)
+++ head/sys/netinet/udp_var.h	Tue Jul  9 09:50:15 2013	(r253084)
@@ -94,19 +94,23 @@ struct udpstat {
 };
 
 #ifdef _KERNEL
+#include 
+
+VNET_PCPUSTAT_DECLARE(struct udpstat, udpstat);
 /*
  * In-kernel consumers can use these accessor macros directly to update
  * stats.
  */
-#define	UDPSTAT_ADD(name, val)	V_udpstat.name += (val)
+#define	UDPSTAT_ADD(name, val)  \
+    VNET_PCPUSTAT_ADD(struct udpstat, udpstat, name, (val))
 #define	UDPSTAT_INC(name)	UDPSTAT_ADD(name, 1)
 
 /*
  * Kernel module consumers must use this accessor macro.
  */
 void	kmod_udpstat_inc(int statnum);
-#define	KMOD_UDPSTAT_INC(name)						\
-	kmod_udpstat_inc(offsetof(struct udpstat, name) / sizeof(u_long))
+#define	KMOD_UDPSTAT_INC(name)	\
+    kmod_udpstat_inc(offsetof(struct udpstat, name) / sizeof(uint64_t))
 #endif
 
 /*
@@ -140,10 +144,8 @@ VNET_DECLARE(struct inpcbinfo, udbinfo);
 extern u_long			udp_sendspace;
 extern u_long			udp_recvspace;
 VNET_DECLARE(int, udp_cksum);
-VNET_DECLARE(struct udpstat, udpstat);
 VNET_DECLARE(int, udp_blackhole);
 #define	V_udp_cksum		VNET(udp_cksum)
-#define	V_udpstat		VNET(udpstat)
 #define	V_udp_blackhole		VNET(udp_blackhole)
 extern int			udp_log_in_vain;
 

Modified: head/usr.bin/netstat/inet.c
==============================================================================
--- head/usr.bin/netstat/inet.c	Tue Jul  9 09:43:03 2013	(r253083)
+++ head/usr.bin/netstat/inet.c	Tue Jul  9 09:50:15 2013	(r253084)
@@ -756,7 +756,7 @@ udp_stats(u_long off, const char *name, 
 			return;
 		}
 	} else
-		kread(off, &udpstat, len);
+		kread_counters(off, &udpstat, len);
 
 	printf("%s:\n", name);
 #define	p(f, m) if (udpstat.f || sflag <= 1) \
@@ -923,7 +923,7 @@ arp_stats(u_long off, const char *name, 
 			return;
 		}
 	} else
-		kread(off, &arpstat, len);
+		kread_counters(off, &arpstat, len);
 
 	printf("%s:\n", name);
 
@@ -1010,7 +1010,7 @@ icmp_stats(u_long off, const char *name,
 			return;
 		}
 	} else
-		kread(off, &icmpstat, len);
+		kread_counters(off, &icmpstat, len);
 
 	printf("%s:\n", name);
 
@@ -1217,7 +1217,7 @@ pim_stats(u_long off __unused, const cha
 	} else {
 		if (off == 0)
 			return;
-		kread(off, &pimstat, len);
+		kread_counters(off, &pimstat, len);
 	}
 
 	printf("%s:\n", name);

Modified: head/usr.bin/netstat/mroute.c
==============================================================================
--- head/usr.bin/netstat/mroute.c	Tue Jul  9 09:43:03 2013	(r253083)
+++ head/usr.bin/netstat/mroute.c	Tue Jul  9 09:50:15 2013	(r253084)
@@ -350,7 +350,7 @@ mrt_stats(u_long mstaddr)
 			return;
 		}
 	} else
-		kread(mstaddr, (char *)&mrtstat, sizeof(mrtstat));
+		kread_counters(mstaddr, &mrtstat, len);
 
 	printf("IPv4 multicast forwarding:\n");
 

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 09:54:56 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 6585F8EA;
 Tue,  9 Jul 2013 09:54:56 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 570FB1630;
 Tue,  9 Jul 2013 09:54:56 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r699sueC040393;
 Tue, 9 Jul 2013 09:54:56 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r699ssGO040380;
 Tue, 9 Jul 2013 09:54:54 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201307090954.r699ssGO040380@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 9 Jul 2013 09:54:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253085 - in head: sys/netinet sys/netinet6
 usr.bin/netstat
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 09:54:56 -0000

Author: ae
Date: Tue Jul  9 09:54:54 2013
New Revision: 253085
URL: http://svnweb.freebsd.org/changeset/base/253085

Log:
  Migrate structs ip6stat, icmp6stat and rip6stat to PCPU counters.

Modified:
  head/sys/netinet/icmp6.h
  head/sys/netinet6/icmp6.c
  head/sys/netinet6/in6_proto.c
  head/sys/netinet6/in6_var.h
  head/sys/netinet6/ip6_input.c
  head/sys/netinet6/ip6_var.h
  head/sys/netinet6/raw_ip6.c
  head/sys/netinet6/raw_ip6.h
  head/usr.bin/netstat/inet6.c

Modified: head/sys/netinet/icmp6.h
==============================================================================
--- head/sys/netinet/icmp6.h	Tue Jul  9 09:50:15 2013	(r253084)
+++ head/sys/netinet/icmp6.h	Tue Jul  9 09:54:54 2013	(r253085)
@@ -617,19 +617,23 @@ struct icmp6stat {
 };
 
 #ifdef _KERNEL
+#include 
+
+VNET_PCPUSTAT_DECLARE(struct icmp6stat, icmp6stat);
 /*
  * In-kernel consumers can use these accessor macros directly to update
  * stats.
  */
-#define	ICMP6STAT_ADD(name, val)	V_icmp6stat.name += (val)
+#define	ICMP6STAT_ADD(name, val)	\
+    VNET_PCPUSTAT_ADD(struct icmp6stat, icmp6stat, name, (val))
 #define	ICMP6STAT_INC(name)		ICMP6STAT_ADD(name, 1)
 
 /*
  * Kernel module consumers must use this accessor macro.
  */
 void	kmod_icmp6stat_inc(int statnum);
-#define	KMOD_ICMP6STAT_INC(name)					\
-	kmod_icmp6stat_inc(offsetof(struct icmp6stat, name) / sizeof(u_quad_t))
+#define	KMOD_ICMP6STAT_INC(name)	\
+    kmod_icmp6stat_inc(offsetof(struct icmp6stat, name) / sizeof(uint64_t))
 #endif
 
 /*

Modified: head/sys/netinet6/icmp6.c
==============================================================================
--- head/sys/netinet6/icmp6.c	Tue Jul  9 09:50:15 2013	(r253084)
+++ head/sys/netinet6/icmp6.c	Tue Jul  9 09:54:54 2013	(r253085)
@@ -114,7 +114,12 @@ __FBSDID("$FreeBSD$");
 
 extern struct domain inet6domain;
 
-VNET_DEFINE(struct icmp6stat, icmp6stat);
+VNET_PCPUSTAT_DEFINE(struct icmp6stat, icmp6stat);
+VNET_PCPUSTAT_SYSINIT(icmp6stat);
+
+#ifdef VIMAGE
+VNET_PCPUSTAT_SYSUNINIT(icmp6stat);
+#endif /* VIMAGE */
 
 VNET_DECLARE(struct inpcbinfo, ripcbinfo);
 VNET_DECLARE(struct inpcbhead, ripcb);
@@ -155,7 +160,7 @@ void
 kmod_icmp6stat_inc(int statnum)
 {
 
-	(*((u_quad_t *)&V_icmp6stat + statnum))++;
+	counter_u64_add(VNET(icmp6stat)[statnum], 1);
 }
 
 static void

Modified: head/sys/netinet6/in6_proto.c
==============================================================================
--- head/sys/netinet6/in6_proto.c	Tue Jul  9 09:50:15 2013	(r253084)
+++ head/sys/netinet6/in6_proto.c	Tue Jul  9 09:54:54 2013	(r253085)
@@ -506,8 +506,8 @@ SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_
 	&VNET_NAME(ip6_sendredirects), 0, "");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM, hlim, CTLFLAG_RW,
 	&VNET_NAME(ip6_defhlim), 0, "");
-SYSCTL_VNET_STRUCT(_net_inet6_ip6, IPV6CTL_STATS, stats, CTLFLAG_RW,
-	&VNET_NAME(ip6stat), ip6stat, "");
+SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_STATS, stats, struct ip6stat,
+    ip6stat, "IP6 statistics (struct ip6stat, netinet6/ip6_var.h)");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS, maxfragpackets,
 	CTLFLAG_RW, &VNET_NAME(ip6_maxfragpackets), 0, "");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV, accept_rtadv,
@@ -559,8 +559,9 @@ SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_
 	CTLFLAG_RW, &VNET_NAME(ip6_auto_linklocal), 0,
 	"Default value of per-interface flag for automatically adding an IPv6"
 	" link-local address to interfaces when attached");
-SYSCTL_VNET_STRUCT(_net_inet6_ip6, IPV6CTL_RIP6STATS, rip6stats, CTLFLAG_RW,
-	&VNET_NAME(rip6stat), rip6stat, "");
+SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_RIP6STATS, rip6stats,
+    struct rip6stat, rip6stat,
+    "Raw IP6 statistics (struct rip6stat, netinet6/raw_ip6.h)");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_PREFER_TEMPADDR, prefer_tempaddr,
 	CTLFLAG_RW, &VNET_NAME(ip6_prefer_tempaddr), 0, "");
 SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_USE_DEFAULTZONE, use_defaultzone,
@@ -589,8 +590,9 @@ SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6
 	CTLFLAG_RW, &VNET_NAME(icmp6_rediraccept), 0, "");
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRTIMEOUT, redirtimeout,
 	CTLFLAG_RW, &VNET_NAME(icmp6_redirtimeout), 0, "");
-SYSCTL_VNET_STRUCT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats, CTLFLAG_RW,
-	&VNET_NAME(icmp6stat), icmp6stat, "");
+SYSCTL_VNET_PCPUSTAT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats,
+    struct icmp6stat, icmp6stat,
+    "ICMPv6 statistics (struct icmp6stat, netinet/icmp6.h)");
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PRUNE, nd6_prune, CTLFLAG_RW,
 	&VNET_NAME(nd6_prune), 0, "");
 SYSCTL_VNET_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DELAY, nd6_delay, CTLFLAG_RW,

Modified: head/sys/netinet6/in6_var.h
==============================================================================
--- head/sys/netinet6/in6_var.h	Tue Jul  9 09:50:15 2013	(r253084)
+++ head/sys/netinet6/in6_var.h	Tue Jul  9 09:54:54 2013	(r253085)
@@ -534,8 +534,6 @@ extern struct rwlock in6_ifaddr_lock;
 #define	IN6_IFADDR_WLOCK_ASSERT()	rw_assert(&in6_ifaddr_lock, RA_WLOCKED)
 #define	IN6_IFADDR_WUNLOCK()		rw_wunlock(&in6_ifaddr_lock)
 
-VNET_DECLARE(struct icmp6stat, icmp6stat);
-#define	V_icmp6stat			VNET(icmp6stat)
 #define in6_ifstat_inc(ifp, tag) \
 do {								\
 	if (ifp)						\

Modified: head/sys/netinet6/ip6_input.c
==============================================================================
--- head/sys/netinet6/ip6_input.c	Tue Jul  9 09:50:15 2013	(r253084)
+++ head/sys/netinet6/ip6_input.c	Tue Jul  9 09:54:54 2013	(r253085)
@@ -141,7 +141,11 @@ VNET_DECLARE(struct callout, in6_tmpaddr
 
 VNET_DEFINE(struct pfil_head, inet6_pfil_hook);
 
-VNET_DEFINE(struct ip6stat, ip6stat);
+VNET_PCPUSTAT_DEFINE(struct ip6stat, ip6stat);
+VNET_PCPUSTAT_SYSINIT(ip6stat);
+#ifdef VIMAGE
+VNET_PCPUSTAT_SYSUNINIT(ip6stat);
+#endif /* VIMAGE */
 
 struct rwlock in6_ifaddr_lock;
 RW_SYSINIT(in6_ifaddr_lock, &in6_ifaddr_lock, "in6_ifaddr_lock");

Modified: head/sys/netinet6/ip6_var.h
==============================================================================
--- head/sys/netinet6/ip6_var.h	Tue Jul  9 09:50:15 2013	(r253084)
+++ head/sys/netinet6/ip6_var.h	Tue Jul  9 09:54:54 2013	(r253085)
@@ -246,8 +246,12 @@ struct	ip6stat {
 };
 
 #ifdef _KERNEL
-#define	IP6STAT_ADD(name, val)	V_ip6stat.name += (val)
-#define	IP6STAT_SUB(name, val)	V_ip6stat.name -= (val)
+#include 
+
+VNET_PCPUSTAT_DECLARE(struct ip6stat, ip6stat);
+#define	IP6STAT_ADD(name, val)	\
+    VNET_PCPUSTAT_ADD(struct ip6stat, ip6stat, name, (val))
+#define	IP6STAT_SUB(name, val)	IP6STAT_ADD(name, -(val))
 #define	IP6STAT_INC(name)	IP6STAT_ADD(name, 1)
 #define	IP6STAT_DEC(name)	IP6STAT_SUB(name, 1)
 #endif
@@ -297,7 +301,6 @@ struct ip6aux {
 #define IP6_HDR_ALIGNED_P(ip)	((((intptr_t) (ip)) & 3) == 0)
 #endif
 
-VNET_DECLARE(struct ip6stat, ip6stat);	/* statistics */
 VNET_DECLARE(int, ip6_defhlim);		/* default hop limit */
 VNET_DECLARE(int, ip6_defmcasthlim);	/* default multicast hop limit */
 VNET_DECLARE(int, ip6_forwarding);	/* act as router? */
@@ -306,7 +309,6 @@ VNET_DECLARE(int, ip6_rr_prune);	/* rout
 					 * walk list every 5 sec.    */
 VNET_DECLARE(int, ip6_mcast_pmtu);	/* enable pMTU discovery for multicast? */
 VNET_DECLARE(int, ip6_v6only);
-#define	V_ip6stat			VNET(ip6stat)
 #define	V_ip6_defhlim			VNET(ip6_defhlim)
 #define	V_ip6_defmcasthlim		VNET(ip6_defmcasthlim)
 #define	V_ip6_forwarding		VNET(ip6_forwarding)

Modified: head/sys/netinet6/raw_ip6.c
==============================================================================
--- head/sys/netinet6/raw_ip6.c	Tue Jul  9 09:50:15 2013	(r253084)
+++ head/sys/netinet6/raw_ip6.c	Tue Jul  9 09:54:54 2013	(r253085)
@@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -124,7 +125,12 @@ VNET_DECLARE(struct inpcbinfo, ripcbinfo
 extern u_long	rip_sendspace;
 extern u_long	rip_recvspace;
 
-VNET_DEFINE(struct rip6stat, rip6stat);
+VNET_PCPUSTAT_DEFINE(struct rip6stat, rip6stat);
+VNET_PCPUSTAT_SYSINIT(rip6stat);
+
+#ifdef VIMAGE
+VNET_PCPUSTAT_SYSUNINIT(rip6stat);
+#endif /* VIMAGE */
 
 /*
  * Hooks for multicast routing. They all default to NULL, so leave them not

Modified: head/sys/netinet6/raw_ip6.h
==============================================================================
--- head/sys/netinet6/raw_ip6.h	Tue Jul  9 09:50:15 2013	(r253084)
+++ head/sys/netinet6/raw_ip6.h	Tue Jul  9 09:54:54 2013	(r253085)
@@ -48,10 +48,12 @@ struct rip6stat {
 };
 
 #ifdef _KERNEL
-#define	RIP6STAT_ADD(name, val)	V_rip6stat.name += (val)
+#include 
+
+VNET_PCPUSTAT_DECLARE(struct rip6stat, rip6stat);
+#define	RIP6STAT_ADD(name, val)	\
+    VNET_PCPUSTAT_ADD(struct rip6stat, rip6stat, name, (val))
 #define	RIP6STAT_INC(name)	RIP6STAT_ADD(name, 1)
-VNET_DECLARE(struct rip6stat, rip6stat);
-#define	V_rip6stat			VNET(rip6stat)
-#endif
+#endif /* _KERNEL */
 
 #endif

Modified: head/usr.bin/netstat/inet6.c
==============================================================================
--- head/usr.bin/netstat/inet6.c	Tue Jul  9 09:50:15 2013	(r253084)
+++ head/usr.bin/netstat/inet6.c	Tue Jul  9 09:54:54 2013	(r253085)
@@ -376,7 +376,7 @@ ip6_stats(u_long off, const char *name, 
 			return;
 		}
 	} else
-		kread(off, &ip6stat, len);
+		kread_counters(off, &ip6stat, len);
 
 	printf("%s:\n", name);
 
@@ -858,7 +858,7 @@ icmp6_stats(u_long off, const char *name
 			return;
 		}
 	} else
-		kread(off, &icmp6stat, len);
+		kread_counters(off, &icmp6stat, len);
 
 	printf("%s:\n", name);
 
@@ -1052,7 +1052,7 @@ rip6_stats(u_long off, const char *name,
 			return;
 		}
 	} else
-		kread(off, &rip6stat, len);
+		kread_counters(off, &rip6stat, len);
 
 	printf("%s:\n", name);
 

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 09:56:56 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 9F075A5F
 for ; Tue,  9 Jul 2013 09:56:56 +0000 (UTC)
 (envelope-from andre@freebsd.org)
Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2])
 by mx1.freebsd.org (Postfix) with ESMTP id 3EFF61651
 for ; Tue,  9 Jul 2013 09:56:55 +0000 (UTC)
Received: (qmail 71488 invoked from network); 9 Jul 2013 10:47:52 -0000
Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2])
 (envelope-sender )
 by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP
 for ; 9 Jul 2013 10:47:52 -0000
Message-ID: <51DBDE64.2060909@freebsd.org>
Date: Tue, 09 Jul 2013 11:56:52 +0200
From: Andre Oppermann 
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
 rv:17.0) Gecko/20130509 Thunderbird/17.0.6
MIME-Version: 1.0
To: "Andrey V. Elsukov" 
Subject: Re: svn commit: r253081 - in head: sys/net sys/netinet sys/netinet6
 sys/netipsec tools/tools/crypto usr.bin/netstat
References: <201307090932.r699W6Ks034249@svn.freebsd.org>
In-Reply-To: <201307090932.r699W6Ks034249@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
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 09:56:56 -0000

On 09.07.2013 11:32, Andrey V. Elsukov wrote:
> Author: ae
> Date: Tue Jul  9 09:32:06 2013
> New Revision: 253081
> URL: http://svnweb.freebsd.org/changeset/base/253081
>
> Log:
>    Prepare network statistics structures for migration to PCPU counters.
>    Use uint64_t as type for all fields of structures.

Yes!  Finally 64 bit counters! :)

-- 
Andre


From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 09:59:47 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 725A2BF6;
 Tue,  9 Jul 2013 09:59:47 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 552DF1675;
 Tue,  9 Jul 2013 09:59:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r699xlc1041020;
 Tue, 9 Jul 2013 09:59:47 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r699xkYb041017;
 Tue, 9 Jul 2013 09:59:46 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201307090959.r699xkYb041017@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 9 Jul 2013 09:59:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253086 - in head/sys: netinet netinet6
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 09:59:47 -0000

Author: ae
Date: Tue Jul  9 09:59:46 2013
New Revision: 253086
URL: http://svnweb.freebsd.org/changeset/base/253086

Log:
  Migrate structs in6_ifstat and icmp6_ifstat to PCPU counters.

Modified:
  head/sys/netinet/icmp6.h
  head/sys/netinet6/in6.c
  head/sys/netinet6/in6_var.h

Modified: head/sys/netinet/icmp6.h
==============================================================================
--- head/sys/netinet/icmp6.h	Tue Jul  9 09:54:54 2013	(r253085)
+++ head/sys/netinet/icmp6.h	Tue Jul  9 09:59:46 2013	(r253086)
@@ -692,7 +692,9 @@ void	icmp6_mtudisc_update(struct ip6ctlp
 #define icmp6_ifstat_inc(ifp, tag) \
 do {								\
 	if (ifp)						\
-		((struct in6_ifextra *)((ifp)->if_afdata[AF_INET6]))->icmp6_ifstat->tag++; \
+		counter_u64_add(((struct in6_ifextra *)		\
+		    ((ifp)->if_afdata[AF_INET6]))->icmp6_ifstat[\
+		    offsetof(struct icmp6_ifstat, tag) / sizeof(uint64_t)], 1);\
 } while (/*CONSTCOND*/ 0)
 
 #define icmp6_ifoutstat_inc(ifp, type, code) \

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c	Tue Jul  9 09:54:54 2013	(r253085)
+++ head/sys/netinet6/in6.c	Tue Jul  9 09:59:46 2013	(r253086)
@@ -570,10 +570,10 @@ in6_control(struct socket *so, u_long cm
 			error = EINVAL;
 			goto out;
 		}
-		bzero(&ifr->ifr_ifru.ifru_stat,
-		    sizeof(ifr->ifr_ifru.ifru_stat));
-		ifr->ifr_ifru.ifru_stat =
-		    *((struct in6_ifextra *)ifp->if_afdata[AF_INET6])->in6_ifstat;
+		COUNTER_ARRAY_COPY(((struct in6_ifextra *)
+		    ifp->if_afdata[AF_INET6])->in6_ifstat,
+		    &ifr->ifr_ifru.ifru_stat,
+		    sizeof(struct in6_ifstat) / sizeof(uint64_t));
 		break;
 
 	case SIOCGIFSTAT_ICMP6:
@@ -581,10 +581,10 @@ in6_control(struct socket *so, u_long cm
 			error = EINVAL;
 			goto out;
 		}
-		bzero(&ifr->ifr_ifru.ifru_icmp6stat,
-		    sizeof(ifr->ifr_ifru.ifru_icmp6stat));
-		ifr->ifr_ifru.ifru_icmp6stat =
-		    *((struct in6_ifextra *)ifp->if_afdata[AF_INET6])->icmp6_ifstat;
+		COUNTER_ARRAY_COPY(((struct in6_ifextra *)
+		    ifp->if_afdata[AF_INET6])->icmp6_ifstat,
+		    &ifr->ifr_ifru.ifru_icmp6stat,
+		    sizeof(struct icmp6_ifstat) / sizeof(uint64_t));
 		break;
 
 	case SIOCGIFALIFETIME_IN6:
@@ -2749,14 +2749,15 @@ in6_domifattach(struct ifnet *ifp)
 	ext = (struct in6_ifextra *)malloc(sizeof(*ext), M_IFADDR, M_WAITOK);
 	bzero(ext, sizeof(*ext));
 
-	ext->in6_ifstat = (struct in6_ifstat *)malloc(sizeof(struct in6_ifstat),
-	    M_IFADDR, M_WAITOK);
-	bzero(ext->in6_ifstat, sizeof(*ext->in6_ifstat));
-
-	ext->icmp6_ifstat =
-	    (struct icmp6_ifstat *)malloc(sizeof(struct icmp6_ifstat),
-	    M_IFADDR, M_WAITOK);
-	bzero(ext->icmp6_ifstat, sizeof(*ext->icmp6_ifstat));
+	ext->in6_ifstat = malloc(sizeof(struct in6_ifstat), M_IFADDR,
+	    M_WAITOK);
+	COUNTER_ARRAY_ALLOC(ext->in6_ifstat,
+	    sizeof(struct in6_ifstat) / sizeof(uint64_t), M_WAITOK);
+
+	ext->icmp6_ifstat = malloc(sizeof(struct icmp6_ifstat), M_IFADDR,
+	    M_WAITOK);
+	COUNTER_ARRAY_ALLOC(ext->icmp6_ifstat,
+	    sizeof(struct icmp6_ifstat) / sizeof(uint64_t), M_WAITOK);
 
 	ext->nd_ifinfo = nd6_ifattach(ifp);
 	ext->scope6_id = scope6_ifattach(ifp);
@@ -2781,7 +2782,11 @@ in6_domifdetach(struct ifnet *ifp, void 
 	scope6_ifdetach(ext->scope6_id);
 	nd6_ifdetach(ext->nd_ifinfo);
 	lltable_free(ext->lltable);
+	COUNTER_ARRAY_FREE(ext->in6_ifstat,
+	    sizeof(struct in6_ifstat) / sizeof(uint64_t));
 	free(ext->in6_ifstat, M_IFADDR);
+	COUNTER_ARRAY_FREE(ext->icmp6_ifstat,
+	    sizeof(struct icmp6_ifstat) / sizeof(uint64_t));
 	free(ext->icmp6_ifstat, M_IFADDR);
 	free(ext, M_IFADDR);
 }

Modified: head/sys/netinet6/in6_var.h
==============================================================================
--- head/sys/netinet6/in6_var.h	Tue Jul  9 09:54:54 2013	(r253085)
+++ head/sys/netinet6/in6_var.h	Tue Jul  9 09:59:46 2013	(r253086)
@@ -98,14 +98,28 @@ struct scope6_id;
 struct lltable;
 struct mld_ifinfo;
 
+#ifdef _KERNEL
+#include 
+
+struct in6_ifextra {
+	counter_u64_t *in6_ifstat;
+	counter_u64_t *icmp6_ifstat;
+	struct nd_ifinfo *nd_ifinfo;
+	struct scope6_id *scope6_id;
+	struct lltable *lltable;
+	struct mld_ifinfo *mld_ifinfo;
+};
+#else
+
 struct in6_ifextra {
-	struct in6_ifstat *in6_ifstat;
-	struct icmp6_ifstat *icmp6_ifstat;
+	void *in6_ifstat;
+	void *icmp6_ifstat;
 	struct nd_ifinfo *nd_ifinfo;
 	struct scope6_id *scope6_id;
 	struct lltable *lltable;
 	struct mld_ifinfo *mld_ifinfo;
 };
+#endif /* !_KERNEL */
 
 #define	LLTABLE6(ifp)	(((struct in6_ifextra *)(ifp)->if_afdata[AF_INET6])->lltable)
 
@@ -537,7 +551,9 @@ extern struct rwlock in6_ifaddr_lock;
 #define in6_ifstat_inc(ifp, tag) \
 do {								\
 	if (ifp)						\
-		((struct in6_ifextra *)((ifp)->if_afdata[AF_INET6]))->in6_ifstat->tag++; \
+		counter_u64_add(((struct in6_ifextra *)		\
+		    ((ifp)->if_afdata[AF_INET6]))->in6_ifstat[	\
+		    offsetof(struct in6_ifstat, tag) / sizeof(uint64_t)], 1);\
 } while (/*CONSTCOND*/ 0)
 
 extern u_char inet6ctlerrmap[];

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 10:02:52 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id D42D5DC7;
 Tue,  9 Jul 2013 10:02:52 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id C6D8816B1;
 Tue,  9 Jul 2013 10:02:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69A2qOB043271;
 Tue, 9 Jul 2013 10:02:52 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69A2qsR043268;
 Tue, 9 Jul 2013 10:02:52 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201307091002.r69A2qsR043268@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 9 Jul 2013 10:02:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253087 - in head: sys/netinet usr.bin/netstat
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 10:02:52 -0000

Author: ae
Date: Tue Jul  9 10:02:51 2013
New Revision: 253087
URL: http://svnweb.freebsd.org/changeset/base/253087

Log:
  Migrate struct carpstats to PCPU counters.

Modified:
  head/sys/netinet/ip_carp.c
  head/sys/netinet/ip_carp.h
  head/usr.bin/netstat/inet.c

Modified: head/sys/netinet/ip_carp.c
==============================================================================
--- head/sys/netinet/ip_carp.c	Tue Jul  9 09:59:46 2013	(r253086)
+++ head/sys/netinet/ip_carp.c	Tue Jul  9 10:02:51 2013	(r253087)
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -209,9 +210,25 @@ SYSCTL_INT(_net_inet_carp, OID_AUTO, sen
 SYSCTL_INT(_net_inet_carp, OID_AUTO, ifdown_demotion_factor, CTLFLAG_RW,
     &carp_ifdown_adj, 0, "Interface down demotion factor adjustment");
 
-static struct carpstats carpstats;
-SYSCTL_STRUCT(_net_inet_carp, OID_AUTO, stats, CTLFLAG_RW, &carpstats,
-    carpstats, "CARP statistics (struct carpstats, netinet/ip_carp.h)");
+static counter_u64_t carpstats[sizeof(struct carpstats) / sizeof(uint64_t)];
+#define	CARPSTATS_ADD(name, val)	\
+    counter_u64_add(carpstats[offsetof(struct carpstats, name) / \
+	sizeof(uint64_t)], (val))
+#define	CARPSTATS_INC(name)		CARPSTATS_ADD(name, 1)
+
+static int
+carpstats_sysctl(SYSCTL_HANDLER_ARGS)
+{
+	struct carpstats s;
+
+	COUNTER_ARRAY_COPY(carpstats, &s, sizeof(s) / sizeof(uint64_t));
+	if (req->newptr)
+		COUNTER_ARRAY_ZERO(carpstats, sizeof(s) / sizeof(uint64_t));
+	return (SYSCTL_OUT(req, &s, sizeof(s)));
+}
+SYSCTL_PROC(_net_inet_carp, OID_AUTO, stats, CTLTYPE_OPAQUE | CTLFLAG_RW,
+    NULL, 0, carpstats_sysctl, "I",
+    "CARP statistics (struct carpstats, netinet/ip_carp.h)");
 
 #define	CARP_LOCK_INIT(sc)	mtx_init(&(sc)->sc_mtx, "carp_softc",   \
 	NULL, MTX_DEF)
@@ -2084,6 +2101,8 @@ carp_mod_cleanup(void)
 	mtx_unlock(&carp_mtx);
 	taskqueue_drain(taskqueue_swi, &carp_sendall_task);
 	mtx_destroy(&carp_mtx);
+	COUNTER_ARRAY_FREE(carpstats,
+	    sizeof(struct carpstats) / sizeof(uint64_t));
 }
 
 static int
@@ -2093,6 +2112,8 @@ carp_mod_load(void)
 
 	mtx_init(&carp_mtx, "carp_mtx", NULL, MTX_DEF);
 	LIST_INIT(&carp_list);
+	COUNTER_ARRAY_ALLOC(carpstats,
+	    sizeof(struct carpstats) / sizeof(uint64_t), M_WAITOK);
 	carp_get_vhid_p = carp_get_vhid;
 	carp_forus_p = carp_forus;
 	carp_output_p = carp_output;

Modified: head/sys/netinet/ip_carp.h
==============================================================================
--- head/sys/netinet/ip_carp.h	Tue Jul  9 09:59:46 2013	(r253086)
+++ head/sys/netinet/ip_carp.h	Tue Jul  9 10:02:51 2013	(r253087)
@@ -117,11 +117,6 @@ struct carpstats {
 	uint64_t	carps_preempt;		/* if enabled, preemptions */
 };
 
-#ifdef _KERNEL
-#define	CARPSTATS_ADD(name, val)	carpstats.name += (val)
-#define	CARPSTATS_INC(name)		CARPSTATS_ADD(name, 1)
-#endif
-
 /*
  * Configuration structure for SIOCSVH SIOCGVH
  */

Modified: head/usr.bin/netstat/inet.c
==============================================================================
--- head/usr.bin/netstat/inet.c	Tue Jul  9 09:59:46 2013	(r253086)
+++ head/usr.bin/netstat/inet.c	Tue Jul  9 10:02:51 2013	(r253087)
@@ -811,7 +811,7 @@ carp_stats(u_long off, const char *name,
 	} else {
 		if (off == 0)
 			return;
-		kread(off, &carpstat, len);
+		kread_counters(off, &carpstat, len);
 	}
 
 	printf("%s:\n", name);

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 10:08:16 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id CECB3F60;
 Tue,  9 Jul 2013 10:08:16 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id C052A16E0;
 Tue,  9 Jul 2013 10:08:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69A8GvV044134;
 Tue, 9 Jul 2013 10:08:16 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69A8DcY044114;
 Tue, 9 Jul 2013 10:08:13 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201307091008.r69A8DcY044114@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 9 Jul 2013 10:08:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253088 - in head: sys/netipsec usr.bin/netstat
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 10:08:16 -0000

Author: ae
Date: Tue Jul  9 10:08:13 2013
New Revision: 253088
URL: http://svnweb.freebsd.org/changeset/base/253088

Log:
  Migrate structs ahstat, espstat, ipcompstat, ipipstat, pfkeystat,
  ipsec4stat, ipsec6stat to PCPU counters.

Modified:
  head/sys/netipsec/ah_var.h
  head/sys/netipsec/esp_var.h
  head/sys/netipsec/ipcomp_var.h
  head/sys/netipsec/ipip_var.h
  head/sys/netipsec/ipsec.c
  head/sys/netipsec/ipsec.h
  head/sys/netipsec/ipsec6.h
  head/sys/netipsec/keysock.c
  head/sys/netipsec/keysock.h
  head/sys/netipsec/xform_ah.c
  head/sys/netipsec/xform_esp.c
  head/sys/netipsec/xform_ipcomp.c
  head/sys/netipsec/xform_ipip.c
  head/usr.bin/netstat/ipsec.c
  head/usr.bin/netstat/pfkey.c

Modified: head/sys/netipsec/ah_var.h
==============================================================================
--- head/sys/netipsec/ah_var.h	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/sys/netipsec/ah_var.h	Tue Jul  9 10:08:13 2013	(r253088)
@@ -71,14 +71,16 @@ struct ahstat {
 };
 
 #ifdef _KERNEL
+#include 
+
 VNET_DECLARE(int, ah_enable);
 VNET_DECLARE(int, ah_cleartos);
-VNET_DECLARE(struct ahstat, ahstat);
+VNET_PCPUSTAT_DECLARE(struct ahstat, ahstat);
 
-#define	AHSTAT_ADD(name, val)	V_ahstat.name += (val)
+#define	AHSTAT_ADD(name, val)	\
+    VNET_PCPUSTAT_ADD(struct ahstat, ahstat, name , (val))
 #define	AHSTAT_INC(name)	AHSTAT_ADD(name, 1)
 #define	V_ah_enable		VNET(ah_enable)
 #define	V_ah_cleartos		VNET(ah_cleartos)
-#define	V_ahstat		VNET(ahstat)
 #endif /* _KERNEL */
 #endif /*_NETIPSEC_AH_VAR_H_*/

Modified: head/sys/netipsec/esp_var.h
==============================================================================
--- head/sys/netipsec/esp_var.h	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/sys/netipsec/esp_var.h	Tue Jul  9 10:08:13 2013	(r253088)
@@ -72,12 +72,14 @@ struct espstat {
 };
 
 #ifdef _KERNEL
+#include 
+
 VNET_DECLARE(int, esp_enable);
-VNET_DECLARE(struct espstat, espstat);
+VNET_PCPUSTAT_DECLARE(struct espstat, espstat);
 
-#define	ESPSTAT_ADD(name, val)	V_espstat.name += (val)
+#define	ESPSTAT_ADD(name, val)	\
+    VNET_PCPUSTAT_ADD(struct espstat, espstat, name, (val))
 #define	ESPSTAT_INC(name)	ESPSTAT_ADD(name, 1)
 #define	V_esp_enable	VNET(esp_enable)
-#define	V_espstat	VNET(espstat)
 #endif /* _KERNEL */
 #endif /*_NETIPSEC_ESP_VAR_H_*/

Modified: head/sys/netipsec/ipcomp_var.h
==============================================================================
--- head/sys/netipsec/ipcomp_var.h	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/sys/netipsec/ipcomp_var.h	Tue Jul  9 10:08:13 2013	(r253088)
@@ -64,12 +64,14 @@ struct ipcompstat {
 };
 
 #ifdef _KERNEL
+#include 
+
 VNET_DECLARE(int, ipcomp_enable);
-VNET_DECLARE(struct ipcompstat, ipcompstat);
+VNET_PCPUSTAT_DECLARE(struct ipcompstat, ipcompstat);
 
-#define	IPCOMPSTAT_ADD(name, val)	V_ipcompstat.name += (val)
+#define	IPCOMPSTAT_ADD(name, val)	\
+    VNET_PCPUSTAT_ADD(struct ipcompstat, ipcompstat, name, (val))
 #define	IPCOMPSTAT_INC(name)		IPCOMPSTAT_ADD(name, 1)
 #define	V_ipcomp_enable		VNET(ipcomp_enable)
-#define	V_ipcompstat		VNET(ipcompstat)
 #endif /* _KERNEL */
 #endif /*_NETIPSEC_IPCOMP_VAR_H_*/

Modified: head/sys/netipsec/ipip_var.h
==============================================================================
--- head/sys/netipsec/ipip_var.h	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/sys/netipsec/ipip_var.h	Tue Jul  9 10:08:13 2013	(r253088)
@@ -58,12 +58,14 @@ struct ipipstat {
 };
 
 #ifdef _KERNEL
+#include 
+
 VNET_DECLARE(int, ipip_allow);
-VNET_DECLARE(struct ipipstat, ipipstat);
+VNET_PCPUSTAT_DECLARE(struct ipipstat, ipipstat);
 
-#define	IPIPSTAT_ADD(name, val)	V_ipipstat.name += (val)
+#define	IPIPSTAT_ADD(name, val)	\
+    VNET_PCPUSTAT_ADD(struct ipipstat, ipipstat, name, (val))
 #define	IPIPSTAT_INC(name)	IPIPSTAT_ADD(name, 1)
 #define	V_ipip_allow		VNET(ipip_allow)
-#define	V_ipipstat		VNET(ipipstat)
 #endif /* _KERNEL */
 #endif /* _NETINET_IPIP_H_ */

Modified: head/sys/netipsec/ipsec.c
==============================================================================
--- head/sys/netipsec/ipsec.c	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/sys/netipsec/ipsec.c	Tue Jul  9 10:08:13 2013	(r253088)
@@ -104,7 +104,13 @@ VNET_DEFINE(int, ipsec_debug) = 0;
 #endif
 
 /* NB: name changed so netstat doesn't use it. */
-VNET_DEFINE(struct ipsecstat, ipsec4stat);
+VNET_PCPUSTAT_DEFINE(struct ipsecstat, ipsec4stat);
+VNET_PCPUSTAT_SYSINIT(ipsec4stat);
+
+#ifdef VIMAGE
+VNET_PCPUSTAT_SYSUNINIT(ipsec4stat);
+#endif /* VIMAGE */
+
 VNET_DEFINE(int, ip4_ah_offsetmask) = 0;	/* maybe IP_DF? */
 /* DF bit on encap. 0: clear 1: set 2: copy */
 VNET_DEFINE(int, ip4_ipsec_dfbit) = 0;
@@ -167,9 +173,8 @@ SYSCTL_VNET_INT(_net_inet_ipsec, IPSECCT
 SYSCTL_VNET_INT(_net_inet_ipsec, OID_AUTO, crypto_support,
 	CTLFLAG_RW, &VNET_NAME(crypto_support), 0,
 	"Crypto driver selection.");
-SYSCTL_VNET_STRUCT(_net_inet_ipsec, OID_AUTO, ipsecstats,
-	CTLFLAG_RD, &VNET_NAME(ipsec4stat), ipsecstat,	
-	"IPsec IPv4 statistics.");
+SYSCTL_VNET_PCPUSTAT(_net_inet_ipsec, OID_AUTO, ipsecstats, struct ipsecstat,
+    ipsec4stat, "IPsec IPv4 statistics.");
 
 #ifdef REGRESSION
 /*
@@ -191,7 +196,13 @@ SYSCTL_VNET_INT(_net_inet_ipsec, OID_AUT
 #endif
 
 #ifdef INET6 
-VNET_DEFINE(struct ipsecstat, ipsec6stat);
+VNET_PCPUSTAT_DEFINE(struct ipsecstat, ipsec6stat);
+VNET_PCPUSTAT_SYSINIT(ipsec6stat);
+
+#ifdef VIMAGE
+VNET_PCPUSTAT_SYSUNINIT(ipsec6stat);
+#endif /* VIMAGE */
+
 VNET_DEFINE(int, ip6_esp_trans_deflev) = IPSEC_LEVEL_USE;
 VNET_DEFINE(int, ip6_esp_net_deflev) = IPSEC_LEVEL_USE;
 VNET_DEFINE(int, ip6_ah_trans_deflev) = IPSEC_LEVEL_USE;
@@ -201,10 +212,6 @@ VNET_DEFINE(int, ip6_ipsec_ecn) = 0;	/* 
 SYSCTL_DECL(_net_inet6_ipsec6);
 
 /* net.inet6.ipsec6 */
-#ifdef COMPAT_KAME
-SYSCTL_OID(_net_inet6_ipsec6, IPSECCTL_STATS, stats, CTLFLAG_RD,
-    0, 0, compat_ipsecstats_sysctl, "S", "IPsec IPv6 statistics.");
-#endif /* COMPAT_KAME */
 SYSCTL_VNET_INT(_net_inet6_ipsec6, IPSECCTL_DEF_POLICY, def_policy, CTLFLAG_RW,
 	&VNET_NAME(ip4_def_policy).policy, 0,
 	"IPsec default policy.");
@@ -226,9 +233,8 @@ SYSCTL_VNET_INT(_net_inet6_ipsec6, IPSEC
 SYSCTL_VNET_INT(_net_inet6_ipsec6, IPSECCTL_DEBUG, debug, CTLFLAG_RW,
 	&VNET_NAME(ipsec_debug), 0,
 	"Enable IPsec debugging output when set.");
-SYSCTL_VNET_STRUCT(_net_inet6_ipsec6, IPSECCTL_STATS,
-	ipsecstats, CTLFLAG_RD, &VNET_NAME(ipsec6stat), ipsecstat,
-	"IPsec IPv6 statistics.");
+SYSCTL_VNET_PCPUSTAT(_net_inet6_ipsec6, IPSECCTL_STATS, ipsecstats,
+    struct ipsecstat, ipsec6stat, "IPsec IPv6 statistics.");
 #endif /* INET6 */
 
 static int ipsec_setspidx_inpcb __P((struct mbuf *, struct inpcb *));

Modified: head/sys/netipsec/ipsec.h
==============================================================================
--- head/sys/netipsec/ipsec.h	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/sys/netipsec/ipsec.h	Tue Jul  9 10:08:13 2013	(r253088)
@@ -325,6 +325,8 @@ struct ipsecstat {
 }
 
 #ifdef _KERNEL
+#include 
+
 struct ipsec_output_state {
 	struct mbuf *m;
 	struct route *ro;
@@ -347,7 +349,7 @@ VNET_DECLARE(int, ipsec_integrity);
 #define	V_ipsec_integrity	VNET(ipsec_integrity)
 #endif
 
-VNET_DECLARE(struct ipsecstat, ipsec4stat);
+VNET_PCPUSTAT_DECLARE(struct ipsecstat, ipsec4stat);
 VNET_DECLARE(struct secpolicy, ip4_def_policy);
 VNET_DECLARE(int, ip4_esp_trans_deflev);
 VNET_DECLARE(int, ip4_esp_net_deflev);
@@ -359,8 +361,8 @@ VNET_DECLARE(int, ip4_ipsec_ecn);
 VNET_DECLARE(int, ip4_esp_randpad);
 VNET_DECLARE(int, crypto_support);
 
-#define	IPSECSTAT_INC(name)	V_ipsec4stat.name += 1
-#define	V_ipsec4stat		VNET(ipsec4stat)
+#define	IPSECSTAT_INC(name)	\
+    VNET_PCPUSTAT_ADD(struct ipsecstat, ipsec4stat, name, 1)
 #define	V_ip4_def_policy	VNET(ip4_def_policy)
 #define	V_ip4_esp_trans_deflev	VNET(ip4_esp_trans_deflev)
 #define	V_ip4_esp_net_deflev	VNET(ip4_esp_net_deflev)

Modified: head/sys/netipsec/ipsec6.h
==============================================================================
--- head/sys/netipsec/ipsec6.h	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/sys/netipsec/ipsec6.h	Tue Jul  9 10:08:13 2013	(r253088)
@@ -41,15 +41,17 @@
 #include 
 
 #ifdef _KERNEL
-VNET_DECLARE(struct ipsecstat, ipsec6stat);
+#include 
+
+VNET_PCPUSTAT_DECLARE(struct ipsecstat, ipsec6stat);
 VNET_DECLARE(int, ip6_esp_trans_deflev);
 VNET_DECLARE(int, ip6_esp_net_deflev);
 VNET_DECLARE(int, ip6_ah_trans_deflev);
 VNET_DECLARE(int, ip6_ah_net_deflev);
 VNET_DECLARE(int, ip6_ipsec_ecn);
 
-#define	IPSEC6STAT_INC(name)	V_ipsec6stat.name += 1
-#define	V_ipsec6stat		VNET(ipsec6stat)
+#define	IPSEC6STAT_INC(name)	\
+    VNET_PCPUSTAT_ADD(struct ipsecstat, ipsec6stat, name, 1)
 #define	V_ip6_esp_trans_deflev	VNET(ip6_esp_trans_deflev)
 #define	V_ip6_esp_net_deflev	VNET(ip6_esp_net_deflev)
 #define	V_ip6_ah_trans_deflev	VNET(ip6_ah_trans_deflev)

Modified: head/sys/netipsec/keysock.c
==============================================================================
--- head/sys/netipsec/keysock.c	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/sys/netipsec/keysock.c	Tue Jul  9 10:08:13 2013	(r253088)
@@ -77,7 +77,12 @@ static struct sockaddr key_src = { 2, PF
 
 static int key_sendup0 __P((struct rawcb *, struct mbuf *, int));
 
-VNET_DEFINE(struct pfkeystat, pfkeystat);
+VNET_PCPUSTAT_DEFINE(struct pfkeystat, pfkeystat);
+VNET_PCPUSTAT_SYSINIT(pfkeystat);
+
+#ifdef VIMAGE
+VNET_PCPUSTAT_SYSUNINIT(pfkeystat);
+#endif /* VIMAGE */
 
 /*
  * key_output()

Modified: head/sys/netipsec/keysock.h
==============================================================================
--- head/sys/netipsec/keysock.h	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/sys/netipsec/keysock.h	Tue Jul  9 10:08:13 2013	(r253088)
@@ -63,16 +63,18 @@ struct pfkeystat {
 #define KEY_SENDUP_REGISTERED	2
 
 #ifdef _KERNEL
+#include 
+
 struct keycb {
 	struct rawcb kp_raw;	/* rawcb */
 	int kp_promisc;		/* promiscuous mode */
 	int kp_registered;	/* registered socket */
 };
 
-VNET_DECLARE(struct pfkeystat, pfkeystat);
-#define	PFKEYSTAT_ADD(name, val)	V_pfkeystat.name += (val)
+VNET_PCPUSTAT_DECLARE(struct pfkeystat, pfkeystat);
+#define	PFKEYSTAT_ADD(name, val)	\
+    VNET_PCPUSTAT_ADD(struct pfkeystat, pfkeystat, name, (val))
 #define	PFKEYSTAT_INC(name)		PFKEYSTAT_ADD(name, 1)
-#define	V_pfkeystat		VNET(pfkeystat)
 
 extern int key_output(struct mbuf *m, struct socket *so);
 extern int key_usrreq __P((struct socket *,

Modified: head/sys/netipsec/xform_ah.c
==============================================================================
--- head/sys/netipsec/xform_ah.c	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/sys/netipsec/xform_ah.c	Tue Jul  9 10:08:13 2013	(r253088)
@@ -89,7 +89,12 @@
 
 VNET_DEFINE(int, ah_enable) = 1;	/* control flow of packets with AH */
 VNET_DEFINE(int, ah_cleartos) = 1;	/* clear ip_tos when doing AH calc */
-VNET_DEFINE(struct ahstat, ahstat);
+VNET_PCPUSTAT_DEFINE(struct ahstat, ahstat);
+VNET_PCPUSTAT_SYSINIT(ahstat);
+
+#ifdef VIMAGE
+VNET_PCPUSTAT_SYSUNINIT(ahstat);
+#endif /* VIMAGE */
 
 #ifdef INET
 SYSCTL_DECL(_net_inet_ah);
@@ -97,8 +102,8 @@ SYSCTL_VNET_INT(_net_inet_ah, OID_AUTO,
 	ah_enable,	CTLFLAG_RW,	&VNET_NAME(ah_enable),	0, "");
 SYSCTL_VNET_INT(_net_inet_ah, OID_AUTO,
 	ah_cleartos,	CTLFLAG_RW,	&VNET_NAME(ah_cleartos), 0, "");
-SYSCTL_VNET_STRUCT(_net_inet_ah, IPSECCTL_STATS,
-	stats,		CTLFLAG_RD,	&VNET_NAME(ahstat), ahstat, "");
+SYSCTL_VNET_PCPUSTAT(_net_inet_ah, IPSECCTL_STATS, stats, struct ahstat,
+    ahstat, "AH statistics (struct ahstat, netipsec/ah_var.h)");
 #endif
 
 static unsigned char ipseczeroes[256];	/* larger than an ip6 extension hdr */

Modified: head/sys/netipsec/xform_esp.c
==============================================================================
--- head/sys/netipsec/xform_esp.c	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/sys/netipsec/xform_esp.c	Tue Jul  9 10:08:13 2013	(r253088)
@@ -77,13 +77,19 @@
 #include 
 
 VNET_DEFINE(int, esp_enable) = 1;
-VNET_DEFINE(struct espstat, espstat);
+VNET_PCPUSTAT_DEFINE(struct espstat, espstat);
+VNET_PCPUSTAT_SYSINIT(espstat);
+
+#ifdef VIMAGE
+VNET_PCPUSTAT_SYSUNINIT(espstat);
+#endif /* VIMAGE */
 
 SYSCTL_DECL(_net_inet_esp);
 SYSCTL_VNET_INT(_net_inet_esp, OID_AUTO,
 	esp_enable,	CTLFLAG_RW,	&VNET_NAME(esp_enable),	0, "");
-SYSCTL_VNET_STRUCT(_net_inet_esp, IPSECCTL_STATS,
-	stats,		CTLFLAG_RD,	&VNET_NAME(espstat),	espstat, "");
+SYSCTL_VNET_PCPUSTAT(_net_inet_esp, IPSECCTL_STATS, stats,
+    struct espstat, espstat,
+    "ESP statistics (struct espstat, netipsec/esp_var.h");
 
 static int esp_input_cb(struct cryptop *op);
 static int esp_output_cb(struct cryptop *crp);

Modified: head/sys/netipsec/xform_ipcomp.c
==============================================================================
--- head/sys/netipsec/xform_ipcomp.c	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/sys/netipsec/xform_ipcomp.c	Tue Jul  9 10:08:13 2013	(r253088)
@@ -70,13 +70,19 @@
 #include 
 
 VNET_DEFINE(int, ipcomp_enable) = 1;
-VNET_DEFINE(struct ipcompstat, ipcompstat);
+VNET_PCPUSTAT_DEFINE(struct ipcompstat, ipcompstat);
+VNET_PCPUSTAT_SYSINIT(ipcompstat);
+
+#ifdef VIMAGE
+VNET_PCPUSTAT_SYSUNINIT(ipcompstat);
+#endif /* VIMAGE */
 
 SYSCTL_DECL(_net_inet_ipcomp);
 SYSCTL_VNET_INT(_net_inet_ipcomp, OID_AUTO,
 	ipcomp_enable,	CTLFLAG_RW,	&VNET_NAME(ipcomp_enable),	0, "");
-SYSCTL_VNET_STRUCT(_net_inet_ipcomp, IPSECCTL_STATS,
-	stats,		CTLFLAG_RD,	&VNET_NAME(ipcompstat),	ipcompstat, "");
+SYSCTL_VNET_PCPUSTAT(_net_inet_ipcomp, IPSECCTL_STATS, stats,
+    struct ipcompstat, ipcompstat,
+    "IPCOMP statistics (struct ipcompstat, netipsec/ipcomp_var.h");
 
 static int ipcomp_input_cb(struct cryptop *crp);
 static int ipcomp_output_cb(struct cryptop *crp);
@@ -631,12 +637,3 @@ ipcomp_attach(void)
 }
 
 SYSINIT(ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ipcomp_attach, NULL);
-
-static void
-vnet_ipcomp_attach(const void *unused __unused)
-{
-
-}
-
-VNET_SYSINIT(vnet_ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE,
-    vnet_ipcomp_attach, NULL);

Modified: head/sys/netipsec/xform_ipip.c
==============================================================================
--- head/sys/netipsec/xform_ipip.c	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/sys/netipsec/xform_ipip.c	Tue Jul  9 10:08:13 2013	(r253088)
@@ -91,13 +91,19 @@
  * net.inet.ipip.allow value.  Zero means drop them, all else is acceptance.
  */
 VNET_DEFINE(int, ipip_allow) = 0;
-VNET_DEFINE(struct ipipstat, ipipstat);
+VNET_PCPUSTAT_DEFINE(struct ipipstat, ipipstat);
+VNET_PCPUSTAT_SYSINIT(ipipstat);
+
+#ifdef VIMAGE
+VNET_PCPUSTAT_SYSUNINIT(ipipstat);
+#endif /* VIMAGE */
 
 SYSCTL_DECL(_net_inet_ipip);
 SYSCTL_VNET_INT(_net_inet_ipip, OID_AUTO,
 	ipip_allow,	CTLFLAG_RW,	&VNET_NAME(ipip_allow),	0, "");
-SYSCTL_VNET_STRUCT(_net_inet_ipip, IPSECCTL_STATS,
-	stats,		CTLFLAG_RD,	&VNET_NAME(ipipstat),	ipipstat, "");
+SYSCTL_VNET_PCPUSTAT(_net_inet_ipip, IPSECCTL_STATS, stats,
+    struct ipipstat, ipipstat,
+    "IPIP statistics (struct ipipstat, netipsec/ipip_var.h)");
 
 /* XXX IPCOMP */
 #define	M_IPSEC	(M_AUTHIPHDR|M_AUTHIPDGM|M_DECRYPTED)

Modified: head/usr.bin/netstat/ipsec.c
==============================================================================
--- head/usr.bin/netstat/ipsec.c	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/usr.bin/netstat/ipsec.c	Tue Jul  9 10:08:13 2013	(r253088)
@@ -268,7 +268,7 @@ ipsec_stats(u_long off, const char *name
 	if (off == 0)
 		return;
 	printf ("%s:\n", name);
-	kread(off, (char *)&ipsecstat, sizeof(ipsecstat));
+	kread_counters(off, (char *)&ipsecstat, sizeof(ipsecstat));
 
 	print_ipsecstats(&ipsecstat);
 }
@@ -354,7 +354,7 @@ ah_stats(u_long off, const char *name, i
 	if (off == 0)
 		return;
 	printf ("%s:\n", name);
-	kread(off, (char *)&ahstat, sizeof(ahstat));
+	kread_counters(off, (char *)&ahstat, sizeof(ahstat));
 
 	print_ahstats(&ahstat);
 }
@@ -401,7 +401,7 @@ esp_stats(u_long off, const char *name, 
 	if (off == 0)
 		return;
 	printf ("%s:\n", name);
-	kread(off, (char *)&espstat, sizeof(espstat));
+	kread_counters(off, (char *)&espstat, sizeof(espstat));
 
 	print_espstats(&espstat);
 }
@@ -446,7 +446,7 @@ ipcomp_stats(u_long off, const char *nam
 	if (off == 0)
 		return;
 	printf ("%s:\n", name);
-	kread(off, (char *)&ipcompstat, sizeof(ipcompstat));
+	kread_counters(off, (char *)&ipcompstat, sizeof(ipcompstat));
 
 	print_ipcompstats(&ipcompstat);
 }

Modified: head/usr.bin/netstat/pfkey.c
==============================================================================
--- head/usr.bin/netstat/pfkey.c	Tue Jul  9 10:02:51 2013	(r253087)
+++ head/usr.bin/netstat/pfkey.c	Tue Jul  9 10:08:13 2013	(r253088)
@@ -119,7 +119,7 @@ pfkey_stats(u_long off, const char *name
 	if (off == 0)
 		return;
 	printf ("%s:\n", name);
-	kread(off, (char *)&pfkeystat, sizeof(pfkeystat));
+	kread_counters(off, (char *)&pfkeystat, sizeof(pfkeystat));
 
 #define	p(f, m) if (pfkeystat.f || sflag <= 1) \
     printf(m, (uintmax_t)pfkeystat.f, plural(pfkeystat.f))

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 10:20:28 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 34C1726E;
 Tue,  9 Jul 2013 10:20:28 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 27ECF1761;
 Tue,  9 Jul 2013 10:20:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69AKS4u047668;
 Tue, 9 Jul 2013 10:20:28 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69AKRTN047663;
 Tue, 9 Jul 2013 10:20:27 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201307091020.r69AKRTN047663@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 9 Jul 2013 10:20:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253089 - in head: . sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 10:20:28 -0000

Author: ae
Date: Tue Jul  9 10:20:27 2013
New Revision: 253089
URL: http://svnweb.freebsd.org/changeset/base/253089

Log:
  Bump __FreeBSD_version to reflect changes in statistics structures.

Modified:
  head/UPDATING
  head/sys/sys/param.h

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Tue Jul  9 10:08:13 2013	(r253088)
+++ head/UPDATING	Tue Jul  9 10:20:27 2013	(r253089)
@@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
 	disable the most expensive debugging functionality run
 	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20130709:
+	Most of network statistics structures were changed to be able
+	keep 64-bits counters. Thus all tools, that work with networking
+	statistics, must be rebuilded (netstat(1), bsnmpd(1), etc.)
+
 20130629:
 	Fix targets that run multiple make's to use && rather than ;
 	so that subsequent steps depend on success of previous.

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h	Tue Jul  9 10:08:13 2013	(r253088)
+++ head/sys/sys/param.h	Tue Jul  9 10:20:27 2013	(r253089)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1000036	/* Master, propagated to newvers */
+#define __FreeBSD_version 1000037	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 10:27:26 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 96144475;
 Tue,  9 Jul 2013 10:27:26 +0000 (UTC) (envelope-from rmh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 88F9F17B1;
 Tue,  9 Jul 2013 10:27:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69ARQ5a049933;
 Tue, 9 Jul 2013 10:27:26 GMT (envelope-from rmh@svn.freebsd.org)
Received: (from rmh@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69ARQW3049932;
 Tue, 9 Jul 2013 10:27:26 GMT (envelope-from rmh@svn.freebsd.org)
Message-Id: <201307091027.r69ARQW3049932@svn.freebsd.org>
From: Robert Millan 
Date: Tue, 9 Jul 2013 10:27:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253090 - head/sys/crypto/sha2
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 10:27:26 -0000

Author: rmh
Date: Tue Jul  9 10:27:26 2013
New Revision: 253090
URL: http://svnweb.freebsd.org/changeset/base/253090

Log:
  Allow assert() to operate correctly when building userland code.

Modified:
  head/sys/crypto/sha2/sha2.c

Modified: head/sys/crypto/sha2/sha2.c
==============================================================================
--- head/sys/crypto/sha2/sha2.c	Tue Jul  9 10:20:27 2013	(r253089)
+++ head/sys/crypto/sha2/sha2.c	Tue Jul  9 10:27:26 2013	(r253090)
@@ -67,8 +67,10 @@ __FBSDID("$FreeBSD$");
  *
  */
 
-#if defined(__bsdi__) || defined(__FreeBSD__)
+#if defined(_KERNEL) && (defined(__bsdi__) || defined(__FreeBSD__))
 #define assert(x)
+#else
+#include 
 #endif
 
 

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 10:41:18 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 5F91D777;
 Tue,  9 Jul 2013 10:41:18 +0000 (UTC) (envelope-from smh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 520A1182A;
 Tue,  9 Jul 2013 10:41:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69AfImf054881;
 Tue, 9 Jul 2013 10:41:18 GMT (envelope-from smh@svn.freebsd.org)
Received: (from smh@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69AfHAk054879;
 Tue, 9 Jul 2013 10:41:17 GMT (envelope-from smh@svn.freebsd.org)
Message-Id: <201307091041.r69AfHAk054879@svn.freebsd.org>
From: Steven Hartland 
Date: Tue, 9 Jul 2013 10:41:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253091 - in head/sys/cam: ata scsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 10:41:18 -0000

Author: smh
Date: Tue Jul  9 10:41:17 2013
New Revision: 253091
URL: http://svnweb.freebsd.org/changeset/base/253091

Log:
  Added 4K QUIRK for OCZ Vertex 4 SSDs
  
  Submitted by:	Borja Marcos 
  MFC after:	2 days

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Tue Jul  9 10:27:26 2013	(r253090)
+++ head/sys/cam/ata/ata_da.c	Tue Jul  9 10:41:17 2013	(r253091)
@@ -396,6 +396,14 @@ static struct ada_quirk_entry ada_quirk_
 	},
 	{
 		/*
+		 * OCZ Vertex 4 SSDs
+		 * 4k optimised & trim only works in 4k requests + 4k aligned
+		 */
+		{ T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-VERTEX4*", "*" },
+		/*quirks*/ADA_Q_4K
+	},
+	{
+		/*
 		 * Samsung 830 Series SSDs
 		 * 4k optimised
 		 */

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Tue Jul  9 10:27:26 2013	(r253090)
+++ head/sys/cam/scsi/scsi_da.c	Tue Jul  9 10:41:17 2013	(r253091)
@@ -1031,6 +1031,14 @@ static struct da_quirk_entry da_quirk_ta
 	},
 	{
 		/*
+		 * OCZ Vertex 4 SSDs
+		 * 4k optimised & trim only works in 4k requests + 4k aligned
+		 */
+		{ T_DIRECT, SIP_MEDIA_FIXED, "ATA", "OCZ-VERTEX4*", "*" },
+		/*quirks*/DA_Q_4K
+	},
+	{
+		/*
 		 * Samsung 830 Series SSDs
 		 * 4k optimised & trim only works in 4k requests + 4k aligned
 		 */

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 12:25:45 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 535BEF4B;
 Tue,  9 Jul 2013 12:25:45 +0000 (UTC)
 (envelope-from joel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 461C81CCE;
 Tue,  9 Jul 2013 12:25:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69CPjFh084809;
 Tue, 9 Jul 2013 12:25:45 GMT (envelope-from joel@svn.freebsd.org)
Received: (from joel@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69CPj56084808;
 Tue, 9 Jul 2013 12:25:45 GMT (envelope-from joel@svn.freebsd.org)
Message-Id: <201307091225.r69CPj56084808@svn.freebsd.org>
From: Joel Dahl 
Date: Tue, 9 Jul 2013 12:25:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253093 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 12:25:45 -0000

Author: joel (doc committer)
Date: Tue Jul  9 12:25:44 2013
New Revision: 253093
URL: http://svnweb.freebsd.org/changeset/base/253093

Log:
  Make mandoc lint happy.

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

Modified: head/share/man/man4/bridge.4
==============================================================================
--- head/share/man/man4/bridge.4	Tue Jul  9 11:00:10 2013	(r253092)
+++ head/share/man/man4/bridge.4	Tue Jul  9 12:25:44 2013	(r253093)
@@ -151,7 +151,7 @@ The following
 .Xr rc.conf 5
 variable configures an IPv6 link-local address on
 .Li bridge0
-interface: 
+interface:
 .Bd -literal -offset indent
 ifconfig_bridge0_ipv6="up"
 .Ed
@@ -186,7 +186,7 @@ and applications use both of them.
 To prevent this situation,
 .Nm
 checks whether an link-local scoped IPv6 address is configured on
-a member interface to be added and the 
+a member interface to be added and the
 .Nm
 interface.
 When the
@@ -214,7 +214,6 @@ and/or
 .Va net.inet6.ip6.auto_linklocal
 is set to
 .Li 1 .
-.Ed
 .Sh SPANNING TREE
 The
 .Nm

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 12:36:30 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 93A4F2E3;
 Tue,  9 Jul 2013 12:36:30 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au
 [211.29.132.42])
 by mx1.freebsd.org (Postfix) with ESMTP id 432F51D45;
 Tue,  9 Jul 2013 12:36:29 +0000 (UTC)
Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au
 (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23])
 by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id BDDFE3C062E;
 Tue,  9 Jul 2013 22:36:22 +1000 (EST)
Date: Tue, 9 Jul 2013 22:36:20 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Andriy Gapon 
Subject: Re: svn commit: r253077 - head/sys/kern
In-Reply-To: <201307090901.r6991j64023941@svn.freebsd.org>
Message-ID: <20130709222704.L16411@besplex.bde.org>
References: <201307090901.r6991j64023941@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.0 cv=Q6eKePKa c=1 sm=1 a=-fB-b2Shr38A:10
 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=M4roAWbnUW4A:10
 a=SoqTtPcDvfIZEx2kRbQA:9 a=CjuIK1q_8ugA:10 a=GckuAJ8mm-_RZzYM:21
 a=UdTGbyzZN9Vzyiy0:21 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 12:36:30 -0000

On Tue, 9 Jul 2013, Andriy Gapon wrote:

> Log:
>  should_yield: protect from td_swvoltick being uninitialized or too stale
>
>  The distance between ticks and td_swvoltick should be calculated as
>  an unsigned number.  Previously we could end up comparing a negative
>  number with hogticks in which case should_yield() would give incorrect
>  answer.
>
>  We should probably ensure that td_swvoltick is properly initialized.
>
>  Sponsored by:	HybridCluster
>  MFC after:	5 days
>
> Modified:
>  head/sys/kern/kern_synch.c
>
> Modified: head/sys/kern/kern_synch.c
> ==============================================================================
> --- head/sys/kern/kern_synch.c	Tue Jul  9 08:59:39 2013	(r253076)
> +++ head/sys/kern/kern_synch.c	Tue Jul  9 09:01:44 2013	(r253077)
> @@ -581,7 +581,7 @@ int
> should_yield(void)
> {
>
> -	return (ticks - curthread->td_swvoltick >= hogticks);
> +	return ((unsigned int)(ticks - curthread->td_swvoltick) >= hogticks);
> }

Hrmph.  Perhaps it should be calculated as an unsigned number, but
this calculates it as a signed number, with undefined behaviour if
overflow occurs, and then bogusly casts the signed number to unsigned.

It also has a style bug in the cast -- "unsigned int" is verbose, and
even "unsigned" is too long, so it is spelled "u_int" in the kernel.

Next, after the cast the operand types are mismatched, and compilers
could reasonably warn about the possible sign extension bugs from this.
Compilers do warn about the mismatch for "i < size_t(foo)" in loops.
This warning is so annoying and it is not normally produced when both
the operands are variables.  Many "fixes" for this warning make sign
extension bugs worse by casting changing the type of the variable
instead of casting the size_t.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 12:55:01 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id E2CCBBF1;
 Tue,  9 Jul 2013 12:55:01 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id BAB641E29;
 Tue,  9 Jul 2013 12:55:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69Ct18h093371;
 Tue, 9 Jul 2013 12:55:01 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69Ct1Yh093369;
 Tue, 9 Jul 2013 12:55:01 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307091255.r69Ct1Yh093369@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 9 Jul 2013 12:55:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253094 - head/sys/dev/usb/controller
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 12:55:02 -0000

Author: kib
Date: Tue Jul  9 12:55:01 2013
New Revision: 253094
URL: http://svnweb.freebsd.org/changeset/base/253094

Log:
  Use MSI for xhci(4), if supported.
  
  Reviewed by:	jhb
  Tested by:	dchagin
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/dev/usb/controller/xhci.h
  head/sys/dev/usb/controller/xhci_pci.c

Modified: head/sys/dev/usb/controller/xhci.h
==============================================================================
--- head/sys/dev/usb/controller/xhci.h	Tue Jul  9 12:25:44 2013	(r253093)
+++ head/sys/dev/usb/controller/xhci.h	Tue Jul  9 12:55:01 2013	(r253094)
@@ -447,6 +447,7 @@ struct xhci_softc {
 
 	struct usb_device	*sc_devices[XHCI_MAX_DEVICES];
 	struct resource		*sc_io_res;
+	int			sc_irq_rid;
 	struct resource		*sc_irq_res;
 
 	void			*sc_intr_hdl;

Modified: head/sys/dev/usb/controller/xhci_pci.c
==============================================================================
--- head/sys/dev/usb/controller/xhci_pci.c	Tue Jul  9 12:25:44 2013	(r253093)
+++ head/sys/dev/usb/controller/xhci_pci.c	Tue Jul  9 12:55:01 2013	(r253094)
@@ -146,8 +146,7 @@ static int
 xhci_pci_attach(device_t self)
 {
 	struct xhci_softc *sc = device_get_softc(self);
-	int err;
-	int rid;
+	int count, err, rid;
 
 	/* XXX check for 64-bit capability */
 
@@ -171,11 +170,21 @@ xhci_pci_attach(device_t self)
 
 	usb_callout_init_mtx(&sc->sc_callout, &sc->sc_bus.bus_mtx, 0);
 
-	rid = 0;
-	sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid,
-	    RF_SHAREABLE | RF_ACTIVE);
+	sc->sc_irq_rid = 0;
+	count = pci_msi_count(self);
+	if (count >= 1) {
+		count = 1;
+		if (pci_alloc_msi(self, &count) == 0) {
+			if (bootverbose)
+				device_printf(self, "MSI enabled\n");
+			sc->sc_irq_rid = 1;
+		}
+	}
+	sc->sc_irq_res = bus_alloc_resource_any(self, SYS_RES_IRQ,
+	    &sc->sc_irq_rid, RF_SHAREABLE | RF_ACTIVE);
 	if (sc->sc_irq_res == NULL) {
 		device_printf(self, "Could not allocate IRQ\n");
+		goto error;
 	}
 	sc->sc_bus.bdev = device_add_child(self, "usbus", -1);
 	if (sc->sc_bus.bdev == NULL) {
@@ -249,7 +258,10 @@ xhci_pci_detach(device_t self)
 		sc->sc_intr_hdl = NULL;
 	}
 	if (sc->sc_irq_res) {
-		bus_release_resource(self, SYS_RES_IRQ, 0, sc->sc_irq_res);
+		if (sc->sc_irq_rid == 1)
+			pci_release_msi(self);
+		bus_release_resource(self, SYS_RES_IRQ, sc->sc_irq_rid,
+		    sc->sc_irq_res);
 		sc->sc_irq_res = NULL;
 	}
 	if (sc->sc_io_res) {

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 12:59:34 2013
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 3796ADC7;
 Tue,  9 Jul 2013 12:59:34 +0000 (UTC) (envelope-from ray@freebsd.org)
Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146])
 by mx1.freebsd.org (Postfix) with ESMTP id A3F241E73;
 Tue,  9 Jul 2013 12:59:33 +0000 (UTC)
Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray)
 by smtp.dlink.ua (Postfix) with ESMTPA id 9976BC4963;
 Mon,  8 Jul 2013 13:21:09 +0300 (EEST)
Date: Mon, 8 Jul 2013 13:20:52 +0300
From: Aleksandr Rybalko 
To: Bruce Evans 
Subject: Re: svn commit: r252425 - head/sys/arm/arm
Message-Id: <20130708132052.f9757df88ede1b087de9da8c@freebsd.org>
In-Reply-To: <20130701113808.F894@besplex.bde.org>
References: <201306301952.r5UJqfwf010873@svn.freebsd.org>
 <20130701113808.F894@besplex.bde.org>
X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.6; amd64-portbld-freebsd9.0)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, Aleksandr Rybalko ,
 src-committers@FreeBSD.org, svn-src-all@FreeBSD.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 12:59:34 -0000

On Mon, 1 Jul 2013 11:56:25 +1000 (EST)
Bruce Evans  wrote:

> On Sun, 30 Jun 2013, Aleksandr Rybalko wrote:
> 
> > Log:
> >  Decrypt magic numbers - define names for fields of Generic Timer's CNTKCTL reg.
> >
> >  Submitted by:	Ruslan Bukin 
> >
> > Modified:
> >  head/sys/arm/arm/generic_timer.c
> >
> > Modified: head/sys/arm/arm/generic_timer.c
> > ==============================================================================
> > --- head/sys/arm/arm/generic_timer.c	Sun Jun 30 19:36:17 2013	(r252424)
> > +++ head/sys/arm/arm/generic_timer.c	Sun Jun 30 19:52:41 2013	(r252425)
> > @@ -66,7 +66,22 @@ __FBSDID("$FreeBSD$");
> > #define	GENERIC_TIMER_REG_CTRL		0
> > #define	GENERIC_TIMER_REG_TVAL		1
> >
> > -#define	CNTPSIRQ	29
> > +#define	GENERIC_TIMER_CNTKCTL_PL0PTEN	(1 << 9) /* Physical timer registers
> > +						    access from PL0 */
> > +#define	GENERIC_TIMER_CNTKCTL_PL0VTEN	(1 << 8) /* Virtual timer registers
> 
> With names like these, the magic numbers are better.  The prefix name
> GENERIC_TIMER is especially bad.  GT would be good.

Changed in r252780.

> 
> > ...
> > +#define	GENERIC_TIMER_CNTPSIRQ	29
> 
> Here the interesting part CNTPSIRQ is fairly abbreviated, but its prefix
> is not.

GENERIC_TIMER was original prefix before timer access bits was added,
but CNTPSIRQ is original name from documentation. Name was preserved to
avoid confusion.

> 
> >
> > struct arm_tmr_softc {
> > 	struct resource		*irq_res;
> > @@ -167,7 +182,11 @@ disable_user_access(void)
> > 	uint32_t cntkctl;
> >
> > 	__asm volatile("mrc p15, 0, %0, c14, c1, 0" : "=r" (cntkctl));
> > -	cntkctl &= ~((3 << 8) | (7 << 0));
> > +	cntkctl &= ~(GENERIC_TIMER_CNTKCTL_PL0PTEN |
> > +		GENERIC_TIMER_CNTKCTL_PL0VTEN |
> > +		GENERIC_TIMER_CNTKCTL_EVNTEN |
> > +		GENERIC_TIMER_CNTKCTL_PL0VCTEN |
> > +		GENERIC_TIMER_CNTKCTL_PL0PCTEN);
> > 	__asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl));
> > 	isb();
> > }
> 
> Using these verbose names takes about 15 times as much code as
> before (the statement is only 5 times longer, but the definitions
> macros are about 10 times longer), and looks like even more becayse
> the statement is misformatted with non-KNF indentation which then
> requires extra line spitting with only 1 name per line.

Now a lot of bytes saved! :)

> 
> > @@ -270,7 +289,8 @@ arm_tmr_attach(device_t dev)
> >
> > 	rid = 0;
> > 	sc->irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &rid,
> > -	    CNTPSIRQ, CNTPSIRQ, 1, RF_SHAREABLE | RF_ACTIVE);
> > +	    GENERIC_TIMER_CNTPSIRQ, GENERIC_TIMER_CNTPSIRQ,
> > +	    1, RF_SHAREABLE | RF_ACTIVE);
> >
> > 	arm_tmr_sc = sc;
> 
> For full uglyness, expand all the prefixes and names:

I will! :-D

> - SYS -> SYSTEM
> - RES -> RESOURCE
> - IRQ -> INTERRUPT_REQUEST_NUMBER
> - SYS_RES_IRQ -> SYSTEM_RESOURCE_INTERRUPT_REQUEST_NUMBER
> - RF -> RESOURCE_FLAG
> - RF_SHAREABLE_RESOURCE_FLAG_SHAREABLE 
> - RF_ACTIVE -> RESOURCE_FLAG_ACTIVE
> - CNTPSIRQ -> COUNT_PRIVATELY_SOURCED_INTERRUPT_REQUEST_NUMBER
>    (just guessing what PS means):
> 
>  	sc->irq_res = bus_alloc_resource(dev, SYS_RES_INTERRUPT_REQUEST_NUMBER,
>  	    &rid,
>  	    GENERIC_TIMER_COUNT_PRIVATELY_SOURCED_INTERRUPT_REQUEST_NUMBER,
>  	    GENERIC_TIMER_COUNT_PRIVATELY_SOURCED_INTERRUPT_REQUEST_NUMBER,
>  	    1, RESOURCE_FLAG_SHAREABLE | RESOURCE_FLAG_ACTIVE);
> 
> Next, use non-KNF indentation:
> 
>  	sc->irq_res = bus_alloc_resource(dev, SYS_RES_INTERRUPT_REQUEST_NUMBER,
>  		&rid,
>  		GENERIC_TIMER_COUNT_PRIVATELY_SOURCED_INTERRUPT_REQUEST_NUMBER,
>  		GENERIC_TIMER_COUNT_PRIVATELY_SOURCED_INTERRUPT_REQUEST_NUMBER,
>  		1, RESOURCE_FLAG_SHAREABLE | RESOURCE_FLAG_ACTIVE);
> 
> The names aren't even 80 characters long, so they actually fit on 1 line.
> 
> Bruce

Thanks Bruce!

"Long words only upset me." (c) Vinny-Pooh (USSR version) :-D

-- 
Aleksandr Rybalko 

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 13:22:31 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 237EA5E8;
 Tue,  9 Jul 2013 13:22:31 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 150661F8F;
 Tue,  9 Jul 2013 13:22:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69DMUML002321;
 Tue, 9 Jul 2013 13:22:30 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69DMUJc002320;
 Tue, 9 Jul 2013 13:22:30 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307091322.r69DMUJc002320@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 9 Jul 2013 13:22:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253095 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 13:22:31 -0000

Author: kib
Date: Tue Jul  9 13:22:30 2013
New Revision: 253095
URL: http://svnweb.freebsd.org/changeset/base/253095

Log:
  Fix typo in comment.
  
  MFC after:	3 days

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c	Tue Jul  9 12:55:01 2013	(r253094)
+++ head/sys/vm/swap_pager.c	Tue Jul  9 13:22:30 2013	(r253095)
@@ -836,7 +836,7 @@ swap_pager_freespace(vm_object_t object,
  * SWAP_PAGER_RESERVE() - reserve swap blocks in object
  *
  *	Assigns swap blocks to the specified range within the object.  The
- *	swap blocks are not zerod.  Any previous swap assignment is destroyed.
+ *	swap blocks are not zeroed.  Any previous swap assignment is destroyed.
  *
  *	Returns 0 on success, -1 on failure.
  */

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 14:23:01 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 7A44EB2D;
 Tue,  9 Jul 2013 14:23:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 6B7FA12AD;
 Tue,  9 Jul 2013 14:23:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69EN0UA020280;
 Tue, 9 Jul 2013 14:23:00 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69EN0n5020279;
 Tue, 9 Jul 2013 14:23:00 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201307091423.r69EN0n5020279@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Tue, 9 Jul 2013 14:23:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253098 - head/sys/fs/ext2fs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 14:23:01 -0000

Author: pfg
Date: Tue Jul  9 14:23:00 2013
New Revision: 253098
URL: http://svnweb.freebsd.org/changeset/base/253098

Log:
  Reinstate the assertion from r253045.
  
  UFS r232732 reverted the change as the real problem was to be fixed
  at the syscall level.
  
  Reported by:	bde

Modified:
  head/sys/fs/ext2fs/ext2_vnops.c

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vnops.c	Tue Jul  9 13:52:34 2013	(r253097)
+++ head/sys/fs/ext2fs/ext2_vnops.c	Tue Jul  9 14:23:00 2013	(r253098)
@@ -1598,11 +1598,11 @@ ext2_read(struct vop_read_args *ap)
 	} else if (vp->v_type != VREG && vp->v_type != VDIR)
 		panic("%s: type %d", "ext2_read", vp->v_type);
 #endif
-	if (uio->uio_resid < 0 || uio->uio_offset < 0)
-		return (EINVAL);
 	orig_resid = uio->uio_resid;
+	KASSERT(orig_resid >= 0, ("ext2_read: uio->uio_resid < 0"));
 	if (orig_resid == 0)
 		return (0);
+	KASSERT(uio->uio_offset >= 0, ("ext2_read: uio->uio_offset < 0"));
 	fs = ip->i_e2fs;
 	if (uio->uio_offset < ip->i_size &&
 	    uio->uio_offset >= fs->e2fs_maxfilesize)

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 14:38:26 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 9B8E2FDD;
 Tue,  9 Jul 2013 14:38:26 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8D9D01371;
 Tue,  9 Jul 2013 14:38:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69EcQaT023849;
 Tue, 9 Jul 2013 14:38:26 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69EcQP5023848;
 Tue, 9 Jul 2013 14:38:26 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201307091438.r69EcQP5023848@svn.freebsd.org>
From: Michael Tuexen 
Date: Tue, 9 Jul 2013 14:38:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253099 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 14:38:26 -0000

Author: tuexen
Date: Tue Jul  9 14:38:26 2013
New Revision: 253099
URL: http://svnweb.freebsd.org/changeset/base/253099

Log:
  Use IPSECSTAT_INC() and IPSEC6STAT_INC() macros for ipsec statistics
  accounting.
  
  X-MFC with: r252026

Modified:
  head/sys/netinet/sctp_input.c

Modified: head/sys/netinet/sctp_input.c
==============================================================================
--- head/sys/netinet/sctp_input.c	Tue Jul  9 14:23:00 2013	(r253098)
+++ head/sys/netinet/sctp_input.c	Tue Jul  9 14:38:26 2013	(r253099)
@@ -5705,7 +5705,7 @@ sctp_common_input_processing(struct mbuf
 #ifdef INET
 		case AF_INET:
 			if (ipsec4_in_reject(m, &inp->ip_inp.inp)) {
-				MODULE_GLOBAL(ipsec4stat).in_polvio++;
+				IPSECSTAT_INC(in_polvio);
 				SCTP_STAT_INCR(sctps_hdrops);
 				goto out;
 			}
@@ -5714,7 +5714,7 @@ sctp_common_input_processing(struct mbuf
 #ifdef INET6
 		case AF_INET6:
 			if (ipsec6_in_reject(m, &inp->ip_inp.inp)) {
-				MODULE_GLOBAL(ipsec6stat).in_polvio++;
+				IPSEC6STAT_INC(in_polvio);
 				SCTP_STAT_INCR(sctps_hdrops);
 				goto out;
 			}

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 15:10:27 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id D9E99C21;
 Tue,  9 Jul 2013 15:10:27 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id CCCA316AD;
 Tue,  9 Jul 2013 15:10:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69FARRd034567;
 Tue, 9 Jul 2013 15:10:27 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69FARhW034566;
 Tue, 9 Jul 2013 15:10:27 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201307091510.r69FARhW034566@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 9 Jul 2013 15:10:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253100 - head/sys/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 15:10:27 -0000

Author: ae
Date: Tue Jul  9 15:10:27 2013
New Revision: 253100
URL: http://svnweb.freebsd.org/changeset/base/253100

Log:
  Correct CTASSERT condition.

Modified:
  head/sys/net/vnet.h

Modified: head/sys/net/vnet.h
==============================================================================
--- head/sys/net/vnet.h	Tue Jul  9 14:38:26 2013	(r253099)
+++ head/sys/net/vnet.h	Tue Jul  9 15:10:27 2013	(r253100)
@@ -124,7 +124,8 @@ static int								\
 array##_sysctl(SYSCTL_HANDLER_ARGS)					\
 {									\
 	type s;								\
-	CTASSERT(sizeof(type) == sizeof(VNET(array)));			\
+	CTASSERT((sizeof(type) / sizeof(uint64_t)) ==			\
+	    (sizeof(VNET(array)) / sizeof(counter_u64_t)));		\
 	COUNTER_ARRAY_COPY(VNET(array), &s, sizeof(type) / sizeof(uint64_t));\
 	if (req->newptr)						\
 		COUNTER_ARRAY_ZERO(VNET(array),				\

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 15:20:47 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id F291C161;
 Tue,  9 Jul 2013 15:20:46 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id E5CD3177F;
 Tue,  9 Jul 2013 15:20:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69FKkgd037608;
 Tue, 9 Jul 2013 15:20:46 GMT (envelope-from ae@svn.freebsd.org)
Received: (from ae@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69FKkBS037607;
 Tue, 9 Jul 2013 15:20:46 GMT (envelope-from ae@svn.freebsd.org)
Message-Id: <201307091520.r69FKkBS037607@svn.freebsd.org>
From: "Andrey V. Elsukov" 
Date: Tue, 9 Jul 2013 15:20:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253101 - head/sys/netinet6
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 15:20:47 -0000

Author: ae
Date: Tue Jul  9 15:20:46 2013
New Revision: 253101
URL: http://svnweb.freebsd.org/changeset/base/253101

Log:
  Correct the size of allocated memory to store array of counters.

Modified:
  head/sys/netinet6/in6.c

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c	Tue Jul  9 15:10:27 2013	(r253100)
+++ head/sys/netinet6/in6.c	Tue Jul  9 15:20:46 2013	(r253101)
@@ -2749,12 +2749,13 @@ in6_domifattach(struct ifnet *ifp)
 	ext = (struct in6_ifextra *)malloc(sizeof(*ext), M_IFADDR, M_WAITOK);
 	bzero(ext, sizeof(*ext));
 
-	ext->in6_ifstat = malloc(sizeof(struct in6_ifstat), M_IFADDR,
-	    M_WAITOK);
+	ext->in6_ifstat = malloc(sizeof(counter_u64_t) *
+	    sizeof(struct in6_ifstat) / sizeof(uint64_t), M_IFADDR, M_WAITOK);
 	COUNTER_ARRAY_ALLOC(ext->in6_ifstat,
 	    sizeof(struct in6_ifstat) / sizeof(uint64_t), M_WAITOK);
 
-	ext->icmp6_ifstat = malloc(sizeof(struct icmp6_ifstat), M_IFADDR,
+	ext->icmp6_ifstat = malloc(sizeof(counter_u64_t) *
+	    sizeof(struct icmp6_ifstat) / sizeof(uint64_t), M_IFADDR,
 	    M_WAITOK);
 	COUNTER_ARRAY_ALLOC(ext->icmp6_ifstat,
 	    sizeof(struct icmp6_ifstat) / sizeof(uint64_t), M_WAITOK);

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 16:12:28 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id E4AAB80E;
 Tue,  9 Jul 2013 16:12:28 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 by mx1.freebsd.org (Postfix) with ESMTP id B94971AA7;
 Tue,  9 Jul 2013 16:12:28 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7C2ABB948;
 Tue,  9 Jul 2013 12:12:27 -0400 (EDT)
From: John Baldwin 
To: Garrett Cooper 
Subject: Re: svn commit: r253048 - in head/sys/ofed: drivers/net/mlx4
 include/linux
Date: Tue, 9 Jul 2013 11:20:21 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; )
References: <201307082125.r68LPDlY023493@svn.freebsd.org>
 <3FF894D3-ACDF-4796-A682-F9F9DD8C943D@gmail.com>
In-Reply-To: <3FF894D3-ACDF-4796-A682-F9F9DD8C943D@gmail.com>
MIME-Version: 1.0
Message-Id: <201307091120.22114.jhb@freebsd.org>
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Tue, 09 Jul 2013 12:12:27 -0400 (EDT)
Cc: svn-src-head ,
 svn-src-all ,
 src-committers , shahark@mellanox.com
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 16:12:29 -0000

On Monday, July 08, 2013 6:13:22 pm Garrett Cooper wrote:
> On Jul 8, 2013, at 2:25 PM, John Baldwin wrote:
> 
> > Author: jhb
> > Date: Mon Jul  8 21:25:12 2013
> > New Revision: 253048
> > URL: http://svnweb.freebsd.org/changeset/base/253048
> > 
> > Log:
> >  Allow mlx4 devices to switch from Ethernet to Infiniband (and vice 
versa):
> >  - Fix sysctl wrapper for sysfs attributes to properly handle new string
> >    values similar to sysctl_handle_string() (only copyin the user's
> >    supplied length and nul-terminate the string).
> >  - Don't check for a trailing newline when evaluating the desired 
operating
> >    mode of a mlx4 device.
> > 
> >  PR:		kern/179999
> >  Submitted by:	Shahar Klein 
> >  MFC after:	1 week
> 
> Was there an issue with the patch I submitted via 
http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/174213 (basically solving the 
same problem, but only with the sysfs <-> sysctl(9) handler)? I was of the 
impression that sysfs on Linux always added on trailing newlines (but I could 
be wrong because I haven't used Linux at a dev level for ages). Thanks!

I hadn't seen it.  I had wondered if the '\n' issue was a generic sysfs thing.
It sounds like it is and I'd be happy to revert the mlx4 change and alter the
sysfs bits to manage the newline directly if that is more appropriate.  I'd
also like this to use sysctl_handle_string() if at all possible.  Are you in
a position to test patches still?

If so, maybe give this a whirl.  It's similar to yours except it uses
sysctl_handle_string() and strlcat() rather than continuing to do things
by hand.  It also outputs an empty string to userland if the attribute
doesn't have a show method (your version would never pass out an old
string in that case unlike the original code).

Index: drivers/net/mlx4/main.c
===================================================================
--- drivers/net/mlx4/main.c	(revision 253096)
+++ drivers/net/mlx4/main.c	(working copy)
@@ -479,11 +479,11 @@
 	int i;
 	int err = 0;
 
-	if (!strcmp(buf, "ib"))
+	if (!strcmp(buf, "ib\n"))
 		info->tmp_type = MLX4_PORT_TYPE_IB;
-	else if (!strcmp(buf, "eth"))
+	else if (!strcmp(buf, "eth\n"))
 		info->tmp_type = MLX4_PORT_TYPE_ETH;
-	else if (!strcmp(buf, "auto"))
+	else if (!strcmp(buf, "auto\n"))
 		info->tmp_type = MLX4_PORT_TYPE_AUTO;
 	else {
 		mlx4_err(mdev, "%s is not supported port type\n", buf);
Index: include/linux/sysfs.h
===================================================================
--- include/linux/sysfs.h	(revision 253096)
+++ include/linux/sysfs.h	(working copy)
@@ -81,37 +81,35 @@
 
 	kobj = arg1;
 	attr = (struct attribute *)arg2;
-	buf = (void *)get_zeroed_page(GFP_KERNEL);
-	len = 1;	/* Copy out a NULL byte at least. */
 	if (kobj->ktype == NULL || kobj->ktype->sysfs_ops == NULL)
 		return (ENODEV);
-	ops = kobj->ktype->sysfs_ops;
+	buf = (void *)get_zeroed_page(GFP_KERNEL);
 	if (buf == NULL)
 		return (ENOMEM);
+	ops = kobj->ktype->sysfs_ops;
 	if (ops->show) {
 		len = ops->show(kobj, attr, buf);
 		/*
-		 * It's valid not to have a 'show' so we just return 1 byte
-		 * of NULL.
+		 * It's valid to not have a 'show' so just return an
+		 * empty string.
 	 	 */
 		if (len < 0) {
 			error = -len;
-			len = 1;
 			if (error != EIO)
 				goto out;
 		}
+
+		/* Trim trailing newline. */
+		len--;
+		buf[len] = '\0';
 	}
-	error = SYSCTL_OUT(req, buf, len);
-	if (error || !req->newptr || ops->store == NULL)
+
+	/* Leave one trailing byte to append a newline. */
+	error = sysctl_handle_string(oidp, buf, PAGE_SIZE - 1, req);
+	if (error != 0 || req->newptr == NULL || ops->store == NULL)
 		goto out;
-	len = req->newlen - req->newidx;
-	if (len >= PAGE_SIZE)
-		error = EINVAL;
-	else 
-		error = SYSCTL_IN(req, buf, len);
-	if (error)
-		goto out;
-	((char *)buf)[len] = '\0';
+	len = strlcat(buf, "\n", PAGE_SIZE);
+	KASSERT(len < PAGE_SIZE, ("new attribute truncated"));
 	len = ops->store(kobj, attr, buf, len);
 	if (len < 0)
 		error = -len;

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 18:16:00 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 4F35360D;
 Tue,  9 Jul 2013 18:16:00 +0000 (UTC)
 (envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 4284611C8;
 Tue,  9 Jul 2013 18:16:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69IG0WH088420;
 Tue, 9 Jul 2013 18:16:00 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69IFxam088417;
 Tue, 9 Jul 2013 18:15:59 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201307091815.r69IFxam088417@svn.freebsd.org>
From: Jung-uk Kim 
Date: Tue, 9 Jul 2013 18:15:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253102 - head/sys/dev/ixgb
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 18:16:00 -0000

Author: jkim
Date: Tue Jul  9 18:15:59 2013
New Revision: 253102
URL: http://svnweb.freebsd.org/changeset/base/253102

Log:
  Remove redundant definitions to appease tinderbox.

Modified:
  head/sys/dev/ixgb/if_ixgb.c
  head/sys/dev/ixgb/ixgb_ids.h

Modified: head/sys/dev/ixgb/if_ixgb.c
==============================================================================
--- head/sys/dev/ixgb/if_ixgb.c	Tue Jul  9 15:20:46 2013	(r253101)
+++ head/sys/dev/ixgb/if_ixgb.c	Tue Jul  9 18:15:59 2013	(r253102)
@@ -72,8 +72,8 @@ char            ixgb_copyright[] = "Copy
 static ixgb_vendor_info_t ixgb_vendor_info_array[] =
 {
 	/* Intel(R) PRO/10000 Network Connection */
-	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX, PCI_ANY_ID, PCI_ANY_ID, 0},
-	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_SR, PCI_ANY_ID, PCI_ANY_ID, 0},
+	{IXGB_VENDOR_ID, IXGB_DEVICE_ID_82597EX, PCI_ANY_ID, PCI_ANY_ID, 0},
+	{IXGB_VENDOR_ID, IXGB_DEVICE_ID_82597EX_SR, PCI_ANY_ID, PCI_ANY_ID, 0},
 	/* required last entry */
 	{0, 0, 0, 0, 0}
 };

Modified: head/sys/dev/ixgb/ixgb_ids.h
==============================================================================
--- head/sys/dev/ixgb/ixgb_ids.h	Tue Jul  9 15:20:46 2013	(r253101)
+++ head/sys/dev/ixgb/ixgb_ids.h	Tue Jul  9 18:15:59 2013	(r253102)
@@ -37,13 +37,9 @@
 #define _IXGB_IDS_H_
 
 /**********************************************************************
-** The Device and Vendor IDs for 10 Gigabit MACs
+** The Device IDs for 10 Gigabit MACs
 **********************************************************************/
 
-#define INTEL_VENDOR_ID         0x8086
-#define INTEL_SUBVENDOR_ID      0x8086
-
-
 #define IXGB_DEVICE_ID_82597EX      0x1048   /* Cibolo A1, -LR (1310nm) */
 #define IXGB_DEVICE_ID_82597EX_SR   0x1A48   /* Cibolo B0, -SR (850nm)  */
 

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 18:48:44 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 4695EFC8;
 Tue,  9 Jul 2013 18:48:44 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 by mx1.freebsd.org (Postfix) with ESMTP id 2060E1339;
 Tue,  9 Jul 2013 18:48:44 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 02110B977;
 Tue,  9 Jul 2013 14:48:43 -0400 (EDT)
From: John Baldwin 
To: Garrett Cooper 
Subject: Re: svn commit: r253002 - head
Date: Tue, 9 Jul 2013 14:10:34 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; )
References: <201307072039.r67KdCdR028908@svn.freebsd.org>
 <201307081713.51892.jhb@freebsd.org>
 
In-Reply-To: 
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201307091410.35120.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Tue, 09 Jul 2013 14:48:43 -0400 (EDT)
Cc: "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 Alfred Perlstein ,
 "src-committers@freebsd.org" 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 18:48:44 -0000

On Monday, July 08, 2013 7:24:04 pm Garrett Cooper wrote:
> On Mon, Jul 8, 2013 at 2:13 PM, John Baldwin  wrote:
> > On Monday, July 08, 2013 2:23:31 am Garrett Cooper wrote:
> >> On Sun, Jul 7, 2013 at 7:25 PM, Garrett Cooper 
> > wrote:
> >> > On Jul 7, 2013, at 2:15 PM, Alfred Perlstein  wrote:
> >> >
> >> >> On 7/7/13 2:01 PM, Garrett Cooper wrote:
> >> >>> Why the magic number 12?
> >> >>
> >> >> Numbers higher seem to result in worse performance as reported by some
> > members of my team.
> >> >
> >> > The suggestion is good in spirit, but this doesn't justify the reasoning
> > for this recommendation for all cases.
> >> >
> >> > Please revert this change and add a doc page or notes to the dev handbook
> > discussing what the empirical process and results were for determining this
> > value so people can come up with their own values that work best with their
> > hardware and software config. This recommendation is prone to bitrot like some
> > of the recommendations in tuning(7).
> >> >
> >> > Misinformation is sometimes more harmful than no information.
> >>
> >> I spoke with Alfred over the phone and did some more careful thought
> >> about this and I'm rescinding this request.
> >>
> >> Alfred did a good job at documenting how JFLAG works (it was
> >> previously undocumented). My concern over -j12 was performance
> >> related, and after giving things more careful thought it actually
> >> makes sense why -j12 was chosen because Westmere and newer processors
> >> have issues with NUMA and cache locality between multiple processor
> >> packages as we've seen non-empirically and empirically at Isilon with
> >> FreeBSD 7 and 10 (it's a known issue that jeffr@ and jhb@ are aware
> >> of).
> >>
> >> I'll come up with a concise patch that does what Alfred was trying to
> >> achieve and have Alfred review it.
> >>
> >> Thanks (and thank you Alfred for the contribution!!!)!
> >
> > Westmere is fine, it's post-Westmere that is more troublesome.
> 
> Even the 6-core Westmeres (I'm being completely dumb here as you and
> Jeff know a lot more about the NUMA issue than I do as I just caught
> the tail end of the conversation at BSDCan)?

Yes.  NUMA can matter some on Nehalem and Westmere, but for workloads
that involve I/O, the SB/IB generation where the I/O hub moves onto
the processor itself is much more finicky.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 19:01:39 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 54F0B4DF;
 Tue,  9 Jul 2013 19:01:39 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 36CEE144A;
 Tue,  9 Jul 2013 19:01:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69J1dm1003481;
 Tue, 9 Jul 2013 19:01:39 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69J1duA003480;
 Tue, 9 Jul 2013 19:01:39 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201307091901.r69J1duA003480@svn.freebsd.org>
From: Warner Losh 
Date: Tue, 9 Jul 2013 19:01:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253103 - head/sys/mips/include
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 19:01:39 -0000

Author: imp
Date: Tue Jul  9 19:01:38 2013
New Revision: 253103
URL: http://svnweb.freebsd.org/changeset/base/253103

Log:
  Nearly a complete rewrite of elf.h.
  
  Start with NetBSD's sys/arch/mips/include/elf_machdep.h 1.18. Remove the NetBSD
  specific glue pieces (leaving mostly just relocation types).
  
  Add in FreeBSD specific glue pieces from older versions of this file, and
  move to the top of the file:
  r237430 | kib | 2012-06-22 00:38:31 -0600 (Fri, 22 Jun 2012) | 5 lines
  r232449 | jmallett | 2012-03-03 01:19:18 -0700 (Sat, 03 Mar 2012) | 18 lines
  r217097 | kib | 2011-01-07 07:22:34 -0700 (Fri, 07 Jan 2011) | 3 lines
  r211412 | kib | 2010-08-17 02:55:45 -0600 (Tue, 17 Aug 2010) | 7 lines
  r202908 | gonzo | 2010-01-23 19:59:22 -0700 (Sat, 23 Jan 2010) | 4 lines
  r195356 | imp | 2009-07-05 01:00:51 -0600 (Sun, 05 Jul 2009) | 6 lines
  r195128 | gonzo | 2009-06-27 17:27:41 -0600 (Sat, 27 Jun 2009) | 4 lines
  r197933 | kib | 2009-10-10 09:31:24 -0600 (Sat, 10 Oct 2009) | 9 lines
  r189926 | kib | 2009-03-17 06:50:16 -0600 (Tue, 17 Mar 2009) | 9 lines
  r186191 | imp | 2008-12-16 13:07:47 -0700 (Tue, 16 Dec 2008) | 7 lines
  as closely as I can tell, the projects/mips branch merge was disruptive
  to good history.
  
  This should make merges easier in the future from NetBSD and vice versa.

Modified:
  head/sys/mips/include/elf.h

Modified: head/sys/mips/include/elf.h
==============================================================================
--- head/sys/mips/include/elf.h	Tue Jul  9 18:15:59 2013	(r253102)
+++ head/sys/mips/include/elf.h	Tue Jul  9 19:01:38 2013	(r253103)
@@ -1,7 +1,5 @@
-/*	$OpenBSD: elf_abi.h,v 1.1 1998/01/28 11:14:41 pefo Exp $ */
-
-/*-
- * Copyright (c) 1996 Per Fogelstrom
+/*
+ * Copyright (c) 2013 M. Warner Losh. All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -11,18 +9,12 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed under OpenBSD by
- *	Per Fogelstrom.
- * 4. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * 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
@@ -30,190 +22,60 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *	JNPR: elf.h,v 1.4 2006/12/02 09:53:40 katta
  * $FreeBSD$
+ */
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ *
+ * See below starting with the line with $NetBSD...$ for code this applies to.
  */
 
-#ifndef _MACHINE_ELF_H_
-#define	_MACHINE_ELF_H_
+#ifndef	__MIPS_ELF_H
+#define	__MIPS_ELF_H
 
-/* Information taken from MIPS ABI supplemental */
+/* FreeBSD specific bits - derived from FreeBSD specific files and changes to old elf.h */
 
+/*
+ * Define __ELF_WORD_SIZE based on the ABI, if not defined yet. This sets
+ * the proper defaults when we're not trying to do 32-bit on 64-bit systems.
+ * We include both 32 and 64 bit versions so we can support multiple ABIs.
+ */
 #ifndef __ELF_WORD_SIZE
 #if defined(__mips_n64)
-#define	__ELF_WORD_SIZE 64	/* Used by  */
+#define __ELF_WORD_SIZE 64
 #else
-#define	__ELF_WORD_SIZE 32	/* Used by  */
+#define __ELF_WORD_SIZE 32
 #endif
 #endif
-#include 	/* Definitions common to all 32 bit architectures. */
-#include 	/* Definitions common to all 64 bit architectures. */
+#include 
+#include 
 #include 
 
-#define	ELF_ARCH	EM_MIPS
-#if __ELF_WORD_SIZE == 32
-#define	ELF_ARCH32	EM_MIPS
-#endif
-#define	ELF_MACHINE_OK(x) ((x) == EM_MIPS || (x) == EM_MIPS_RS4_BE)
-
-/* Architecture dependent Segment types - p_type */
-#define	PT_MIPS_REGINFO		0x70000000 /* Register usage information */
-
-/* Architecture dependent d_tag field for Elf32_Dyn.  */
-#define	DT_MIPS_RLD_VERSION	0x70000001 /* Runtime Linker Interface ID */
-#define	DT_MIPS_TIME_STAMP	0x70000002 /* Timestamp */
-#define	DT_MIPS_ICHECKSUM	0x70000003 /* Cksum of ext str and com sizes */
-#define	DT_MIPS_IVERSION	0x70000004 /* Version string (string tbl index) */
-#define	DT_MIPS_FLAGS		0x70000005 /* Flags */
-#define	DT_MIPS_BASE_ADDRESS	0x70000006 /* Segment base address */
-#define	DT_MIPS_CONFLICT	0x70000008 /* Adr of .conflict section */
-#define	DT_MIPS_LIBLIST		0x70000009 /* Address of .liblist section */
-#define	DT_MIPS_LOCAL_GOTNO	0x7000000a /* Number of local .GOT entries */
-#define	DT_MIPS_CONFLICTNO	0x7000000b /* Number of .conflict entries */
-#define	DT_MIPS_LIBLISTNO	0x70000010 /* Number of .liblist entries */
-#define	DT_MIPS_SYMTABNO	0x70000011 /* Number of .dynsym entries */
-#define	DT_MIPS_UNREFEXTNO	0x70000012 /* First external DYNSYM */
-#define	DT_MIPS_GOTSYM		0x70000013 /* First GOT entry in .dynsym */
-#define	DT_MIPS_HIPAGENO	0x70000014 /* Number of GOT page table entries */
-#define	DT_MIPS_RLD_MAP		0x70000016 /* Address of debug map pointer */
-
-#define	DT_PROCNUM (DT_MIPS_RLD_MAP - DT_LOPROC + 1)
-
-/*
- * Legal values for e_flags field of Elf32_Ehdr.
- */
-#define	EF_MIPS_NOREORDER	1		/* .noreorder was used */
-#define	EF_MIPS_PIC		2		/* Contains PIC code */
-#define	EF_MIPS_CPIC		4		/* Uses PIC calling sequence */
-#define	EF_MIPS_ARCH		0xf0000000	/* MIPS architecture level */
-
-/*
- * Mips special sections.
- */
-#define	SHN_MIPS_ACOMMON	0xff00		/* Allocated common symbols */
-#define	SHN_MIPS_SCOMMON	0xff03		/* Small common symbols */
-#define	SHN_MIPS_SUNDEFINED	0xff04		/* Small undefined symbols */
-
-/*
- * Legal values for sh_type field of Elf32_Shdr.
- */
-#define	SHT_MIPS_LIBLIST	0x70000000 /* Shared objects used in link */
-#define	SHT_MIPS_CONFLICT	0x70000002 /* Conflicting symbols */
-#define	SHT_MIPS_GPTAB		0x70000003 /* Global data area sizes */
-#define	SHT_MIPS_UCODE		0x70000004 /* Reserved for SGI/MIPS compilers */
-#define	SHT_MIPS_DEBUG		0x70000005 /* MIPS ECOFF debugging information */
-#define	SHT_MIPS_REGINFO	0x70000006 /* Register usage information */
-
-/*
- * Legal values for sh_flags field of Elf32_Shdr.
- */
-#define	SHF_MIPS_GPREL		0x10000000 /* Must be part of global data area */
-
-/*
- * Entries found in sections of type SHT_MIPS_GPTAB.
- */
-typedef union {
-	struct {
-		Elf32_Word gt_current_g_value;	/* -G val used in compilation */
-		Elf32_Word gt_unused;	/* Not used */
-	} gt_header;			/* First entry in section */
-	struct {
-		Elf32_Word gt_g_value;	/* If this val were used for -G */
-		Elf32_Word gt_bytes;	/* This many bytes would be used */
-	} gt_entry;			/* Subsequent entries in section */
-} Elf32_gptab;
-typedef union {
-	struct {
-		Elf64_Word gt_current_g_value;	/* -G val used in compilation */
-		Elf64_Word gt_unused;	/* Not used */
-	} gt_header;			/* First entry in section */
-	struct {
-		Elf64_Word gt_g_value;	/* If this val were used for -G */
-		Elf64_Word gt_bytes;	/* This many bytes would be used */
-	} gt_entry;			/* Subsequent entries in section */
-} Elf64_gptab;
-
-/*
- * Entry found in sections of type SHT_MIPS_REGINFO.
- */
-typedef struct {
-	Elf32_Word	ri_gprmask;	/* General registers used */
-	Elf32_Word	ri_cprmask[4];	/* Coprocessor registers used */
-	Elf32_Sword	ri_gp_value;	/* $gp register value */
-} Elf32_RegInfo;
-typedef struct {
-	Elf64_Word	ri_gprmask;	/* General registers used */
-	Elf64_Word	ri_cprmask[4];	/* Coprocessor registers used */
-	Elf64_Sword	ri_gp_value;	/* $gp register value */
-} Elf64_RegInfo;
-
-
-/*
- * Mips relocations.
- */
-
-#define	R_MIPS_NONE	0	/* No reloc */
-#define	R_MIPS_16	1	/* Direct 16 bit */
-#define	R_MIPS_32	2	/* Direct 32 bit */
-#define	R_MIPS_REL32	3	/* PC relative 32 bit */
-#define	R_MIPS_26	4	/* Direct 26 bit shifted */
-#define	R_MIPS_HI16	5	/* High 16 bit */
-#define	R_MIPS_LO16	6	/* Low 16 bit */
-#define	R_MIPS_GPREL16	7	/* GP relative 16 bit */
-#define	R_MIPS_LITERAL	8	/* 16 bit literal entry */
-#define	R_MIPS_GOT16	9	/* 16 bit GOT entry */
-#define	R_MIPS_PC16	10	/* PC relative 16 bit */
-#define	R_MIPS_CALL16	11	/* 16 bit GOT entry for function */
-#define	R_MIPS_GPREL32	12	/* GP relative 32 bit */
-#define	R_MIPS_GOTHI16	21	/* GOT HI 16 bit */
-#define	R_MIPS_GOTLO16	22	/* GOT LO 16 bit */
-#define	R_MIPS_CALLHI16 30	/* upper 16 bit GOT entry for function */
-#define	R_MIPS_CALLLO16 31	/* lower 16 bit GOT entry for function */
-
-/*
- * These are from the 64-bit Irix ELF ABI
- */
-#define	R_MIPS_SHIFT5	16
-#define	R_MIPS_SHIFT6	17
-#define	R_MIPS_64	18
-#define	R_MIPS_GOT_DISP	19
-#define	R_MIPS_GOT_PAGE	20
-#define	R_MIPS_GOT_OFST	21
-#define	R_MIPS_GOT_HI16	22
-#define	R_MIPS_GOT_LO16	23
-#define	R_MIPS_SUB	24
-#define	R_MIPS_INSERT_A	25
-#define	R_MIPS_INSERT_B	26
-#define	R_MIPS_DELETE	27
-#define	R_MIPS_HIGHER	28
-#define	R_MIPS_HIGHEST	29
-#define	R_MIPS_SCN_DISP	32
-#define	R_MIPS_REL16	33
-#define	R_MIPS_ADD_IMMEDIATE 34
-#define	R_MIPS_PJUMP	35
-#define	R_MIPS_RELGOT	36
-#define	R_MIPS_JALR	37
-
-/* 
- * TLS relocations 
- */
-#define	R_MIPS_TLS_DTPMOD32	38	/* Module number 32 bit */
-#define	R_MIPS_TLS_DTPREL32	39	/* Module-relative offset 32 bit */
-#define	R_MIPS_TLS_DTPMOD64	40	/* Module number 64 bit */
-#define	R_MIPS_TLS_DTPREL64	41	/* Module-relative offset 64 bit */
-#define	R_MIPS_TLS_GD		42	/* 16 bit GOT offset for GD */
-#define	R_MIPS_TLS_LDM		43	/* 16 bit GOT offset for LDM */
-#define	R_MIPS_TLS_DTPREL_HI16	44	/* Module-relative offset, high 16 bits */
-#define	R_MIPS_TLS_DTPREL_LO16	45	/* Module-relative offset, low 16 bits */
-#define	R_MIPS_TLS_GOTTPREL	46	/* 16 bit GOT offset for IE */
-#define	R_MIPS_TLS_TPREL32	47	/* TP-relative offset, 32 bit */
-#define	R_MIPS_TLS_TPREL64	48	/* TP-relative offset, 64 bit */
-#define	R_MIPS_TLS_TPREL_HI16	49	/* TP-relative offset, high 16 bits */
-#define	R_MIPS_TLS_TPREL_LO16	50	/* TP-relative offset, low 16 bits */
-
-#define	R_MIPS_max	51
-#define	R_TYPE(name)		__CONCAT(R_MIPS_,name)
+#define ELF_ARCH	EM_MIPS
+#define ELF_ARCH32	EM_MIPS
 
 /* Define "machine" characteristics */
 #if __ELF_WORD_SIZE == 32
@@ -290,4 +152,137 @@ __ElfType(Auxinfo);
  */
 #define	SYMTAB_MAGIC	0x64656267
 
-#endif /* !_MACHINE_ELF_H_ */
+/* from NetBSD's sys/mips/include/elf_machdep.h $NetBSD: elf_machdep.h,v 1.18 2013/05/23 21:39:49 christos Exp $ */
+
+/* mips relocs. */
+
+#define	R_MIPS_NONE		0
+#define	R_MIPS_16		1
+#define	R_MIPS_32		2
+#define	R_MIPS_REL32		3
+#define	R_MIPS_REL		R_MIPS_REL32
+#define	R_MIPS_26		4
+#define	R_MIPS_HI16		5	/* high 16 bits of symbol value */
+#define	R_MIPS_LO16		6	/* low 16 bits of symbol value */
+#define	R_MIPS_GPREL16		7	/* GP-relative reference  */
+#define	R_MIPS_LITERAL		8	/* Reference to literal section  */
+#define	R_MIPS_GOT16		9	/* Reference to global offset table */
+#define	R_MIPS_GOT		R_MIPS_GOT16
+#define	R_MIPS_PC16		10	/* 16 bit PC relative reference */
+#define	R_MIPS_CALL16 		11	/* 16 bit call thru glbl offset tbl */
+#define	R_MIPS_CALL		R_MIPS_CALL16
+#define	R_MIPS_GPREL32		12
+
+/* 13, 14, 15 are not defined at this point. */
+#define	R_MIPS_UNUSED1		13
+#define	R_MIPS_UNUSED2		14
+#define	R_MIPS_UNUSED3		15
+
+/*
+ * The remaining relocs are apparently part of the 64-bit Irix ELF ABI.
+ */
+#define	R_MIPS_SHIFT5		16
+#define	R_MIPS_SHIFT6		17
+
+#define	R_MIPS_64		18
+#define	R_MIPS_GOT_DISP		19
+#define	R_MIPS_GOT_PAGE		20
+#define	R_MIPS_GOT_OFST		21
+#define	R_MIPS_GOT_HI16		22
+#define	R_MIPS_GOT_LO16		23
+#define	R_MIPS_SUB		24
+#define	R_MIPS_INSERT_A		25
+#define	R_MIPS_INSERT_B		26
+#define	R_MIPS_DELETE		27
+#define	R_MIPS_HIGHER		28
+#define	R_MIPS_HIGHEST		29
+#define	R_MIPS_CALL_HI16	30
+#define	R_MIPS_CALL_LO16	31
+#define	R_MIPS_SCN_DISP		32
+#define	R_MIPS_REL16		33
+#define	R_MIPS_ADD_IMMEDIATE	34
+#define	R_MIPS_PJUMP		35
+#define	R_MIPS_RELGOT		36
+#define	R_MIPS_JALR		37
+/* TLS relocations */
+
+#define	R_MIPS_TLS_DTPMOD32	38	/* Module number 32 bit */
+#define	R_MIPS_TLS_DTPREL32	39	/* Module-relative offset 32 bit */
+#define	R_MIPS_TLS_DTPMOD64	40	/* Module number 64 bit */
+#define	R_MIPS_TLS_DTPREL64	41	/* Module-relative offset 64 bit */
+#define	R_MIPS_TLS_GD		42	/* 16 bit GOT offset for GD */
+#define	R_MIPS_TLS_LDM		43	/* 16 bit GOT offset for LDM */
+#define	R_MIPS_TLS_DTPREL_HI16	44	/* Module-relative offset, high 16 bits */
+#define	R_MIPS_TLS_DTPREL_LO16	45	/* Module-relative offset, low 16 bits */
+#define	R_MIPS_TLS_GOTTPREL	46	/* 16 bit GOT offset for IE */
+#define	R_MIPS_TLS_TPREL32	47	/* TP-relative offset, 32 bit */
+#define	R_MIPS_TLS_TPREL64	48	/* TP-relative offset, 64 bit */
+#define	R_MIPS_TLS_TPREL_HI16	49	/* TP-relative offset, high 16 bits */
+#define	R_MIPS_TLS_TPREL_LO16	50	/* TP-relative offset, low 16 bits */
+
+#define	R_MIPS_max		51
+
+#define	R_TYPE(name)		__CONCAT(R_MIPS_,name)
+
+#define	R_MIPS16_min		100
+#define	R_MIPS16_26		100
+#define	R_MIPS16_GPREL		101
+#define	R_MIPS16_GOT16		102
+#define	R_MIPS16_CALL16		103
+#define	R_MIPS16_HI16		104
+#define	R_MIPS16_LO16		105
+#define	R_MIPS16_max		106
+
+#define	R_MIPS_COPY		126
+#define	R_MIPS_JUMP_SLOT	127
+
+/* mips dynamic tags */
+
+#define	DT_MIPS_RLD_VERSION	0x70000001
+#define	DT_MIPS_TIME_STAMP	0x70000002
+#define	DT_MIPS_ICHECKSUM	0x70000003
+#define	DT_MIPS_IVERSION	0x70000004
+#define	DT_MIPS_FLAGS		0x70000005
+#define	DT_MIPS_BASE_ADDRESS	0x70000006
+#define	DT_MIPS_CONFLICT	0x70000008
+#define	DT_MIPS_LIBLIST		0x70000009
+#define	DT_MIPS_CONFLICTNO	0x7000000b
+#define	DT_MIPS_LOCAL_GOTNO	0x7000000a	/* number of local got ents */
+#define	DT_MIPS_LIBLISTNO	0x70000010
+#define	DT_MIPS_SYMTABNO	0x70000011	/* number of .dynsym entries */
+#define	DT_MIPS_UNREFEXTNO	0x70000012
+#define	DT_MIPS_GOTSYM		0x70000013	/* first dynamic sym in got */
+#define	DT_MIPS_HIPAGENO	0x70000014
+#define	DT_MIPS_RLD_MAP		0x70000016	/* address of loader map */
+#define	DT_MIPS_PLTGOT		0x70000032
+#define	DT_MIPS_RWPLT		0x70000034
+
+/*
+ * ELF Flags
+ */
+#define	EF_MIPS_PIC		0x00000002	/* Contains PIC code */
+#define	EF_MIPS_CPIC		0x00000004	/* STD PIC calling sequence */
+#define	EF_MIPS_ABI2		0x00000020	/* N32 */
+
+#define	EF_MIPS_ARCH_ASE	0x0f000000	/* Architectural extensions */
+#define	EF_MIPS_ARCH_MDMX	0x08000000	/* MDMX multimedia extension */
+#define	EF_MIPS_ARCH_M16	0x04000000	/* MIPS-16 ISA extensions */
+
+#define	EF_MIPS_ARCH		0xf0000000	/* Architecture field */
+#define	EF_MIPS_ARCH_1		0x00000000	/* -mips1 code */
+#define	EF_MIPS_ARCH_2		0x10000000	/* -mips2 code */
+#define	EF_MIPS_ARCH_3		0x20000000	/* -mips3 code */
+#define	EF_MIPS_ARCH_4		0x30000000	/* -mips4 code */
+#define	EF_MIPS_ARCH_5		0x40000000	/* -mips5 code */
+#define	EF_MIPS_ARCH_32		0x50000000	/* -mips32 code */
+#define	EF_MIPS_ARCH_64		0x60000000	/* -mips64 code */
+#define	EF_MIPS_ARCH_32R2	0x70000000	/* -mips32r2 code */
+#define	EF_MIPS_ARCH_64R2	0x80000000	/* -mips64r2 code */
+
+#define	EF_MIPS_ABI		0x0000f000
+#define	EF_MIPS_ABI_O32		0x00001000
+#define	EF_MIPS_ABI_O64		0x00002000
+#define	EF_MIPS_ABI_EABI32	0x00003000
+#define	EF_MIPS_ABI_EABI64	0x00004000
+
+#endif /* __MIPS_ELF_H */

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 19:04:20 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 6A770749;
 Tue,  9 Jul 2013 19:04:20 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 5CC1D1480;
 Tue,  9 Jul 2013 19:04:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69J4K3K003992;
 Tue, 9 Jul 2013 19:04:20 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69J4KKP003991;
 Tue, 9 Jul 2013 19:04:20 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201307091904.r69J4KKP003991@svn.freebsd.org>
From: Michael Tuexen 
Date: Tue, 9 Jul 2013 19:04:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253104 - head/lib/libc/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 19:04:20 -0000

Author: tuexen
Date: Tue Jul  9 19:04:19 2013
New Revision: 253104
URL: http://svnweb.freebsd.org/changeset/base/253104

Log:
  Fix a bug where SCTP_ENABLE_STREAM_RESET is not handled by
  sctp_opt_info().
  
  MFC after: 3 days

Modified:
  head/lib/libc/net/sctp_sys_calls.c

Modified: head/lib/libc/net/sctp_sys_calls.c
==============================================================================
--- head/lib/libc/net/sctp_sys_calls.c	Tue Jul  9 19:01:38 2013	(r253103)
+++ head/lib/libc/net/sctp_sys_calls.c	Tue Jul  9 19:04:19 2013	(r253104)
@@ -338,6 +338,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i
 	case SCTP_MAX_BURST:
 		((struct sctp_assoc_value *)arg)->assoc_id = id;
 		break;
+	case SCTP_ENABLE_STREAM_RESET:
+		((struct sctp_assoc_value *)arg)->assoc_id = id;
+		break;
 	default:
 		break;
 	}

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 19:12:47 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 9A027B54;
 Tue,  9 Jul 2013 19:12:47 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8C56E1623;
 Tue,  9 Jul 2013 19:12:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69JClga007083;
 Tue, 9 Jul 2013 19:12:47 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69JCl9r007082;
 Tue, 9 Jul 2013 19:12:47 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201307091912.r69JCl9r007082@svn.freebsd.org>
From: Michael Tuexen 
Date: Tue, 9 Jul 2013 19:12:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253105 - head/lib/libc/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 19:12:47 -0000

Author: tuexen
Date: Tue Jul  9 19:12:47 2013
New Revision: 253105
URL: http://svnweb.freebsd.org/changeset/base/253105

Log:
  Fix the handling of SCTP_CURRENT_ASSOC and SCTP_ALL_ASSOC in
  sctp_opt_info().
  
  MFC after: 3 days

Modified:
  head/lib/libc/net/sctp_sys_calls.c

Modified: head/lib/libc/net/sctp_sys_calls.c
==============================================================================
--- head/lib/libc/net/sctp_sys_calls.c	Tue Jul  9 19:04:19 2013	(r253104)
+++ head/lib/libc/net/sctp_sys_calls.c	Tue Jul  9 19:12:47 2013	(r253105)
@@ -274,6 +274,11 @@ sctp_opt_info(int sd, sctp_assoc_t id, i
 		errno = EINVAL;
 		return (-1);
 	}
+	if ((id == SCTP_CURRENT_ASSOC) ||
+	    (id == SCTP_ALL_ASSOC)) {
+		errno = EINVAL;
+		return (-1);
+	}
 	switch (opt) {
 	case SCTP_RTOINFO:
 		((struct sctp_rtoinfo *)arg)->srto_assoc_id = id;

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 19:36:03 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 2AD55671;
 Tue,  9 Jul 2013 19:36:03 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from tensor.andric.com (tensor.andric.com [87.251.56.140])
 by mx1.freebsd.org (Postfix) with ESMTP id E376517D2;
 Tue,  9 Jul 2013 19:36:02 +0000 (UTC)
Received: from spaceball.andric.com (spaceball.andric.com
 [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by tensor.andric.com (Postfix) with ESMTPSA id 785F85C43;
 Tue,  9 Jul 2013 21:35:53 +0200 (CEST)
Message-ID: <51DC6617.2080500@FreeBSD.org>
Date: Tue, 09 Jul 2013 21:35:51 +0200
From: Dimitry Andric 
Organization: The FreeBSD Project
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
 rv:22.0) Gecko/20100101 Thunderbird/22.0
MIME-Version: 1.0
To: Andriy Gapon , src-committers@freebsd.org, 
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r253072 - head/sys/conf
References: <201307090842.r698g2CU017760@svn.freebsd.org>
In-Reply-To: <201307090842.r698g2CU017760@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 19:36:03 -0000

On 2013-07-09 10:42, Andriy Gapon wrote:
> Author: avg
> Date: Tue Jul  9 08:42:02 2013
> New Revision: 253072
> URL: http://svnweb.freebsd.org/changeset/base/253072
>
> Log:
>    amd64: use -mno-omit-leaf-frame-pointer in addition to -fno-omit-frame-pointer
>
>    ... in kernel builds.  This is to make behavior of clang consistent with
>    behavior of gcc.
>
>    MFC after:	2 weeks

Thanks.  This would be really nice to have in 9.2 too. :-)

-Dimitry


From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 20:49:34 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 12AC3DD2;
 Tue,  9 Jul 2013 20:49:34 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id E87B81BA3;
 Tue,  9 Jul 2013 20:49:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69KnXKd034830;
 Tue, 9 Jul 2013 20:49:33 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69KnWuA034821;
 Tue, 9 Jul 2013 20:49:32 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307092049.r69KnWuA034821@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 9 Jul 2013 20:49:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253106 - in head/sys: geom/journal kern sys ufs/ffs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 20:49:34 -0000

Author: kib
Date: Tue Jul  9 20:49:32 2013
New Revision: 253106
URL: http://svnweb.freebsd.org/changeset/base/253106

Log:
  There are several code sequences like
        vfs_busy(mp);
        vfs_write_suspend(mp);
  which are problematic if other thread starts unmount between two
  calls.  The unmount starts a write, while vfs_write_suspend() drain
  writers.  On the other hand, unmount drains busy references, causing
  the deadlock.
  
  Add a flag argument to vfs_write_suspend and require the callers of it
  to specify VS_SKIP_UNMOUNT flag, when the call is performed not in the
  mount path, i.e. the covered vnode is not locked.  The suspension is
  not attempted if VS_SKIP_UNMOUNT is specified and unmount is in
  progress.
  
  Reported and tested by:	Andreas Longwitz 
  Sponsored by:	The FreeBSD Foundation
  MFC after:	3 weeks

Modified:
  head/sys/geom/journal/g_journal.c
  head/sys/kern/vfs_vnops.c
  head/sys/sys/vnode.h
  head/sys/ufs/ffs/ffs_snapshot.c
  head/sys/ufs/ffs/ffs_suspend.c
  head/sys/ufs/ffs/ffs_vfsops.c

Modified: head/sys/geom/journal/g_journal.c
==============================================================================
--- head/sys/geom/journal/g_journal.c	Tue Jul  9 19:12:47 2013	(r253105)
+++ head/sys/geom/journal/g_journal.c	Tue Jul  9 20:49:32 2013	(r253106)
@@ -2960,7 +2960,7 @@ g_journal_do_switch(struct g_class *clas
 		GJ_TIMER_STOP(1, &bt, "BIO_FLUSH time of %s", sc->sc_name);
 
 		GJ_TIMER_START(1, &bt);
-		error = vfs_write_suspend(mp);
+		error = vfs_write_suspend(mp, VS_SKIP_UNMOUNT);
 		GJ_TIMER_STOP(1, &bt, "Suspend time of %s", mountpoint);
 		if (error != 0) {
 			GJ_DEBUG(0, "Cannot suspend file system %s (error=%d).",

Modified: head/sys/kern/vfs_vnops.c
==============================================================================
--- head/sys/kern/vfs_vnops.c	Tue Jul  9 19:12:47 2013	(r253105)
+++ head/sys/kern/vfs_vnops.c	Tue Jul  9 20:49:32 2013	(r253106)
@@ -1668,8 +1668,7 @@ vn_finished_secondary_write(mp)
  * Request a filesystem to suspend write operations.
  */
 int
-vfs_write_suspend(mp)
-	struct mount *mp;
+vfs_write_suspend(struct mount *mp, int flags)
 {
 	int error;
 
@@ -1680,6 +1679,21 @@ vfs_write_suspend(mp)
 	}
 	while (mp->mnt_kern_flag & MNTK_SUSPEND)
 		msleep(&mp->mnt_flag, MNT_MTX(mp), PUSER - 1, "wsuspfs", 0);
+
+	/*
+	 * Unmount holds a write reference on the mount point.  If we
+	 * own busy reference and drain for writers, we deadlock with
+	 * the reference draining in the unmount path.  Callers of
+	 * vfs_write_suspend() must specify VS_SKIP_UNMOUNT if
+	 * vfs_busy() reference is owned and caller is not in the
+	 * unmount context.
+	 */
+	if ((flags & VS_SKIP_UNMOUNT) != 0 &&
+	    (mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) {
+		MNT_IUNLOCK(mp);
+		return (EBUSY);
+	}
+
 	mp->mnt_kern_flag |= MNTK_SUSPEND;
 	mp->mnt_susp_owner = curthread;
 	if (mp->mnt_writeopcount > 0)

Modified: head/sys/sys/vnode.h
==============================================================================
--- head/sys/sys/vnode.h	Tue Jul  9 19:12:47 2013	(r253105)
+++ head/sys/sys/vnode.h	Tue Jul  9 20:49:32 2013	(r253106)
@@ -398,6 +398,9 @@ extern int		vttoif_tab[];
 #define	VR_START_WRITE	0x0001	/* vfs_write_resume: start write atomically */
 #define	VR_NO_SUSPCLR	0x0002	/* vfs_write_resume: do not clear suspension */
 
+#define	VS_SKIP_UNMOUNT	0x0001	/* vfs_write_suspend: fail if the
+				   filesystem is being unmounted */
+
 #define	VREF(vp)	vref(vp)
 
 #ifdef DIAGNOSTIC
@@ -711,7 +714,7 @@ int	vn_io_fault_pgmove(vm_page_t ma[], v
 int	vfs_cache_lookup(struct vop_lookup_args *ap);
 void	vfs_timestamp(struct timespec *);
 void	vfs_write_resume(struct mount *mp, int flags);
-int	vfs_write_suspend(struct mount *mp);
+int	vfs_write_suspend(struct mount *mp, int flags);
 int	vop_stdbmap(struct vop_bmap_args *);
 int	vop_stdfsync(struct vop_fsync_args *);
 int	vop_stdgetwritemount(struct vop_getwritemount_args *);

Modified: head/sys/ufs/ffs/ffs_snapshot.c
==============================================================================
--- head/sys/ufs/ffs/ffs_snapshot.c	Tue Jul  9 19:12:47 2013	(r253105)
+++ head/sys/ufs/ffs/ffs_snapshot.c	Tue Jul  9 20:49:32 2013	(r253106)
@@ -423,7 +423,7 @@ restart:
 	 */
 	for (;;) {
 		vn_finished_write(wrtmp);
-		if ((error = vfs_write_suspend(vp->v_mount)) != 0) {
+		if ((error = vfs_write_suspend(vp->v_mount, 0)) != 0) {
 			vn_start_write(NULL, &wrtmp, V_WAIT);
 			vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 			goto out;

Modified: head/sys/ufs/ffs/ffs_suspend.c
==============================================================================
--- head/sys/ufs/ffs/ffs_suspend.c	Tue Jul  9 19:12:47 2013	(r253105)
+++ head/sys/ufs/ffs/ffs_suspend.c	Tue Jul  9 20:49:32 2013	(r253106)
@@ -206,7 +206,7 @@ ffs_susp_suspend(struct mount *mp)
 		return (EPERM);
 #endif
 
-	if ((error = vfs_write_suspend(mp)) != 0)
+	if ((error = vfs_write_suspend(mp, VS_SKIP_UNMOUNT)) != 0)
 		return (error);
 
 	ump->um_writesuspended = 1;

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vfsops.c	Tue Jul  9 19:12:47 2013	(r253105)
+++ head/sys/ufs/ffs/ffs_vfsops.c	Tue Jul  9 20:49:32 2013	(r253106)
@@ -257,7 +257,7 @@ ffs_mount(struct mount *mp)
 				return (error);
 			for (;;) {
 				vn_finished_write(mp);
-				if ((error = vfs_write_suspend(mp)) != 0)
+				if ((error = vfs_write_suspend(mp, 0)) != 0)
 					return (error);
 				MNT_ILOCK(mp);
 				if (mp->mnt_kern_flag & MNTK_SUSPENDED) {
@@ -1255,7 +1255,7 @@ ffs_unmount(mp, mntflags)
 		 */
 		for (;;) {
 			vn_finished_write(mp);
-			if ((error = vfs_write_suspend(mp)) != 0)
+			if ((error = vfs_write_suspend(mp, 0)) != 0)
 				return (error);
 			MNT_ILOCK(mp);
 			if (mp->mnt_kern_flag & MNTK_SUSPENDED) {

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 21:02:46 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 1F297425;
 Tue,  9 Jul 2013 21:02:46 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 118F81C50;
 Tue,  9 Jul 2013 21:02:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69L2jqW040628;
 Tue, 9 Jul 2013 21:02:45 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69L2jEu040627;
 Tue, 9 Jul 2013 21:02:45 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307092102.r69L2jEu040627@svn.freebsd.org>
From: Jim Harris 
Date: Tue, 9 Jul 2013 21:02:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253107 - head/sys/dev/nvme
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 21:02:46 -0000

Author: jimharris
Date: Tue Jul  9 21:02:45 2013
New Revision: 253107
URL: http://svnweb.freebsd.org/changeset/base/253107

Log:
  Add pci_enable_busmaster() and pci_disable_busmaster() calls in
  nvme_attach() and nvme_detach() respectively.
  
  Sponsored by:	Intel
  MFC after:	3 days

Modified:
  head/sys/dev/nvme/nvme.c

Modified: head/sys/dev/nvme/nvme.c
==============================================================================
--- head/sys/dev/nvme/nvme.c	Tue Jul  9 20:49:32 2013	(r253106)
+++ head/sys/dev/nvme/nvme.c	Tue Jul  9 21:02:45 2013	(r253107)
@@ -255,6 +255,8 @@ nvme_attach(device_t dev)
 
 	nvme_sysctl_initialize_ctrlr(ctrlr);
 
+	pci_enable_busmaster(dev);
+
 	ctrlr->config_hook.ich_func = nvme_ctrlr_start_config_hook;
 	ctrlr->config_hook.ich_arg = ctrlr;
 
@@ -269,6 +271,7 @@ nvme_detach (device_t dev)
 	struct nvme_controller	*ctrlr = DEVICE2SOFTC(dev);
 
 	nvme_ctrlr_destruct(ctrlr, dev);
+	pci_disable_busmaster(dev);
 	return (0);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 21:03:40 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 57845670;
 Tue,  9 Jul 2013 21:03:40 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 4A3C51C6B;
 Tue,  9 Jul 2013 21:03:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69L3ecr040814;
 Tue, 9 Jul 2013 21:03:40 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69L3emA040813;
 Tue, 9 Jul 2013 21:03:40 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307092103.r69L3emA040813@svn.freebsd.org>
From: Jim Harris 
Date: Tue, 9 Jul 2013 21:03:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253108 - head/sys/dev/nvme
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 21:03:40 -0000

Author: jimharris
Date: Tue Jul  9 21:03:39 2013
New Revision: 253108
URL: http://svnweb.freebsd.org/changeset/base/253108

Log:
  Do not retry failed async event requests.
  
  Sponsored by:	Intel
  MFC after:	3 days

Modified:
  head/sys/dev/nvme/nvme_ctrlr.c

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==============================================================================
--- head/sys/dev/nvme/nvme_ctrlr.c	Tue Jul  9 21:02:45 2013	(r253107)
+++ head/sys/dev/nvme/nvme_ctrlr.c	Tue Jul  9 21:03:39 2013	(r253108)
@@ -649,12 +649,12 @@ nvme_ctrlr_async_event_cb(void *arg, con
 {
 	struct nvme_async_event_request	*aer = arg;
 
-	if (cpl->status.sc == NVME_SC_ABORTED_SQ_DELETION) {
+	if (nvme_completion_is_error(cpl)) {
 		/*
-		 *  This is simulated when controller is being shut down, to
-		 *  effectively abort outstanding asynchronous event requests
-		 *  and make sure all memory is freed.  Do not repost the
-		 *  request in this case.
+		 *  Do not retry failed async event requests.  This avoids
+		 *  infinite loops where a new async event request is submitted
+		 *  to replace the one just failed, only to fail again and
+		 *  perpetuate the loop.
 		 */
 		return;
 	}

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 21:14:17 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 6A08FDF3;
 Tue,  9 Jul 2013 21:14:17 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 4AD161D04;
 Tue,  9 Jul 2013 21:14:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69LEHSP044456;
 Tue, 9 Jul 2013 21:14:17 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69LEGhr044445;
 Tue, 9 Jul 2013 21:14:16 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307092114.r69LEGhr044445@svn.freebsd.org>
From: Jim Harris 
Date: Tue, 9 Jul 2013 21:14:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253109 - head/sbin/nvmecontrol
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 21:14:17 -0000

Author: jimharris
Date: Tue Jul  9 21:14:15 2013
New Revision: 253109
URL: http://svnweb.freebsd.org/changeset/base/253109

Log:
  Incorporate feedback from bde@ based on r252672 changes:
  
  * Use 0/1 instead of sysexits.  Man pages are confusing on this topic,
    but 0/1 is sufficient for nvmecontrol.
  * Use err function family where possible instead of fprintf/exit.
  * Fix some typing errors.
  * Clean up some error message inconsistencies.
  
  Sponsored by:	Intel
  Submitted by:	bde (parts of firmware.c changes)
  MFC after:	3 days

Modified:
  head/sbin/nvmecontrol/devlist.c
  head/sbin/nvmecontrol/firmware.c
  head/sbin/nvmecontrol/identify.c
  head/sbin/nvmecontrol/logpage.c
  head/sbin/nvmecontrol/nvmecontrol.c
  head/sbin/nvmecontrol/perftest.c
  head/sbin/nvmecontrol/reset.c

Modified: head/sbin/nvmecontrol/devlist.c
==============================================================================
--- head/sbin/nvmecontrol/devlist.c	Tue Jul  9 21:03:39 2013	(r253108)
+++ head/sbin/nvmecontrol/devlist.c	Tue Jul  9 21:14:15 2013	(r253109)
@@ -29,13 +29,12 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "nvmecontrol.h"
@@ -45,7 +44,7 @@ devlist_usage(void)
 {
 	fprintf(stderr, "usage:\n");
 	fprintf(stderr, DEVLIST_USAGE);
-	exit(EX_USAGE);
+	exit(1);
 }
 
 static inline uint32_t
@@ -62,9 +61,7 @@ devlist(int argc, char *argv[])
 	struct nvme_namespace_data	nsdata;
 	char				name[64];
 	uint32_t			i;
-	int				ch, ctrlr, exit_code, fd, found;
-
-	exit_code = EX_OK;
+	int				ch, ctrlr, fd, found, ret;
 
 	while ((ch = getopt(argc, argv, "")) != -1) {
 		switch ((char)ch) {
@@ -80,14 +77,14 @@ devlist(int argc, char *argv[])
 		ctrlr++;
 		sprintf(name, "%s%d", NVME_CTRLR_PREFIX, ctrlr);
 
-		exit_code = open_dev(name, &fd, 0, 0);
+		ret = open_dev(name, &fd, 0, 0);
 
-		if (exit_code == EX_NOINPUT)
-			break;
-		else if (exit_code == EX_NOPERM) {
-			printf("Could not open /dev/%s, errno = %d (%s)\n",
-			    name, errno, strerror(errno));
-			continue;
+		if (ret != 0) {
+			if (fd < 0) {
+				warnx("could not open /dev/%s\n", name);
+				continue;
+			} else
+				break;
 		}
 
 		found++;
@@ -111,5 +108,5 @@ devlist(int argc, char *argv[])
 	if (found == 0)
 		printf("No NVMe controllers found.\n");
 
-	exit(EX_OK);
+	exit(1);
 }

Modified: head/sbin/nvmecontrol/firmware.c
==============================================================================
--- head/sbin/nvmecontrol/firmware.c	Tue Jul  9 21:03:39 2013	(r253108)
+++ head/sbin/nvmecontrol/firmware.c	Tue Jul  9 21:14:15 2013	(r253109)
@@ -36,14 +36,14 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "nvmecontrol.h"
@@ -64,60 +64,58 @@ slot_has_valid_firmware(int fd, int slot
 }
 
 static void
-read_image_file(char *path, void **buf, ssize_t *size)
+read_image_file(char *path, void **buf, int32_t *size)
 {
 	struct stat	sb;
+	int32_t		filesize;
 	int		fd;
 
 	*size = 0;
 	*buf = NULL;
 
-	if ((fd = open(path, O_RDONLY)) < 0) {
-		fprintf(stderr, "Unable to open '%s'.\n", path);
-		exit(EX_IOERR);
-	}
-	if (fstat(fd, &sb) < 0) {
-		fprintf(stderr, "Unable to stat '%s'.\n", path);
-		close(fd);
-		exit(EX_IOERR);
-	}
-	if ((*buf = malloc(sb.st_size)) == NULL) {
-		fprintf(stderr, "Unable to malloc %jd bytes.\n",
-		    sb.st_size);
-		close(fd);
-		exit(EX_IOERR);
-	}
-	if ((*size = read(fd, *buf, sb.st_size)) < 0) {
-		fprintf(stderr, "Error reading '%s', errno=%d (%s)\n",
-		    path, errno, strerror(errno));
-		close(fd);
-		exit(EX_IOERR);
-	}
-	if (*size != sb.st_size) {
-		fprintf(stderr, "Error reading '%s', "
-		    "read %zd bytes, requested %jd bytes\n",
-		    path, *size, sb.st_size);
-		close(fd);
-		exit(EX_IOERR);
-	}
+	if ((fd = open(path, O_RDONLY)) < 0)
+		err(1, "unable to open '%s'", path);
+	if (fstat(fd, &sb) < 0)
+		err(1, "unable to stat '%s'", path);
+
+	/*
+	 * The NVMe spec does not explicitly state a maximum firmware image
+	 *  size, although one can be inferred from the dword size limitation
+	 *  for the size and offset fields in the Firmware Image Download
+	 *  command.
+	 *
+	 * Technically, the max is UINT32_MAX * sizeof(uint32_t), since the
+	 *  size and offsets are specified in terms of dwords (not bytes), but
+	 *  realistically INT32_MAX is sufficient here and simplifies matters
+	 *  a bit.
+	 */
+	if (sb.st_size > INT32_MAX)
+		errx(1, "size of file '%s' is too large (%jd bytes)",
+		    path, (intmax_t)sb.st_size);
+	filesize = (int32_t)sb.st_size;
+	if ((*buf = malloc(filesize)) == NULL)
+		errx(1, "unable to malloc %zd bytes", filesize);
+	if ((*size = read(fd, *buf, filesize)) < 0)
+		err(1, "error reading '%s'", path);
+	/* XXX assuming no short reads */
+	if (*size != filesize)
+		errx(1,
+		    "error reading '%s' (read %d bytes, requested %d bytes)",
+		    path, *size, filesize);
 }
 
 static void
-update_firmware(int fd, uint8_t *payload, uint32_t payload_size)
+update_firmware(int fd, uint8_t *payload, int32_t payload_size)
 {
 	struct nvme_pt_command	pt;
-	size_t			size;
+	int32_t			off, resid, size;
 	void			*chunk;
-	uint32_t		off, resid;
-	int			exit_code = EX_OK;
 
 	off = 0;
 	resid = payload_size;
 
-	if ((chunk = malloc((size_t)NVME_MAX_XFER_SIZE)) == NULL) {
-		printf("Unable to malloc %d bytes.\n", NVME_MAX_XFER_SIZE);
-		exit(EX_IOERR);
-	}
+	if ((chunk = malloc(NVME_MAX_XFER_SIZE)) == NULL)
+		errx(1, "unable to malloc %d bytes", NVME_MAX_XFER_SIZE);
 
 	while (resid > 0) {
 		size = (resid >= NVME_MAX_XFER_SIZE) ?
@@ -132,26 +130,15 @@ update_firmware(int fd, uint8_t *payload
 		pt.len = size;
 		pt.is_read = 0;
 
-		if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) {
-			printf("Firmware image download request failed. "
-			    "errno=%d (%s)\n",
-			    errno, strerror(errno));
-			exit_code = EX_IOERR;
-			break;
-		}
+		if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
+			err(1, "firmware download request failed");
 
-		if (nvme_completion_is_error(&pt.cpl)) {
-			printf("Passthrough command returned error.\n");
-			exit_code = EX_IOERR;
-			break;
-		}
+		if (nvme_completion_is_error(&pt.cpl))
+			errx(1, "firmware download request returned error");
 
 		resid -= size;
 		off += size;
 	}
-	
-	if (exit_code != EX_OK)
-		exit(exit_code);
 }
 
 static void
@@ -164,16 +151,11 @@ activate_firmware(int fd, int slot, int 
 	pt.cmd.cdw10 = (activate_action << 3) | slot;
 	pt.is_read = 0;
 
-	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) {
-		printf("Firmware activate request failed. errno=%d (%s)\n",
-		    errno, strerror(errno));
-		exit(EX_IOERR);
-	}
+	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
+		err(1, "firmware activate request failed");
 
-	if (nvme_completion_is_error(&pt.cpl)) {
-		printf("Passthrough command returned error.\n");
-		exit(EX_IOERR);
-	}
+	if (nvme_completion_is_error(&pt.cpl))
+		errx(1, "firmware activate request returned error");
 }
 
 static void
@@ -181,7 +163,7 @@ firmware_usage(void)
 {
 	fprintf(stderr, "usage:\n");
 	fprintf(stderr, FIRMWARE_USAGE);
-	exit(EX_USAGE);
+	exit(1);
 }
 
 void
@@ -192,7 +174,7 @@ firmware(int argc, char *argv[])
 	char				ch, *p, *image = NULL;
 	char				*controller = NULL, prompt[64];
 	void				*buf = NULL;
-	ssize_t				size;
+	int32_t				size = 0;
 	struct nvme_controller_data	cdata;
 
 	a_flag = s_flag = f_flag = false;
@@ -252,34 +234,24 @@ firmware(int argc, char *argv[])
 	open_dev(controller, &fd, 1, 1);
 	read_controller_data(fd, &cdata);
 
-	if (cdata.oacs.firmware == 0) {
-		fprintf(stderr, 
-		    "Controller does not support firmware "
-		    "activate/download.\n");
-		exit(EX_IOERR);
-	}
-
-	if (f_flag && slot == 1 && cdata.frmw.slot1_ro) {
-		fprintf(stderr, "Slot %d is marked as read only.\n", slot);
-		exit(EX_IOERR);
-	}
-
-	if (slot > cdata.frmw.num_slots) {
-		fprintf(stderr,
-		    "Slot %d was specified but controller only "
-		    "supports %d firmware slots.\n",
+	if (cdata.oacs.firmware == 0)
+		errx(1,
+		    "controller does not support firmware activate/download");
+
+	if (f_flag && slot == 1 && cdata.frmw.slot1_ro)
+		errx(1, "slot %d is marked as read only", slot);
+
+	if (slot > cdata.frmw.num_slots)
+		errx(1,
+		    "slot %d specified but controller only supports %d slots",
 		    slot, cdata.frmw.num_slots);
-		exit(EX_IOERR);
-	}
 
-	if (!slot_has_valid_firmware(fd, slot)) {
-		fprintf(stderr,
-		    "Slot %d does not contain valid firmware.\n"
-		    "Try 'nvmecontrol logpage -p 3 %s' to get a list "
-		    "of available firmware images.\n",
+	if (!slot_has_valid_firmware(fd, slot))
+		errx(1,
+		    "slot %d does not contain valid firmware,\n"
+		    "try 'nvmecontrol logpage -p 3 %s' to get a list "
+		    "of available images\n",
 		    slot, controller);
-		exit(EX_IOERR);
-	}
 
 	if (f_flag && a_flag)
 		printf("You are about to download and activate "
@@ -305,7 +277,7 @@ firmware(int argc, char *argv[])
 		if (strncasecmp(prompt, "yes", 3) == 0)
 			break;
 		if (strncasecmp(prompt, "no", 2) == 0)
-			exit(EX_OK);
+			exit(1);
 		printf("Please answer \"yes\" or \"no\". ");
 	}
 
@@ -331,5 +303,5 @@ firmware(int argc, char *argv[])
 	}
 
 	close(fd);
-	exit(EX_OK);
+	exit(0);
 }

Modified: head/sbin/nvmecontrol/identify.c
==============================================================================
--- head/sbin/nvmecontrol/identify.c	Tue Jul  9 21:03:39 2013	(r253108)
+++ head/sbin/nvmecontrol/identify.c	Tue Jul  9 21:14:15 2013	(r253109)
@@ -30,13 +30,13 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "nvmecontrol.h"
@@ -139,7 +139,7 @@ identify_usage(void)
 {
 	fprintf(stderr, "usage:\n");
 	fprintf(stderr, IDENTIFY_USAGE);
-	exit(EX_USAGE);
+	exit(1);
 }
 
 static void
@@ -177,16 +177,16 @@ identify_ctrlr(int argc, char *argv[])
 			hexlength = offsetof(struct nvme_controller_data,
 			    reserved5);
 		print_hex(&cdata, hexlength);
-		exit(EX_OK);
+		exit(0);
 	}
 
 	if (verboseflag == 1) {
-		printf("-v not currently supported without -x.\n");
+		fprintf(stderr, "-v not currently supported without -x\n");
 		identify_usage();
 	}
 
 	print_controller(&cdata);
-	exit(EX_OK);
+	exit(0);
 }
 
 static void
@@ -231,10 +231,8 @@ identify_ns(int argc, char *argv[])
 	nsloc = strnstr(argv[optind], NVME_NS_PREFIX, 10);
 	if (nsloc != NULL)
 		nsid = strtol(nsloc + 2, NULL, 10);
-	if (nsloc == NULL || (nsid == 0 && errno != 0)) {
-		printf("Invalid namespace ID %s.\n", argv[optind]);
-		exit(EX_IOERR);
-	}
+	if (nsloc == NULL || (nsid == 0 && errno != 0))
+		errx(1, "invalid namespace ID '%s'", argv[optind]);
 
 	/*
 	 * We send IDENTIFY commands to the controller, not the namespace,
@@ -253,16 +251,16 @@ identify_ns(int argc, char *argv[])
 			hexlength = offsetof(struct nvme_namespace_data,
 			    reserved6);
 		print_hex(&nsdata, hexlength);
-		exit(EX_OK);
+		exit(0);
 	}
 
 	if (verboseflag == 1) {
-		printf("-v not currently supported without -x.\n");
+		fprintf(stderr, "-v not currently supported without -x\n");
 		identify_usage();
 	}
 
 	print_namespace(&nsdata);
-	exit(EX_OK);
+	exit(0);
 }
 
 void

Modified: head/sbin/nvmecontrol/logpage.c
==============================================================================
--- head/sbin/nvmecontrol/logpage.c	Tue Jul  9 21:03:39 2013	(r253108)
+++ head/sbin/nvmecontrol/logpage.c	Tue Jul  9 21:14:15 2013	(r253109)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -41,7 +42,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "nvmecontrol.h"
@@ -52,14 +52,13 @@ __FBSDID("$FreeBSD$");
 typedef void (*print_fn_t)(void *buf, uint32_t size);
 
 static void *
-get_log_buffer(size_t size)
+get_log_buffer(uint32_t size)
 {
 	void	*buf;
 
-	if ((buf = malloc(size)) == NULL) {
-		fprintf(stderr, "Unable to malloc %zd bytes\n", size);
-		exit(EX_IOERR);
-	}
+	if ((buf = malloc(size)) == NULL)
+		errx(1, "unable to malloc %u bytes", size);
+
 	memset(buf, 0, size);
 	return (buf);
 }
@@ -79,16 +78,11 @@ read_logpage(int fd, uint8_t log_page, i
 	pt.len = payload_size;
 	pt.is_read = 1;
 
-	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) {
-		printf("Get log page request failed. errno=%d (%s)\n",
-		    errno, strerror(errno));
-		exit(EX_IOERR);
-	}
+	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
+		err(1, "get log page request failed");
 
-	if (nvme_completion_is_error(&pt.cpl)) {
-		printf("Passthrough command returned error.\n");
-		exit(EX_IOERR);
-	}
+	if (nvme_completion_is_error(&pt.cpl))
+		errx(1, "get log page request returned error");
 }
 
 static void
@@ -242,7 +236,7 @@ logpage_usage(void)
 {
 	fprintf(stderr, "usage:\n");
 	fprintf(stderr, LOGPAGE_USAGE);
-	exit(EX_USAGE);
+	exit(1);
 }
 
 void
@@ -254,7 +248,7 @@ logpage(int argc, char *argv[])
 	int				allow_ns = false;
 	char				ch, *p, *nsloc = NULL;
 	char				*cname = NULL;
-	size_t				size;
+	uint32_t			size;
 	void				*buf;
 	struct logpage_function		*f;
 	struct nvme_controller_data	cdata;
@@ -313,28 +307,20 @@ logpage(int argc, char *argv[])
 	/* If a namespace id was specified, validate it's use */
 	if (strstr(argv[optind], NVME_NS_PREFIX) != NULL) {
 		if (!allow_ns) {
-			if (log_page != NVME_LOG_HEALTH_INFORMATION) {
-				fprintf(stderr,
-				    "Namespace ID not valid for log page %d.\n",
+			if (log_page != NVME_LOG_HEALTH_INFORMATION)
+				errx(1,
+				    "log page %d valid only at controller level",
 				    log_page);
-			} else if (cdata.lpa.ns_smart == 0) {
-				fprintf(stderr,
-				    "Controller does not support per "
-				    "namespace SMART/Health information.\n");
-			}
-			close(fd);
-			exit(EX_IOERR);
+			else if (cdata.lpa.ns_smart == 0)
+				errx(1,
+				    "controller does not support per "
+				    "namespace smart/health information");
 		}
 		nsloc = strnstr(argv[optind], NVME_NS_PREFIX, 10);
 		if (nsloc != NULL)
 			nsid = strtol(nsloc + 2, NULL, 10);
-		if (nsloc == NULL || (nsid == 0 && errno != 0)) {
-			fprintf(stderr,
-			    "Invalid namespace ID %s.\n",
-			    argv[optind]);
-			close(fd);
-			exit(EX_IOERR);
-		}
+		if (nsloc == NULL || (nsid == 0 && errno != 0))
+			errx(1, "invalid namespace id '%s'", argv[optind]);
 
 		/*
 		 * User is asking for per namespace log page information
@@ -384,5 +370,5 @@ logpage(int argc, char *argv[])
 	print_fn(buf, size);
 
 	close(fd);
-	exit(EX_OK);
+	exit(0);
 }

Modified: head/sbin/nvmecontrol/nvmecontrol.c
==============================================================================
--- head/sbin/nvmecontrol/nvmecontrol.c	Tue Jul  9 21:03:39 2013	(r253108)
+++ head/sbin/nvmecontrol/nvmecontrol.c	Tue Jul  9 21:14:15 2013	(r253109)
@@ -32,14 +32,13 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "nvmecontrol.h"
@@ -71,7 +70,7 @@ usage(void)
 		fprintf(stderr, "%s", f->usage);
 		f++;
 	}
-	exit(EX_USAGE);
+	exit(1);
 }
 
 static void
@@ -134,16 +133,11 @@ read_controller_data(int fd, struct nvme
 	pt.len = sizeof(*cdata);
 	pt.is_read = 1;
 
-	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) {
-		printf("Identify request failed. errno=%d (%s)\n",
-		    errno, strerror(errno));
-		exit(EX_IOERR);
-	}
+	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
+		err(1, "identify request failed");
 
-	if (nvme_completion_is_error(&pt.cpl)) {
-		printf("Passthrough command returned error.\n");
-		exit(EX_IOERR);
-	}
+	if (nvme_completion_is_error(&pt.cpl))
+		errx(1, "identify request returned error");
 }
 
 void
@@ -158,16 +152,11 @@ read_namespace_data(int fd, int nsid, st
 	pt.len = sizeof(*nsdata);
 	pt.is_read = 1;
 
-	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) {
-		printf("Identify request failed. errno=%d (%s)\n",
-		    errno, strerror(errno));
-		exit(EX_IOERR);
-	}
+	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
+		err(1, "identify request failed");
 
-	if (nvme_completion_is_error(&pt.cpl)) {
-		printf("Passthrough command returned error.\n");
-		exit(EX_IOERR);
-	}
+	if (nvme_completion_is_error(&pt.cpl))
+		errx(1, "identify request returned error");
 }
 
 int
@@ -178,38 +167,35 @@ open_dev(const char *str, int *fd, int s
 
 	if (!strnstr(str, NVME_CTRLR_PREFIX, strlen(NVME_CTRLR_PREFIX))) {
 		if (show_error)
-			fprintf(stderr,
-			    "Controller/namespace IDs must begin with '%s'.\n",
+			warnx("controller/namespace ids must begin with '%s'",
 			    NVME_CTRLR_PREFIX);
 		if (exit_on_error)
-			exit(EX_USAGE);
+			exit(1);
 		else
-			return (EX_USAGE);
+			return (1);
 	}
 
 	snprintf(full_path, sizeof(full_path), "/dev/%s", str);
 	if (stat(full_path, &devstat) != 0) {
 		if (show_error)
-			fprintf(stderr, "Could not stat %s. errno=%d (%s)\n",
-			    full_path, errno, strerror(errno));
+			warn("could not stat %s", full_path);
 		if (exit_on_error)
-			exit(EX_NOINPUT);
+			exit(1);
 		else
-			return (EX_NOINPUT);
+			return (1);
 	}
 
 	*fd = open(full_path, O_RDWR);
 	if (*fd < 0) {
 		if (show_error)
-			fprintf(stderr, "Could not open %s. errno=%d (%s)\n",
-			    full_path, errno, strerror(errno));
+			warn("could not open %s", full_path);
 		if (exit_on_error)
-			exit(EX_NOPERM);
+			exit(1);
 		else
-			return (EX_NOPERM);
+			return (1);
 	}
 
-	return (EX_OK);
+	return (0);
 }
 
 int

Modified: head/sbin/nvmecontrol/perftest.c
==============================================================================
--- head/sbin/nvmecontrol/perftest.c	Tue Jul  9 21:03:39 2013	(r253108)
+++ head/sbin/nvmecontrol/perftest.c	Tue Jul  9 21:14:15 2013	(r253109)
@@ -31,14 +31,13 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "nvmecontrol.h"
@@ -72,7 +71,7 @@ perftest_usage(void)
 {
 	fprintf(stderr, "usage:\n");
 	fprintf(stderr, PERFTEST_USAGE);
-	exit(EX_USAGE);
+	exit(1);
 }
 
 void
@@ -168,14 +167,10 @@ perftest(int argc, char *argv[])
 		perftest_usage();
 
 	open_dev(argv[optind], &fd, 1, 1);
-	if (ioctl(fd, ioctl_cmd, &io_test) < 0) {
-		fprintf(stderr, "NVME_IO_TEST failed. errno=%d (%s)\n", errno,
-		    strerror(errno));
-		close(fd);
-		exit(EX_IOERR);
-	}
+	if (ioctl(fd, ioctl_cmd, &io_test) < 0)
+		err(1, "ioctl NVME_IO_TEST failed");
 
 	close(fd);
 	print_perftest(&io_test, perthread);
-	exit(EX_OK);
+	exit(0);
 }

Modified: head/sbin/nvmecontrol/reset.c
==============================================================================
--- head/sbin/nvmecontrol/reset.c	Tue Jul  9 21:03:39 2013	(r253108)
+++ head/sbin/nvmecontrol/reset.c	Tue Jul  9 21:14:15 2013	(r253109)
@@ -30,12 +30,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "nvmecontrol.h"
@@ -45,7 +44,7 @@ reset_usage(void)
 {
 	fprintf(stderr, "usage:\n");
 	fprintf(stderr, RESET_USAGE);
-	exit(EX_USAGE);
+	exit(1);
 }
 
 void
@@ -65,11 +64,8 @@ reset(int argc, char *argv[])
 		reset_usage();
 
 	open_dev(argv[optind], &fd, 1, 1);
-	if (ioctl(fd, NVME_RESET_CONTROLLER) < 0) {
-		printf("Reset request to %s failed. errno=%d (%s)\n",
-		    argv[optind], errno, strerror(errno));
-		exit(EX_IOERR);
-	}
+	if (ioctl(fd, NVME_RESET_CONTROLLER) < 0)
+		err(1, "reset request to %s failed", argv[optind]);
 
-	exit(EX_OK);
+	exit(0);
 }

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 21:18:13 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 2307D17F;
 Tue,  9 Jul 2013 21:18:13 +0000 (UTC)
 (envelope-from jim.harris@gmail.com)
Received: from mail-ea0-x22a.google.com (mail-ea0-x22a.google.com
 [IPv6:2a00:1450:4013:c01::22a])
 by mx1.freebsd.org (Postfix) with ESMTP id 36F8B1D36;
 Tue,  9 Jul 2013 21:18:12 +0000 (UTC)
Received: by mail-ea0-f170.google.com with SMTP id h10so4190281eaj.15
 for ; Tue, 09 Jul 2013 14:18:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=8I4CDdXGRzRZ3kAqglWKD2pJHYtbvzYYW/lYpYRHgSQ=;
 b=WrmUqhBONnWT5YUjP4XMkDO1QbvHeb1JBJ/c9d5Pz6qRYMf/fKAPC2DGfxNmO93NQ4
 KAM+7pHPoNCMJfiy/2hderWp9f7OR3abJb2vekZnpnVQb3TPOPkLQpPcD9xnaMB+HN5Y
 YCxiuFALZlQd4yD9NpeKQ41VEu6IiXJzXmNQV+mNLqznhoDu91qP2KUIJX1QKqBGHQ8g
 vq2qhDUrk1YGX/Ynpzy3hlilfYoKv6eXUh58Besw954cFNXk+ZDRAoXT/cxb6LtLYbF0
 MIkoY5DgsEFLE/NzmXkLGSRhSTcP7NQG2YQRRyi9xy3VnGtCJVwkyJKps2R3JFJfFYZg
 y+dA==
MIME-Version: 1.0
X-Received: by 10.14.204.137 with SMTP id h9mr32926383eeo.13.1373404691235;
 Tue, 09 Jul 2013 14:18:11 -0700 (PDT)
Received: by 10.15.25.7 with HTTP; Tue, 9 Jul 2013 14:18:11 -0700 (PDT)
In-Reply-To: <20130707114237.L897@besplex.bde.org>
References: <201307040026.r640QOCd079203@svn.freebsd.org>
 <20130704105843.B982@besplex.bde.org>
 <20130706184249.GD25842@garage.freebsd.pl>
 <20130706195108.GA34684@stack.nl>
 <20130707114237.L897@besplex.bde.org>
Date: Tue, 9 Jul 2013 14:18:11 -0700
Message-ID: 
Subject: Re: svn commit: r252672 - head/sbin/nvmecontrol
From: Jim Harris 
To: Bruce Evans 
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.14
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Pawel Jakub Dawidek ,
 Jilles Tjoelker 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 21:18:13 -0000

On Sat, Jul 6, 2013 at 7:26 PM, Bruce Evans  wrote:

> On Sat, 6 Jul 2013, Jilles Tjoelker wrote:
>
>  On Sat, Jul 06, 2013 at 08:42:49PM +0200, Pawel Jakub Dawidek wrote:
>>
>>> On Thu, Jul 04, 2013 at 11:44:28AM +1000, Bruce Evans wrote:
>>>
>>>> Many style bugs are visible in this patch:
>>>>
>>> [...]
>>>
>>>> - sysexits.h is used
>>>>
>>> [...]
>>>
>>
>>  Bruce, until sysexits(3) doesn't explicitly say it shouldn't be used,
>>> please stop calling this a bug, because you are just confusing people.
>>> At this point sysexits(3) actually even suggests it is blessed by
>>> style(9). This is how it starts:
>>>
>>
>>          According to style(9), it is not a good practice to call exit(3)
>>>         with arbitrary values to indicate a failure condition when
>>>         ending a program. Instead, the pre-defined exit codes from
>>>         sysexits should be used, so the caller of the process can get a
>>>         rough estimation about the failure class without looking up the
>>>         source code.
>>>
>>
> This is just another bug in sysexits(3).  This is not according to
> style(9), since style(9) was fixed to not say that after I complained
> previously :-).  It has never been normal practice to use sysexits(3),
> but someone who likes it added recommendations to use it to style(9) when
> they added the man pages for sysexits(3).  Before that, it was
> so rarely used that it had no man page.
>

To add to the areas of confusion already stated in this thread, err(3)
explicitly recommends using sysexits(3) and uses it in all of the examples.

I decided to use 0/1 instead of sysexits since it seems most appropriate
based on the discussion here and other examples in sbin.  I incorporated
these changes as well as addressing some of Bruce's other feedback in
r253109.

Thanks,

-Jim

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 21:20:08 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id C2C4D336;
 Tue,  9 Jul 2013 21:20:08 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id B038E1D61;
 Tue,  9 Jul 2013 21:20:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69LK8mQ045463;
 Tue, 9 Jul 2013 21:20:08 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69LK8br045462;
 Tue, 9 Jul 2013 21:20:08 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307092120.r69LK8br045462@svn.freebsd.org>
From: Jim Harris 
Date: Tue, 9 Jul 2013 21:20:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253110 - head/sbin/nvmecontrol
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 21:20:08 -0000

Author: jimharris
Date: Tue Jul  9 21:20:08 2013
New Revision: 253110
URL: http://svnweb.freebsd.org/changeset/base/253110

Log:
  Try to read firmware image before prompting the user to confirm
  firmware download.  This correctly prints an error and exits for
  an incorrect firmware image name before prompting the user to
  confirm the download.
  
  Sponsored by:	Intel
  MFC after:	3 days

Modified:
  head/sbin/nvmecontrol/firmware.c

Modified: head/sbin/nvmecontrol/firmware.c
==============================================================================
--- head/sbin/nvmecontrol/firmware.c	Tue Jul  9 21:14:15 2013	(r253109)
+++ head/sbin/nvmecontrol/firmware.c	Tue Jul  9 21:20:08 2013	(r253110)
@@ -253,6 +253,9 @@ firmware(int argc, char *argv[])
 		    "of available images\n",
 		    slot, controller);
 
+	if (f_flag)
+		read_image_file(image, &buf, &size);
+
 	if (f_flag && a_flag)
 		printf("You are about to download and activate "
 		       "firmware image (%s) to controller %s.\n"
@@ -282,7 +285,6 @@ firmware(int argc, char *argv[])
 	}
 
 	if (f_flag) {
-		read_image_file(image, &buf, &size);
 		update_firmware(fd, buf, size);
 		if (a_flag)
 			activate_firmware(fd, slot,

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 21:21:30 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 63AD2626;
 Tue,  9 Jul 2013 21:21:30 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 3BA0A1D7D;
 Tue,  9 Jul 2013 21:21:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69LLUwD047252;
 Tue, 9 Jul 2013 21:21:30 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69LLTV5047249;
 Tue, 9 Jul 2013 21:21:29 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307092121.r69LLTV5047249@svn.freebsd.org>
From: Jim Harris 
Date: Tue, 9 Jul 2013 21:21:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253111 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 21:21:30 -0000

Author: jimharris
Date: Tue Jul  9 21:21:29 2013
New Revision: 253111
URL: http://svnweb.freebsd.org/changeset/base/253111

Log:
  Update nvme(4) and nvd(4) to reflect recent work and upcoming inclusion
  in 9.2 release.
  
  Sponsored by:	Intel
  MFC after:	3 days

Modified:
  head/share/man/man4/nvd.4
  head/share/man/man4/nvme.4

Modified: head/share/man/man4/nvd.4
==============================================================================
--- head/share/man/man4/nvd.4	Tue Jul  9 21:20:08 2013	(r253110)
+++ head/share/man/man4/nvd.4	Tue Jul  9 21:21:29 2013	(r253111)
@@ -1,5 +1,5 @@
 .\"
-.\" Copyright (c) 2012 Intel Corporation
+.\" Copyright (c) 2012-2013 Intel Corporation
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -66,6 +66,11 @@ I/O commands.
 .Xr nvme 4 ,
 .Xr nvmecontrol 8 ,
 .Xr disk 9 .
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Fx 9.2.
 .Sh AUTHORS
 .An -nosplit
 The
@@ -76,15 +81,3 @@ with contributions from Joe Golio at EMC
 .Pp
 This man page was written by
 .An Jim Harris Aq jimharris@FreeBSD.org .
-.Sh BUGS
-The
-.Nm
-driver is considered experimental.
-Development and testing have been primarily focused on amd64.
-The following areas of development and testing are in progress:
-.Bl -bullet
-.It
-testing on i386
-.It
-command timeout error handling
-.El

Modified: head/share/man/man4/nvme.4
==============================================================================
--- head/share/man/man4/nvme.4	Tue Jul  9 21:20:08 2013	(r253110)
+++ head/share/man/man4/nvme.4	Tue Jul  9 21:21:29 2013	(r253111)
@@ -1,5 +1,5 @@
 .\"
-.\" Copyright (c) 2012 Intel Corporation
+.\" Copyright (c) 2012-2013 Intel Corporation
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -147,6 +147,11 @@ and completion queues to the console.
 .Xr pci 4 ,
 .Xr nvmecontrol 8 ,
 .Xr disk 9 .
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Fx 9.2.
 .Sh AUTHORS
 .An -nosplit
 The
@@ -157,19 +162,3 @@ with contributions from Joe Golio at EMC
 .Pp
 This man page was written by
 .An Jim Harris Aq jimharris@FreeBSD.org .
-.Sh BUGS
-The
-.Nm
-driver is considered experimental.
-Development and testing have been primarily focused on amd64.
-The following areas of development and testing are in progress:
-.Bl -bullet
-.It
-testing on i386
-.It
-asynchronous error reporting
-.It
-command timeout error handling
-.It
-controller-level resets
-.El

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 21:22:20 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 6E3A0762;
 Tue,  9 Jul 2013 21:22:20 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 4E86B1D86;
 Tue,  9 Jul 2013 21:22:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69LMKmd047448;
 Tue, 9 Jul 2013 21:22:20 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69LMIIG047430;
 Tue, 9 Jul 2013 21:22:18 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307092122.r69LMIIG047430@svn.freebsd.org>
From: Jim Harris 
Date: Tue, 9 Jul 2013 21:22:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253112 - in head/sys/dev: nvd nvme
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 21:22:20 -0000

Author: jimharris
Date: Tue Jul  9 21:22:17 2013
New Revision: 253112
URL: http://svnweb.freebsd.org/changeset/base/253112

Log:
  Update copyright dates.
  
  MFC after:	3 days

Modified:
  head/sys/dev/nvd/nvd.c
  head/sys/dev/nvme/nvme.c
  head/sys/dev/nvme/nvme.h
  head/sys/dev/nvme/nvme_ctrlr.c
  head/sys/dev/nvme/nvme_ctrlr_cmd.c
  head/sys/dev/nvme/nvme_ns.c
  head/sys/dev/nvme/nvme_private.h
  head/sys/dev/nvme/nvme_qpair.c
  head/sys/dev/nvme/nvme_sysctl.c
  head/sys/dev/nvme/nvme_test.c

Modified: head/sys/dev/nvd/nvd.c
==============================================================================
--- head/sys/dev/nvd/nvd.c	Tue Jul  9 21:21:29 2013	(r253111)
+++ head/sys/dev/nvd/nvd.c	Tue Jul  9 21:22:17 2013	(r253112)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/dev/nvme/nvme.c
==============================================================================
--- head/sys/dev/nvme/nvme.c	Tue Jul  9 21:21:29 2013	(r253111)
+++ head/sys/dev/nvme/nvme.c	Tue Jul  9 21:22:17 2013	(r253112)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/dev/nvme/nvme.h
==============================================================================
--- head/sys/dev/nvme/nvme.h	Tue Jul  9 21:21:29 2013	(r253111)
+++ head/sys/dev/nvme/nvme.h	Tue Jul  9 21:22:17 2013	(r253112)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==============================================================================
--- head/sys/dev/nvme/nvme_ctrlr.c	Tue Jul  9 21:21:29 2013	(r253111)
+++ head/sys/dev/nvme/nvme_ctrlr.c	Tue Jul  9 21:22:17 2013	(r253112)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/dev/nvme/nvme_ctrlr_cmd.c
==============================================================================
--- head/sys/dev/nvme/nvme_ctrlr_cmd.c	Tue Jul  9 21:21:29 2013	(r253111)
+++ head/sys/dev/nvme/nvme_ctrlr_cmd.c	Tue Jul  9 21:22:17 2013	(r253112)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/dev/nvme/nvme_ns.c
==============================================================================
--- head/sys/dev/nvme/nvme_ns.c	Tue Jul  9 21:21:29 2013	(r253111)
+++ head/sys/dev/nvme/nvme_ns.c	Tue Jul  9 21:22:17 2013	(r253112)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/dev/nvme/nvme_private.h
==============================================================================
--- head/sys/dev/nvme/nvme_private.h	Tue Jul  9 21:21:29 2013	(r253111)
+++ head/sys/dev/nvme/nvme_private.h	Tue Jul  9 21:22:17 2013	(r253112)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/dev/nvme/nvme_qpair.c
==============================================================================
--- head/sys/dev/nvme/nvme_qpair.c	Tue Jul  9 21:21:29 2013	(r253111)
+++ head/sys/dev/nvme/nvme_qpair.c	Tue Jul  9 21:22:17 2013	(r253112)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/dev/nvme/nvme_sysctl.c
==============================================================================
--- head/sys/dev/nvme/nvme_sysctl.c	Tue Jul  9 21:21:29 2013	(r253111)
+++ head/sys/dev/nvme/nvme_sysctl.c	Tue Jul  9 21:22:17 2013	(r253112)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/sys/dev/nvme/nvme_test.c
==============================================================================
--- head/sys/dev/nvme/nvme_test.c	Tue Jul  9 21:21:29 2013	(r253111)
+++ head/sys/dev/nvme/nvme_test.c	Tue Jul  9 21:22:17 2013	(r253112)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 21:24:19 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 92E448D4;
 Tue,  9 Jul 2013 21:24:19 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 84CE11D9C;
 Tue,  9 Jul 2013 21:24:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69LOJLI047713;
 Tue, 9 Jul 2013 21:24:19 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69LOJTs047712;
 Tue, 9 Jul 2013 21:24:19 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307092124.r69LOJTs047712@svn.freebsd.org>
From: Jim Harris 
Date: Tue, 9 Jul 2013 21:24:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253113 - head/sys/dev/nvme
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 21:24:19 -0000

Author: jimharris
Date: Tue Jul  9 21:24:19 2013
New Revision: 253113
URL: http://svnweb.freebsd.org/changeset/base/253113

Log:
  Add comment explaining why CACHE_LINE_SIZE is defined in nvme_private.h
  if not already defined elsewhere.
  
  Requested by:	attilio
  MFC after:	3 days

Modified:
  head/sys/dev/nvme/nvme_private.h

Modified: head/sys/dev/nvme/nvme_private.h
==============================================================================
--- head/sys/dev/nvme/nvme_private.h	Tue Jul  9 21:22:17 2013	(r253112)
+++ head/sys/dev/nvme/nvme_private.h	Tue Jul  9 21:24:19 2013	(r253113)
@@ -109,6 +109,10 @@ MALLOC_DECLARE(M_NVME);
 /* Maximum log page size to fetch for AERs. */
 #define NVME_MAX_AER_LOG_SIZE		(4096)
 
+/*
+ * Define CACHE_LINE_SIZE here for older FreeBSD versions that do not define
+ *  it.
+ */
 #ifndef CACHE_LINE_SIZE
 #define CACHE_LINE_SIZE		(64)
 #endif

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 21:31:23 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 06B2BE05;
 Tue,  9 Jul 2013 21:31:23 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id ECB4D1E05;
 Tue,  9 Jul 2013 21:31:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69LVMVj051015;
 Tue, 9 Jul 2013 21:31:22 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69LVM1i051009;
 Tue, 9 Jul 2013 21:31:22 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307092131.r69LVM1i051009@svn.freebsd.org>
From: Jim Harris 
Date: Tue, 9 Jul 2013 21:31:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253114 - head/sbin/nvmecontrol
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 21:31:23 -0000

Author: jimharris
Date: Tue Jul  9 21:31:21 2013
New Revision: 253114
URL: http://svnweb.freebsd.org/changeset/base/253114

Log:
  Send per-namespace logpage commands to the controller devnode, so they
  are processed as admin commands, not I/O commands.
  
  As part of this change, pull out the code for parsing a namespace node
  string into a separate function, since it is used for both identify and
  logpage commands.
  
  Sponsored by:	Intel
  MFC after:	3 days

Modified:
  head/sbin/nvmecontrol/identify.c
  head/sbin/nvmecontrol/logpage.c
  head/sbin/nvmecontrol/nvmecontrol.c
  head/sbin/nvmecontrol/nvmecontrol.h

Modified: head/sbin/nvmecontrol/identify.c
==============================================================================
--- head/sbin/nvmecontrol/identify.c	Tue Jul  9 21:24:19 2013	(r253113)
+++ head/sbin/nvmecontrol/identify.c	Tue Jul  9 21:31:21 2013	(r253114)
@@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -194,7 +193,6 @@ identify_ns(int argc, char *argv[])
 {
 	struct nvme_namespace_data	nsdata;
 	char				path[64];
-	char				*nsloc;
 	int				ch, fd, hexflag = 0, hexlength, nsid;
 	int				verboseflag = 0;
 
@@ -224,22 +222,12 @@ identify_ns(int argc, char *argv[])
 	close(fd);
 
 	/*
-	 * Pull the namespace id from the string. +2 skips past the "ns" part
-	 *  of the string.  Don't search past 10 characters into the string,
-	 *  otherwise we know it is malformed.
-	 */
-	nsloc = strnstr(argv[optind], NVME_NS_PREFIX, 10);
-	if (nsloc != NULL)
-		nsid = strtol(nsloc + 2, NULL, 10);
-	if (nsloc == NULL || (nsid == 0 && errno != 0))
-		errx(1, "invalid namespace ID '%s'", argv[optind]);
-
-	/*
 	 * We send IDENTIFY commands to the controller, not the namespace,
-	 *  since it is an admin cmd.  So the path should only include the
-	 *  nvmeX part of the nvmeXnsY string.
+	 *  since it is an admin cmd.  The namespace ID will be specified in
+	 *  the IDENTIFY command itself.  So parse the namespace's device node
+	 *  string to get the controller substring and namespace ID.
 	 */
-	snprintf(path, nsloc - argv[optind] + 1, "%s", argv[optind]);
+	parse_ns_str(argv[optind], path, &nsid);
 	open_dev(path, &fd, 1, 1);
 	read_namespace_data(fd, nsid, &nsdata);
 	close(fd);

Modified: head/sbin/nvmecontrol/logpage.c
==============================================================================
--- head/sbin/nvmecontrol/logpage.c	Tue Jul  9 21:24:19 2013	(r253113)
+++ head/sbin/nvmecontrol/logpage.c	Tue Jul  9 21:31:21 2013	(r253114)
@@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -242,12 +241,11 @@ logpage_usage(void)
 void
 logpage(int argc, char *argv[])
 {
-	int				fd, nsid, len;
+	int				fd, nsid;
 	int				log_page = 0, pageflag = false;
-	int				hexflag = false;
-	int				allow_ns = false;
-	char				ch, *p, *nsloc = NULL;
-	char				*cname = NULL;
+	int				hexflag = false, ns_specified;
+	char				ch, *p;
+	char				cname[64];
 	uint32_t			size;
 	void				*buf;
 	struct logpage_function		*f;
@@ -290,46 +288,31 @@ logpage(int argc, char *argv[])
 	if (optind >= argc)
 		logpage_usage();
 
+	if (strstr(argv[optind], NVME_NS_PREFIX) != NULL) {
+		ns_specified = true;
+		parse_ns_str(argv[optind], cname, &nsid);
+		open_dev(cname, &fd, 1, 1);
+	} else {
+		ns_specified = false;
+		nsid = NVME_GLOBAL_NAMESPACE_TAG;
+		open_dev(argv[optind], &fd, 1, 1);
+	}
+
 	/*
 	 * The log page attribtues indicate whether or not the controller
 	 * supports the SMART/Health information log page on a per
 	 * namespace basis.
 	 */
-	cname = malloc(strlen(NVME_CTRLR_PREFIX) + 2);
-	len = strlen(NVME_CTRLR_PREFIX) + 1;
-	cname = strncpy(cname, argv[optind], len);
-	open_dev(cname, &fd, 1, 1);
-	read_controller_data(fd, &cdata);
-
-	if (log_page == NVME_LOG_HEALTH_INFORMATION && cdata.lpa.ns_smart != 0)
-		allow_ns = true;
-
-	/* If a namespace id was specified, validate it's use */
-	if (strstr(argv[optind], NVME_NS_PREFIX) != NULL) {
-		if (!allow_ns) {
-			if (log_page != NVME_LOG_HEALTH_INFORMATION)
-				errx(1,
-				    "log page %d valid only at controller level",
-				    log_page);
-			else if (cdata.lpa.ns_smart == 0)
-				errx(1,
-				    "controller does not support per "
-				    "namespace smart/health information");
-		}
-		nsloc = strnstr(argv[optind], NVME_NS_PREFIX, 10);
-		if (nsloc != NULL)
-			nsid = strtol(nsloc + 2, NULL, 10);
-		if (nsloc == NULL || (nsid == 0 && errno != 0))
-			errx(1, "invalid namespace id '%s'", argv[optind]);
-
-		/*
-		 * User is asking for per namespace log page information
-		 * so close the controller and open up the namespace.
-		 */
-		close(fd);
-		open_dev(argv[optind], &fd, 1, 1);
-	} else
-		nsid = NVME_GLOBAL_NAMESPACE_TAG;
+	if (ns_specified) {
+		if (log_page != NVME_LOG_HEALTH_INFORMATION)
+			errx(1, "log page %d valid only at controller level",
+			    log_page);
+		read_controller_data(fd, &cdata);
+		if (cdata.lpa.ns_smart == 0)
+			errx(1,
+			    "controller does not support per namespace "
+			    "smart/health information");
+	}
 
 	print_fn = print_hex;
 	if (!hexflag) {

Modified: head/sbin/nvmecontrol/nvmecontrol.c
==============================================================================
--- head/sbin/nvmecontrol/nvmecontrol.c	Tue Jul  9 21:24:19 2013	(r253113)
+++ head/sbin/nvmecontrol/nvmecontrol.c	Tue Jul  9 21:31:21 2013	(r253114)
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -198,6 +199,29 @@ open_dev(const char *str, int *fd, int s
 	return (0);
 }
 
+void
+parse_ns_str(const char *ns_str, char *ctrlr_str, int *nsid)
+{
+	char	*nsloc;
+
+	/*
+	 * Pull the namespace id from the string. +2 skips past the "ns" part
+	 *  of the string.  Don't search past 10 characters into the string,
+	 *  otherwise we know it is malformed.
+	 */
+	nsloc = strnstr(ns_str, NVME_NS_PREFIX, 10);
+	if (nsloc != NULL)
+		*nsid = strtol(nsloc + 2, NULL, 10);
+	if (nsloc == NULL || (*nsid == 0 && errno != 0))
+		errx(1, "invalid namespace ID '%s'", ns_str);
+
+	/*
+	 * The controller string will include only the nvmX part of the
+	 *  nvmeXnsY string.
+	 */
+	snprintf(ctrlr_str, nsloc - ns_str + 1, "%s", ns_str);
+}
+
 int
 main(int argc, char *argv[])
 {

Modified: head/sbin/nvmecontrol/nvmecontrol.h
==============================================================================
--- head/sbin/nvmecontrol/nvmecontrol.h	Tue Jul  9 21:24:19 2013	(r253113)
+++ head/sbin/nvmecontrol/nvmecontrol.h	Tue Jul  9 21:31:21 2013	(r253114)
@@ -63,6 +63,7 @@ void logpage(int argc, char *argv[]);
 void firmware(int argc, char *argv[]);
 
 int open_dev(const char *str, int *fd, int show_error, int exit_on_error);
+void parse_ns_str(const char *ns_str, char *ctrlr_str, int *nsid);
 void read_controller_data(int fd, struct nvme_controller_data *cdata);
 void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata);
 void print_hex(void *data, uint32_t length);

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 21:31:58 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id E5EE6F4E;
 Tue,  9 Jul 2013 21:31:58 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id D82551E0F;
 Tue,  9 Jul 2013 21:31:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69LVwPG051104;
 Tue, 9 Jul 2013 21:31:58 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69LVwm0051103;
 Tue, 9 Jul 2013 21:31:58 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307092131.r69LVwm0051103@svn.freebsd.org>
From: Jim Harris 
Date: Tue, 9 Jul 2013 21:31:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253115 - head/sbin/nvmecontrol
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 21:31:59 -0000

Author: jimharris
Date: Tue Jul  9 21:31:58 2013
New Revision: 253115
URL: http://svnweb.freebsd.org/changeset/base/253115

Log:
  Condense the output for displaying LBA formats.
  
  Sponsored by:	Intel
  MFC after:	3 days

Modified:
  head/sbin/nvmecontrol/identify.c

Modified: head/sbin/nvmecontrol/identify.c
==============================================================================
--- head/sbin/nvmecontrol/identify.c	Tue Jul  9 21:31:21 2013	(r253114)
+++ head/sbin/nvmecontrol/identify.c	Tue Jul  9 21:31:58 2013	(r253115)
@@ -124,13 +124,11 @@ print_namespace(struct nvme_namespace_da
 	printf("Thin Provisioning:           %s\n",
 		nsdata->nsfeat.thin_prov ? "Supported" : "Not Supported");
 	printf("Number of LBA Formats:       %d\n", nsdata->nlbaf+1);
-	printf("Current LBA Format:          LBA Format #%d\n",
+	printf("Current LBA Format:          LBA Format #%02d\n",
 		nsdata->flbas.format);
-	for (i = 0; i <= nsdata->nlbaf; i++) {
-		printf("LBA Format #%d:\n", i);
-		printf("  LBA Data Size:             %d\n",
-			1 << nsdata->lbaf[i].lbads);
-	}
+	for (i = 0; i <= nsdata->nlbaf; i++)
+		printf("LBA Format #%02d: Data Size: %5d  Metadata Size: %5d\n",
+		    i, 1 << nsdata->lbaf[i].lbads, nsdata->lbaf[i].ms);
 }
 
 static void

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 21:33:13 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 54E341E7;
 Tue,  9 Jul 2013 21:33:13 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 4706B1E25;
 Tue,  9 Jul 2013 21:33:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69LXDoO051351;
 Tue, 9 Jul 2013 21:33:13 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69LXCht051349;
 Tue, 9 Jul 2013 21:33:12 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307092133.r69LXCht051349@svn.freebsd.org>
From: Jim Harris 
Date: Tue, 9 Jul 2013 21:33:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253116 - head/sbin/nvmecontrol
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 21:33:13 -0000

Author: jimharris
Date: Tue Jul  9 21:33:12 2013
New Revision: 253116
URL: http://svnweb.freebsd.org/changeset/base/253116

Log:
  Ensure controller or namespace node name is specified before trying to
  access it.
  
  While here, also fix the identify usage message to show the -v and -x
  parameters.
  
  Sponsored by:	Intel
  MFC after:	3 days

Modified:
  head/sbin/nvmecontrol/identify.c
  head/sbin/nvmecontrol/nvmecontrol.h

Modified: head/sbin/nvmecontrol/identify.c
==============================================================================
--- head/sbin/nvmecontrol/identify.c	Tue Jul  9 21:31:58 2013	(r253115)
+++ head/sbin/nvmecontrol/identify.c	Tue Jul  9 21:33:12 2013	(r253116)
@@ -259,6 +259,10 @@ identify(int argc, char *argv[])
 
 	while (getopt(argc, argv, "vx") != -1) ;
 
+	/* Check that a controller or namespace was specified. */
+	if (optind >= argc)
+		identify_usage();
+
 	target = argv[optind];
 
 	optreset = 1;

Modified: head/sbin/nvmecontrol/nvmecontrol.h
==============================================================================
--- head/sbin/nvmecontrol/nvmecontrol.h	Tue Jul  9 21:31:58 2013	(r253115)
+++ head/sbin/nvmecontrol/nvmecontrol.h	Tue Jul  9 21:33:12 2013	(r253116)
@@ -38,7 +38,7 @@
 "       nvmecontrol devlist\n"
 
 #define IDENTIFY_USAGE							       \
-"       nvmecontrol identify \n"
+"       nvmecontrol identify [-x [-v]] \n"
 
 #define PERFTEST_USAGE							       \
 "       nvmecontrol perftest <-n num_threads> <-o read|write>\n"	       \

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 21:53:58 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 24FB9CCA;
 Tue,  9 Jul 2013 21:53:58 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 170511F3D;
 Tue,  9 Jul 2013 21:53:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69LrviS058972;
 Tue, 9 Jul 2013 21:53:57 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69LrvWY058971;
 Tue, 9 Jul 2013 21:53:57 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201307092153.r69LrvWY058971@svn.freebsd.org>
From: Devin Teske 
Date: Tue, 9 Jul 2013 21:53:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253117 - head/usr.sbin/bsdconfig/share
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 21:53:58 -0000

Author: dteske
Date: Tue Jul  9 21:53:57 2013
New Revision: 253117
URL: http://svnweb.freebsd.org/changeset/base/253117

Log:
  Do two things: First, don't obscure the backtitle. Second, read ~/.dialogrc
  if it exists to determine if use_shadow is true (ON) or false (OFF).
  
  The purpose of determining the value of use_shadow is to know how many lines
  to subtract from the maximum height value in assuring that the backtitle is
  not obscured.
  
  The detriment of obscuring the backtitle is that it provides information
  that is not easily obtained elsewhere. That is the command-line shortcut
  used to access the current menu. As you navigate from one dialog to the
  next, invariably transparently corssing module boundaries, the backtitle
  represents the command-line argument used to get there. Obscuring this
  information with a widget that is too-tall and/or too-wide would see that
  data go unnoticed (leaving few other ways to get that information in the
  same helpful context).
  
  So despite the fact that this change reduces the standard maximum height for
  all widgets, there is a trap-door to prevent this calculation. If you want
  to utilize the full screen height on the terminal (remember, this adjustment
  is not made for Xdialog(1)) you can set $NO_BACKTITLE to 1 (or any non-NULL
  value for that matter) and this calculation will be skipped. You will be
  able to draw a widget that partially obscures the backtitle if-necessary.
  
  MFC after:	1 day

Modified:
  head/usr.sbin/bsdconfig/share/dialog.subr

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/dialog.subr	Tue Jul  9 21:33:12 2013	(r253116)
+++ head/usr.sbin/bsdconfig/share/dialog.subr	Tue Jul  9 21:53:57 2013	(r253117)
@@ -292,7 +292,31 @@ f_dialog_max_size()
 		__max_size=$( stty size 2> /dev/null ) # usually "24 80"
 		: ${__max_size:=$DEFAULT_TERMINAL_SIZE}
 	fi
-	[ "$__var_height" ] && setvar "$__var_height" "${__max_size%%[$IFS]*}"
+	if [ "$__var_height" ]; then
+		local __height="${__max_size%%[$IFS]*}"
+		#
+		# If we're not using Xdialog(1), we should assume that $DIALOG
+		# will render --backtitle behind the widget. In such a case, we
+		# should prevent the widget from obscuring the backtitle (unless
+		# $NO_BACKTITLE is set and non-NULL, allowing a trap-door).
+		#
+		if [ ! "$USE_XDIALOG" ] && [ ! "$NO_BACKTITLE" ]; then
+			#
+			# If use_shadow (in ~/.dialogrc) is OFF, we need to
+			# subtract 4, otherwise 5. However, don't check this
+			# every time, rely on an initialization variable set
+			# by f_dialog_init().
+			#
+			local __adjust=5
+			[ "$NO_SHADOW" ] && __adjust=4
+
+			# Don't adjust the height if already too small (allowing
+			# obscured backtitle for small values of __height).
+			[ ${__height:-0} -gt 11 ] &&
+				__height=$(( $__height - $__adjust ))
+		fi
+		setvar "$__var_height" "$__height"
+	fi
 	[ "$__var_width" ] && setvar "$__var_width" "${__max_size##*[$IFS]}"
 }
 
@@ -1999,6 +2023,12 @@ f_dialog_menutag2index_with_help()
 # 	              that (while running as root) sudo(8) authentication is
 # 	              required to proceed.
 #
+# Also reads ~/.dialogrc for the following information:
+#
+# 	NO_SHADOW     Either NULL or Non-NULL. If use_shadow is OFF (case-
+# 	              insensitive) in ~/.dialogrc this is set to "1" (otherwise
+# 	              unset).
+#
 f_dialog_init()
 {
 	DIALOG_SELF_INITIALIZE=
@@ -2058,6 +2088,22 @@ f_dialog_init()
 	fi
 
 	#
+	# Read ~/.dialogrc (unless using Xdialog(1)) for properties
+	#
+	if [ -f ~/.dialogrc ]; then
+		eval "$(
+			awk -v param=use_shadow -v expect=OFF \
+			    -v set="NO_SHADOW=1" '
+			!/^[[:space:]]*(#|$)/ && \
+			tolower($1) ~ "^"param"(=|$)" && \
+			/[^#]*=/ {
+				sub(/^[^=]*=[[:space:]]*/, "")
+				if ( toupper($1) == expect ) print set";"
+			}' ~/.dialogrc
+		)"
+	fi
+
+	#
 	# If we're already running as root but we got there by way of sudo(8)
 	# and we have X11, we should merge the xauth(1) credentials from our
 	# original user.

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 22:01:05 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id E87D6236;
 Tue,  9 Jul 2013 22:01:05 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id DB0781F91;
 Tue,  9 Jul 2013 22:01:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69M15hO061654;
 Tue, 9 Jul 2013 22:01:05 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69M1554061653;
 Tue, 9 Jul 2013 22:01:05 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201307092201.r69M1554061653@svn.freebsd.org>
From: Devin Teske 
Date: Tue, 9 Jul 2013 22:01:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253118 - head/usr.sbin/bsdconfig/share
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 22:01:06 -0000

Author: dteske
Date: Tue Jul  9 22:01:05 2013
New Revision: 253118
URL: http://svnweb.freebsd.org/changeset/base/253118

Log:
  Fix conditional (der should match the comment above it).
  
  MFC after:	1 day

Modified:
  head/usr.sbin/bsdconfig/share/dialog.subr

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/dialog.subr	Tue Jul  9 21:53:57 2013	(r253117)
+++ head/usr.sbin/bsdconfig/share/dialog.subr	Tue Jul  9 22:01:05 2013	(r253118)
@@ -2090,7 +2090,7 @@ f_dialog_init()
 	#
 	# Read ~/.dialogrc (unless using Xdialog(1)) for properties
 	#
-	if [ -f ~/.dialogrc ]; then
+	if [ -f ~/.dialogrc -a ! "$USE_XDIALOG" ]; then
 		eval "$(
 			awk -v param=use_shadow -v expect=OFF \
 			    -v set="NO_SHADOW=1" '

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 22:04:36 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 43ADE3CD;
 Tue,  9 Jul 2013 22:04:36 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 365C51FBE;
 Tue,  9 Jul 2013 22:04:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69M4aDO062163;
 Tue, 9 Jul 2013 22:04:36 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69M4Zgn062161;
 Tue, 9 Jul 2013 22:04:35 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201307092204.r69M4Zgn062161@svn.freebsd.org>
From: Xin LI 
Date: Tue, 9 Jul 2013 22:04:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253119 - head/sys/crypto/sha2
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 22:04:36 -0000

Author: delphij
Date: Tue Jul  9 22:04:35 2013
New Revision: 253119
URL: http://svnweb.freebsd.org/changeset/base/253119

Log:
  Sync with KAME.
  
  MFC after:	1 month

Modified:
  head/sys/crypto/sha2/sha2.c
  head/sys/crypto/sha2/sha2.h

Modified: head/sys/crypto/sha2/sha2.c
==============================================================================
--- head/sys/crypto/sha2/sha2.c	Tue Jul  9 22:01:05 2013	(r253118)
+++ head/sys/crypto/sha2/sha2.c	Tue Jul  9 22:04:35 2013	(r253119)
@@ -1,4 +1,4 @@
-/*	$KAME: sha2.c,v 1.8 2001/11/08 01:07:52 itojun Exp $	*/
+/*	$KAME: sha2.c,v 1.11 2004/06/02 09:52:45 itojun Exp $	*/
 
 /*
  * sha2.c
@@ -32,6 +32,7 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
+ *
  */
 
 #include 
@@ -67,7 +68,7 @@ __FBSDID("$FreeBSD$");
  *
  */
 
-#if defined(_KERNEL) && (defined(__bsdi__) || defined(__FreeBSD__))
+#if defined(_KERNEL) && defined(__FreeBSD__)
 #define assert(x)
 #else
 #include 
@@ -1051,4 +1052,3 @@ char* SHA384_Data(const sha2_byte* data,
 	SHA384_Update(&context, data, len);
 	return SHA384_End(&context, digest);
 }
-

Modified: head/sys/crypto/sha2/sha2.h
==============================================================================
--- head/sys/crypto/sha2/sha2.h	Tue Jul  9 22:01:05 2013	(r253118)
+++ head/sys/crypto/sha2/sha2.h	Tue Jul  9 22:04:35 2013	(r253119)
@@ -1,5 +1,5 @@
 /*	$FreeBSD$	*/
-/*	$KAME: sha2.h,v 1.3 2001/03/12 08:27:48 itojun Exp $	*/
+/*	$KAME: sha2.h,v 1.5 2007/06/14 12:09:41 itojun Exp $	*/
 
 /*
  * sha2.h
@@ -138,4 +138,3 @@ char* SHA512_Data(const u_int8_t*, size_
 #endif /* __cplusplus */
 
 #endif /* __SHA2_H__ */
-

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 23:12:27 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id A2BCB5A2;
 Tue,  9 Jul 2013 23:12:27 +0000 (UTC)
 (envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 9513712D1;
 Tue,  9 Jul 2013 23:12:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69NCRJo082908;
 Tue, 9 Jul 2013 23:12:27 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69NCQY1082902;
 Tue, 9 Jul 2013 23:12:26 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201307092312.r69NCQY1082902@svn.freebsd.org>
From: Marius Strobl 
Date: Tue, 9 Jul 2013 23:12:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253120 - head/sys/dev/pci
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 23:12:27 -0000

Author: marius
Date: Tue Jul  9 23:12:26 2013
New Revision: 253120
URL: http://svnweb.freebsd.org/changeset/base/253120

Log:
  - As it turns out, not only MSI-X is broken for devices passed through by
    VMware up to at least ESXi 5.1. Actually, using INTx in that case instead
    may still result in interrupt storms, with MSI being the only working
    option in some configurations. So introduce a PCI_QUIRK_DISABLE_MSIX quirk
    which only blacklists MSI-X but not also MSI and use it for the VMware
    PCI-PCI-bridges. Note that, currently, we still assume that if MSI doesn't
    work, MSI-X won't work either - but that's part of the internal logic and
    not guaranteed as part of the API contract. While at it, add and employ
    a pci_has_quirk() helper.
    Reported and tested by: Paul Bucher
  - Use NULL instead of 0 for pointers.
  
  Submitted by:	jhb (mostly)
  Approved by:	jhb
  MFC after:	3 days

Modified:
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pci_pci.c
  head/sys/dev/pci/pcib_private.h
  head/sys/dev/pci/pcivar.h

Modified: head/sys/dev/pci/pci.c
==============================================================================
--- head/sys/dev/pci/pci.c	Tue Jul  9 22:04:35 2013	(r253119)
+++ head/sys/dev/pci/pci.c	Tue Jul  9 23:12:26 2013	(r253120)
@@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$");
 	(((cfg)->hdrtype == PCIM_HDRTYPE_NORMAL && reg == PCIR_BIOS) ||	\
 	 ((cfg)->hdrtype == PCIM_HDRTYPE_BRIDGE && reg == PCIR_BIOS_1))
 
+static int		pci_has_quirk(uint32_t devid, int quirk);
 static pci_addr_t	pci_mapbase(uint64_t mapreg);
 static const char	*pci_maptype(uint64_t mapreg);
 static int		pci_mapsize(uint64_t testval);
@@ -119,6 +120,7 @@ static void		pci_enable_msix(device_t de
 static void		pci_mask_msix(device_t dev, u_int index);
 static void		pci_unmask_msix(device_t dev, u_int index);
 static int		pci_msi_blacklisted(void);
+static int		pci_msix_blacklisted(void);
 static void		pci_resume_msi(device_t dev);
 static void		pci_resume_msix(device_t dev);
 static int		pci_remap_intr_method(device_t bus, device_t dev,
@@ -185,7 +187,7 @@ static device_method_t pci_methods[] = {
 DEFINE_CLASS_0(pci, pci_driver, pci_methods, sizeof(struct pci_softc));
 
 static devclass_t pci_devclass;
-DRIVER_MODULE(pci, pcib, pci_driver, pci_devclass, pci_modevent, 0);
+DRIVER_MODULE(pci, pcib, pci_driver, pci_devclass, pci_modevent, NULL);
 MODULE_VERSION(pci, 1);
 
 static char	*pci_vendordata;
@@ -195,15 +197,16 @@ struct pci_quirk {
 	uint32_t devid;	/* Vendor/device of the card */
 	int	type;
 #define	PCI_QUIRK_MAP_REG	1 /* PCI map register in weird place */
-#define	PCI_QUIRK_DISABLE_MSI	2 /* MSI/MSI-X doesn't work */
+#define	PCI_QUIRK_DISABLE_MSI	2 /* Neither MSI nor MSI-X work */
 #define	PCI_QUIRK_ENABLE_MSI_VM	3 /* Older chipset in VM where MSI works */
 #define	PCI_QUIRK_UNMAP_REG	4 /* Ignore PCI map register */
+#define	PCI_QUIRK_DISABLE_MSIX	5 /* MSI-X doesn't work */
 	int	arg1;
 	int	arg2;
 };
 
 static const struct pci_quirk pci_quirks[] = {
-	/* The Intel 82371AB and 82443MX has a map register at offset 0x90. */
+	/* The Intel 82371AB and 82443MX have a map register at offset 0x90. */
 	{ 0x71138086, PCI_QUIRK_MAP_REG,	0x90,	 0 },
 	{ 0x719b8086, PCI_QUIRK_MAP_REG,	0x90,	 0 },
 	/* As does the Serverworks OSB4 (the SMBus mapping register) */
@@ -238,8 +241,8 @@ static const struct pci_quirk pci_quirks
 	 * MSI-X allocation doesn't work properly for devices passed through
 	 * by VMware up to at least ESXi 5.1.
 	 */
-	{ 0x079015ad, PCI_QUIRK_DISABLE_MSI,	0,	0 }, /* PCI/PCI-X */
-	{ 0x07a015ad, PCI_QUIRK_DISABLE_MSI,	0,	0 }, /* PCIe */
+	{ 0x079015ad, PCI_QUIRK_DISABLE_MSIX,	0,	0 }, /* PCI/PCI-X */
+	{ 0x07a015ad, PCI_QUIRK_DISABLE_MSIX,	0,	0 }, /* PCIe */
 
 	/*
 	 * Some virtualization environments emulate an older chipset
@@ -321,7 +324,7 @@ SYSCTL_INT(_hw_pci, OID_AUTO, enable_msi
 static int pci_honor_msi_blacklist = 1;
 TUNABLE_INT("hw.pci.honor_msi_blacklist", &pci_honor_msi_blacklist);
 SYSCTL_INT(_hw_pci, OID_AUTO, honor_msi_blacklist, CTLFLAG_RD,
-    &pci_honor_msi_blacklist, 1, "Honor chipset blacklist for MSI");
+    &pci_honor_msi_blacklist, 1, "Honor chipset blacklist for MSI/MSI-X");
 
 #if defined(__i386__) || defined(__amd64__)
 static int pci_usb_takeover = 1;
@@ -334,6 +337,18 @@ SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_
 Disable this if you depend on BIOS emulation of USB devices, that is\n\
 you use USB devices (like keyboard or mouse) but do not load USB drivers");
 
+static int
+pci_has_quirk(uint32_t devid, int quirk)
+{
+	const struct pci_quirk *q;
+
+	for (q = &pci_quirks[0]; q->devid; q++) {
+		if (q->devid == devid && q->type == quirk)
+			return (1);
+	}
+	return (0);
+}
+
 /* Find a device_t by bus/slot/function in domain 0 */
 
 device_t
@@ -1426,8 +1441,8 @@ pci_alloc_msix_method(device_t dev, devi
 	if (cfg->msi.msi_alloc != 0 || cfg->msix.msix_alloc != 0)
 		return (ENXIO);
 
-	/* If MSI is blacklisted for this system, fail. */
-	if (pci_msi_blacklisted())
+	/* If MSI-X is blacklisted for this system, fail. */
+	if (pci_msix_blacklisted())
 		return (ENXIO);
 
 	/* MSI-X capability present? */
@@ -1983,38 +1998,15 @@ pci_remap_intr_method(device_t bus, devi
 int
 pci_msi_device_blacklisted(device_t dev)
 {
-	const struct pci_quirk *q;
 
 	if (!pci_honor_msi_blacklist)
 		return (0);
 
-	for (q = &pci_quirks[0]; q->devid; q++) {
-		if (q->devid == pci_get_devid(dev) &&
-		    q->type == PCI_QUIRK_DISABLE_MSI)
-			return (1);
-	}
-	return (0);
-}
-
-/*
- * Returns true if a specified chipset supports MSI when it is
- * emulated hardware in a virtual machine.
- */
-static int
-pci_msi_vm_chipset(device_t dev)
-{
-	const struct pci_quirk *q;
-
-	for (q = &pci_quirks[0]; q->devid; q++) {
-		if (q->devid == pci_get_devid(dev) &&
-		    q->type == PCI_QUIRK_ENABLE_MSI_VM)
-			return (1);
-	}
-	return (0);
+	return (pci_has_quirk(pci_get_devid(dev), PCI_QUIRK_DISABLE_MSI));
 }
 
 /*
- * Determine if MSI is blacklisted globally on this sytem.  Currently,
+ * Determine if MSI is blacklisted globally on this system.  Currently,
  * we just check for blacklisted chipsets as represented by the
  * host-PCI bridge at device 0:0:0.  In the future, it may become
  * necessary to check other system attributes, such as the kenv values
@@ -2031,9 +2023,14 @@ pci_msi_blacklisted(void)
 	/* Blacklist all non-PCI-express and non-PCI-X chipsets. */
 	if (!(pcie_chipset || pcix_chipset)) {
 		if (vm_guest != VM_GUEST_NO) {
+			/*
+			 * Whitelist older chipsets in virtual
+			 * machines known to support MSI.
+			 */
 			dev = pci_find_bsf(0, 0, 0);
 			if (dev != NULL)
-				return (pci_msi_vm_chipset(dev) == 0);
+				return (!pci_has_quirk(pci_get_devid(dev),
+					PCI_QUIRK_ENABLE_MSI_VM));
 		}
 		return (1);
 	}
@@ -2045,6 +2042,45 @@ pci_msi_blacklisted(void)
 }
 
 /*
+ * Returns true if the specified device is blacklisted because MSI-X
+ * doesn't work.  Note that this assumes that if MSI doesn't work,
+ * MSI-X doesn't either.
+ */
+int
+pci_msix_device_blacklisted(device_t dev)
+{
+
+	if (!pci_honor_msi_blacklist)
+		return (0);
+
+	if (pci_has_quirk(pci_get_devid(dev), PCI_QUIRK_DISABLE_MSIX))
+		return (1);
+
+	return (pci_msi_device_blacklisted(dev));
+}
+
+/*
+ * Determine if MSI-X is blacklisted globally on this system.  If MSI
+ * is blacklisted, assume that MSI-X is as well.  Check for additional
+ * chipsets where MSI works but MSI-X does not.
+ */
+static int
+pci_msix_blacklisted(void)
+{
+	device_t dev;
+
+	if (!pci_honor_msi_blacklist)
+		return (0);
+
+	dev = pci_find_bsf(0, 0, 0);
+	if (dev != NULL && pci_has_quirk(pci_get_devid(dev),
+	    PCI_QUIRK_DISABLE_MSIX))
+		return (1);
+
+	return (pci_msi_blacklisted());
+}
+
+/*
  * Attempt to allocate *count MSI messages.  The actual number allocated is
  * returned in *count.  After this function returns, each message will be
  * available to the driver as SYS_RES_IRQ resources starting at a rid 1.

Modified: head/sys/dev/pci/pci_pci.c
==============================================================================
--- head/sys/dev/pci/pci_pci.c	Tue Jul  9 22:04:35 2013	(r253119)
+++ head/sys/dev/pci/pci_pci.c	Tue Jul  9 23:12:26 2013	(r253120)
@@ -100,7 +100,7 @@ static device_method_t pcib_methods[] = 
 static devclass_t pcib_devclass;
 
 DEFINE_CLASS_0(pcib, pcib_driver, pcib_methods, sizeof(struct pcib_softc));
-DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, 0, 0);
+DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL);
 
 #ifdef NEW_PCIB
 /*
@@ -624,6 +624,9 @@ pcib_attach_common(device_t dev)
     if (pci_msi_device_blacklisted(dev))
 	sc->flags |= PCIB_DISABLE_MSI;
 
+    if (pci_msix_device_blacklisted(dev))
+	sc->flags |= PCIB_DISABLE_MSIX;
+
     /*
      * Intel 815, 845 and other chipsets say they are PCI-PCI bridges,
      * but have a ProgIF of 0x80.  The 82801 family (AA, AB, BAM/CAM,
@@ -1379,7 +1382,7 @@ pcib_alloc_msix(device_t pcib, device_t 
 	struct pcib_softc *sc = device_get_softc(pcib);
 	device_t bus;
 
-	if (sc->flags & PCIB_DISABLE_MSI)
+	if (sc->flags & PCIB_DISABLE_MSIX)
 		return (ENXIO);
 	bus = device_get_parent(pcib);
 	return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));

Modified: head/sys/dev/pci/pcib_private.h
==============================================================================
--- head/sys/dev/pci/pcib_private.h	Tue Jul  9 22:04:35 2013	(r253119)
+++ head/sys/dev/pci/pcib_private.h	Tue Jul  9 23:12:26 2013	(r253120)
@@ -91,6 +91,7 @@ struct pcib_softc 
     uint32_t	flags;		/* flags */
 #define	PCIB_SUBTRACTIVE	0x1
 #define	PCIB_DISABLE_MSI	0x2
+#define	PCIB_DISABLE_MSIX	0x4
     uint16_t	command;	/* command register */
     u_int	domain;		/* domain number */
     u_int	pribus;		/* primary bus number */

Modified: head/sys/dev/pci/pcivar.h
==============================================================================
--- head/sys/dev/pci/pcivar.h	Tue Jul  9 22:04:35 2013	(r253119)
+++ head/sys/dev/pci/pcivar.h	Tue Jul  9 23:12:26 2013	(r253120)
@@ -490,6 +490,7 @@ device_t pci_find_class(uint8_t class, u
 int	pci_pending_msix(device_t dev, u_int index);
 
 int	pci_msi_device_blacklisted(device_t dev);
+int	pci_msix_device_blacklisted(device_t dev);
 
 void	pci_ht_map_msi(device_t dev, uint64_t addr);
 

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 23:21:57 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id A73A696D;
 Tue,  9 Jul 2013 23:21:57 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 9AB2E134D;
 Tue,  9 Jul 2013 23:21:57 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69NLvUk085735;
 Tue, 9 Jul 2013 23:21:57 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69NLvjU085734;
 Tue, 9 Jul 2013 23:21:57 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201307092321.r69NLvjU085734@svn.freebsd.org>
From: Devin Teske 
Date: Tue, 9 Jul 2013 23:21:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253121 - head/usr.sbin/bsdconfig/share
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 23:21:57 -0000

Author: dteske
Date: Tue Jul  9 23:21:57 2013
New Revision: 253121
URL: http://svnweb.freebsd.org/changeset/base/253121

Log:
  Adjust comments to fit within 80-columns.

Modified:
  head/usr.sbin/bsdconfig/share/dialog.subr

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/dialog.subr	Tue Jul  9 23:12:26 2013	(r253120)
+++ head/usr.sbin/bsdconfig/share/dialog.subr	Tue Jul  9 23:21:57 2013	(r253121)
@@ -195,8 +195,8 @@ f_dialog_line_sanitize()
 # argument is NULL, the current title is returned.
 #
 # Each time this function is called, a backup of the current values is made
-# allowing a one-time (single-level) restoration of the previous title using the
-# f_dialog_title_restore() function (below).
+# allowing a one-time (single-level) restoration of the previous title using
+# the f_dialog_title_restore() function (below).
 #
 f_dialog_title()
 {
@@ -297,7 +297,7 @@ f_dialog_max_size()
 		#
 		# If we're not using Xdialog(1), we should assume that $DIALOG
 		# will render --backtitle behind the widget. In such a case, we
-		# should prevent the widget from obscuring the backtitle (unless
+		# should prevent a widget from obscuring the backtitle (unless
 		# $NO_BACKTITLE is set and non-NULL, allowing a trap-door).
 		#
 		if [ ! "$USE_XDIALOG" ] && [ ! "$NO_BACKTITLE" ]; then
@@ -310,7 +310,7 @@ f_dialog_max_size()
 			local __adjust=5
 			[ "$NO_SHADOW" ] && __adjust=4
 
-			# Don't adjust the height if already too small (allowing
+			# Don't adjust height if already too small (allowing
 			# obscured backtitle for small values of __height).
 			[ ${__height:-0} -gt 11 ] &&
 				__height=$(( $__height - $__adjust ))

From owner-svn-src-all@FreeBSD.ORG  Tue Jul  9 23:47:29 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id D57DDF1F;
 Tue,  9 Jul 2013 23:47:29 +0000 (UTC)
 (envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id C821E1691;
 Tue,  9 Jul 2013 23:47:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r69NlTmF092047;
 Tue, 9 Jul 2013 23:47:29 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r69NlTVK092043;
 Tue, 9 Jul 2013 23:47:29 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <201307092347.r69NlTVK092043@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 9 Jul 2013 23:47:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253122 - head/sys/dev/random
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 09 Jul 2013 23:47:29 -0000

Author: obrien
Date: Tue Jul  9 23:47:28 2013
New Revision: 253122
URL: http://svnweb.freebsd.org/changeset/base/253122

Log:
  Refactor random_systat to be a *random_systat. This avoids unnecessary
  structure copying in random_ident_hardware(). This change will also help
  further modularization of random(4) subsystem.
  
  Submitted by: arthurmesh@gmail.com
  Reviewed by: obrien
  Obtained from: Juniper Networks

Modified:
  head/sys/dev/random/probe.c
  head/sys/dev/random/randomdev.c
  head/sys/dev/random/randomdev.h
  head/sys/dev/random/randomdev_soft.c

Modified: head/sys/dev/random/probe.c
==============================================================================
--- head/sys/dev/random/probe.c	Tue Jul  9 23:21:57 2013	(r253121)
+++ head/sys/dev/random/probe.c	Tue Jul  9 23:47:28 2013	(r253122)
@@ -61,11 +61,11 @@ extern struct random_systat random_ivy;
 #endif
 
 void
-random_ident_hardware(struct random_systat *systat)
+random_ident_hardware(struct random_systat **systat)
 {
 
 	/* Set default to software */
-	*systat = random_yarrow;
+	*systat = &random_yarrow;
 
 	/* Then go looking for hardware */
 #if defined(__amd64__) || (defined(__i386__) && !defined(PC98))
@@ -76,7 +76,7 @@ random_ident_hardware(struct random_syst
 		enable = 1;
 		TUNABLE_INT_FETCH("hw.nehemiah_rng_enable", &enable);
 		if (enable)
-			*systat = random_nehemiah;
+			*systat = &random_nehemiah;
 	}
 #endif
 #ifdef RDRAND_RNG
@@ -86,7 +86,7 @@ random_ident_hardware(struct random_syst
 		enable = 1;
 		TUNABLE_INT_FETCH("hw.ivy_rng_enable", &enable);
 		if (enable)
-			*systat = random_ivy;
+			*systat = &random_ivy;
 	}
 #endif
 #endif

Modified: head/sys/dev/random/randomdev.c
==============================================================================
--- head/sys/dev/random/randomdev.c	Tue Jul  9 23:21:57 2013	(r253121)
+++ head/sys/dev/random/randomdev.c	Tue Jul  9 23:47:28 2013	(r253122)
@@ -70,7 +70,7 @@ static struct cdevsw random_cdevsw = {
 	.d_name = "random",
 };
 
-struct random_systat random_systat;
+struct random_systat *random_systat;
 
 /* For use with make_dev(9)/destroy_dev(9). */
 static struct cdev *random_dev;
@@ -88,8 +88,8 @@ random_close(struct cdev *dev __unused, 
 {
 	if ((flags & FWRITE) && (priv_check(td, PRIV_RANDOM_RESEED) == 0)
 	    && (securelevel_gt(td->td_ucred, 0) == 0)) {
-		(*random_systat.reseed)();
-		random_systat.seeded = 1;
+		(*random_systat->reseed)();
+		random_systat->seeded = 1;
 		arc4rand(NULL, 0, 1);	/* Reseed arc4random as well. */
 	}
 
@@ -104,8 +104,8 @@ random_read(struct cdev *dev __unused, s
 	void *random_buf;
 
 	/* Blocking logic */
-	if (!random_systat.seeded)
-		error = (*random_systat.block)(flag);
+	if (!random_systat->seeded)
+		error = (*random_systat->block)(flag);
 
 	/* The actual read */
 	if (!error) {
@@ -114,7 +114,7 @@ random_read(struct cdev *dev __unused, s
 
 		while (uio->uio_resid > 0 && !error) {
 			c = MIN(uio->uio_resid, PAGE_SIZE);
-			c = (*random_systat.read)(random_buf, c);
+			c = (*random_systat->read)(random_buf, c);
 			error = uiomove(random_buf, c, uio);
 		}
 
@@ -139,7 +139,7 @@ random_write(struct cdev *dev __unused, 
 		error = uiomove(random_buf, c, uio);
 		if (error)
 			break;
-		(*random_systat.write)(random_buf, c);
+		(*random_systat->write)(random_buf, c);
 	}
 
 	free(random_buf, M_TEMP);
@@ -172,10 +172,10 @@ random_poll(struct cdev *dev __unused, i
 	int revents = 0;
 
 	if (events & (POLLIN | POLLRDNORM)) {
-		if (random_systat.seeded)
+		if (random_systat->seeded)
 			revents = events & (POLLIN | POLLRDNORM);
 		else
-			revents = (*random_systat.poll) (events,td);
+			revents = (*random_systat->poll) (events,td);
 	}
 	return (revents);
 }
@@ -189,11 +189,11 @@ random_modevent(module_t mod __unused, i
 	switch (type) {
 	case MOD_LOAD:
 		random_ident_hardware(&random_systat);
-		(*random_systat.init)();
+		(*random_systat->init)();
 
 		if (bootverbose)
 			printf("random: \n",
-			    random_systat.ident);
+			    random_systat->ident);
 
 		random_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &random_cdevsw,
 		    RANDOM_MINOR, NULL, UID_ROOT, GID_WHEEL, 0666, "random");
@@ -202,7 +202,7 @@ random_modevent(module_t mod __unused, i
 		break;
 
 	case MOD_UNLOAD:
-		(*random_systat.deinit)();
+		(*random_systat->deinit)();
 
 		destroy_dev(random_dev);
 

Modified: head/sys/dev/random/randomdev.h
==============================================================================
--- head/sys/dev/random/randomdev.h	Tue Jul  9 23:21:57 2013	(r253121)
+++ head/sys/dev/random/randomdev.h	Tue Jul  9 23:47:28 2013	(r253122)
@@ -51,7 +51,7 @@ struct random_systat {
 	random_reseed_func_t	*reseed;
 };
 
-extern struct random_systat random_systat;
+extern struct random_systat *random_systat;
 
-extern void random_ident_hardware(struct random_systat *);
+extern void random_ident_hardware(struct random_systat **);
 extern void random_null_func(void);

Modified: head/sys/dev/random/randomdev_soft.c
==============================================================================
--- head/sys/dev/random/randomdev_soft.c	Tue Jul  9 23:21:57 2013	(r253121)
+++ head/sys/dev/random/randomdev_soft.c	Tue Jul  9 23:47:28 2013	(r253122)
@@ -138,7 +138,7 @@ random_yarrow_init(void)
 	SYSCTL_ADD_PROC(&random_clist,
 	    SYSCTL_CHILDREN(random_sys_o),
 	    OID_AUTO, "seeded", CTLTYPE_INT | CTLFLAG_RW,
-	    &random_systat.seeded, 1, random_check_boolean, "I",
+	    &random_systat->seeded, 1, random_check_boolean, "I",
 	    "Seeded State");
 
 	random_sys_harvest_o = SYSCTL_ADD_NODE(&random_clist,
@@ -362,10 +362,10 @@ random_yarrow_write(void *buf, int count
 void
 random_yarrow_unblock(void)
 {
-	if (!random_systat.seeded) {
-		random_systat.seeded = 1;
-		selwakeuppri(&random_systat.rsel, PUSER);
-		wakeup(&random_systat);
+	if (!random_systat->seeded) {
+		random_systat->seeded = 1;
+		selwakeuppri(&random_systat->rsel, PUSER);
+		wakeup(random_systat);
 	}
 	(void)atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_NONE,
 	    ARC4_ENTR_HAVE);
@@ -377,10 +377,10 @@ random_yarrow_poll(int events, struct th
 	int revents = 0;
 	mtx_lock(&random_reseed_mtx);
 
-	if (random_systat.seeded)
+	if (random_systat->seeded)
 		revents = events & (POLLIN | POLLRDNORM);
 	else
-		selrecord(td, &random_systat.rsel);
+		selrecord(td, &random_systat->rsel);
 
 	mtx_unlock(&random_reseed_mtx);
 	return revents;
@@ -394,12 +394,12 @@ random_yarrow_block(int flag)
 	mtx_lock(&random_reseed_mtx);
 
 	/* Blocking logic */
-	while (!random_systat.seeded && !error) {
+	while (!random_systat->seeded && !error) {
 		if (flag & O_NONBLOCK)
 			error = EWOULDBLOCK;
 		else {
 			printf("Entropy device is blocking.\n");
-			error = msleep(&random_systat,
+			error = msleep(random_systat,
 			    &random_reseed_mtx,
 			    PUSER | PCATCH, "block", 0);
 		}

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 00:31:29 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 89E22AE2;
 Wed, 10 Jul 2013 00:31:29 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 640C018D7;
 Wed, 10 Jul 2013 00:31:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A0VTMX006223;
 Wed, 10 Jul 2013 00:31:29 GMT
 (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A0VTLC006222;
 Wed, 10 Jul 2013 00:31:29 GMT
 (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201307100031.r6A0VTLC006222@svn.freebsd.org>
From: Rick Macklem 
Date: Wed, 10 Jul 2013 00:31:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253124 - stable/9/sys/fs/nfsclient
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 00:31:29 -0000

Author: rmacklem
Date: Wed Jul 10 00:31:28 2013
New Revision: 253124
URL: http://svnweb.freebsd.org/changeset/base/253124

Log:
  MFC: r252528
  A problem with the old NFS client where large writes to large files
  would sometimes result in a corrupted file was reported via email.
  This problem appears to have been caused by r251719 (reverting
  r251719 fixed the problem). Although I have not been able to
  reproduce this problem, I suspect it is caused by another thread
  increasing np->n_size after the mtx_unlock(&np->n_mtx) but before
  the vnode_pager_setsize() call. Since the np->n_mtx mutex serializes
  updates to np->n_size, doing the vnode_pager_setsize() with the
  mutex locked appears to avoid the problem.
  Unfortunately, vnode_pager_setsize() where the new size is smaller,
  cannot be called with a mutex held.
  This patch returns the semantics to be close to pre-r251719 (actually
  pre-r248567, r248581, r248567 for the new client) such that the call to
  vnode_pager_setsize() is only delayed until after the mutex is
  unlocked when np->n_size is shrinking. Since the file is growing
  when being written, I believe this will fix the corruption.
  A better solution might be to replace the mutex with a sleep lock,
  but that is a non-trivial conversion, so this fix is hoped to be
  sufficient in the meantime.
  
  Tested by:	remy.nonnenmacher@activnetworks.com

Modified:
  stable/9/sys/fs/nfsclient/nfs_clport.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- stable/9/sys/fs/nfsclient/nfs_clport.c	Tue Jul  9 23:54:43 2013	(r253123)
+++ stable/9/sys/fs/nfsclient/nfs_clport.c	Wed Jul 10 00:31:28 2013	(r253124)
@@ -439,6 +439,7 @@ nfscl_loadattrcache(struct vnode **vpp, 
 				vap->va_size = np->n_size;
 				np->n_attrstamp = 0;
 				KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
+				vnode_pager_setsize(vp, np->n_size);
 			} else if (np->n_flag & NMODIFIED) {
 				/*
 				 * We've modified the file: Use the larger
@@ -450,12 +451,22 @@ nfscl_loadattrcache(struct vnode **vpp, 
 					np->n_size = vap->va_size;
 					np->n_flag |= NSIZECHANGED;
 				}
+				vnode_pager_setsize(vp, np->n_size);
+			} else if (vap->va_size < np->n_size) {
+				/*
+				 * When shrinking the size, the call to
+				 * vnode_pager_setsize() cannot be done
+				 * with the mutex held, so delay it until
+				 * after the mtx_unlock call.
+				 */
+				nsize = np->n_size = vap->va_size;
+				np->n_flag |= NSIZECHANGED;
+				setnsize = 1;
 			} else {
 				np->n_size = vap->va_size;
 				np->n_flag |= NSIZECHANGED;
+				vnode_pager_setsize(vp, np->n_size);
 			}
-			setnsize = 1;
-			nsize = vap->va_size;
 		} else {
 			np->n_size = vap->va_size;
 		}

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 01:26:23 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 7AEEE5F8;
 Wed, 10 Jul 2013 01:26:23 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 6D65A1A84;
 Wed, 10 Jul 2013 01:26:23 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A1QNBC022371;
 Wed, 10 Jul 2013 01:26:23 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A1QNem022370;
 Wed, 10 Jul 2013 01:26:23 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307100126.r6A1QNem022370@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jul 2013 01:26:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253126 - stable/9/sys/dev/bge
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 01:26:23 -0000

Author: yongari
Date: Wed Jul 10 01:26:22 2013
New Revision: 253126
URL: http://svnweb.freebsd.org/changeset/base/253126

Log:
  MFC r252227:
    Don't blidly clear GPIOs configuration. Just use firmware configured
    one.  This change also fixes non-working traffic LED on BCM57780.

Modified:
  stable/9/sys/dev/bge/if_bge.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/bge/if_bge.c
==============================================================================
--- stable/9/sys/dev/bge/if_bge.c	Wed Jul 10 00:36:02 2013	(r253125)
+++ stable/9/sys/dev/bge/if_bge.c	Wed Jul 10 01:26:22 2013	(r253126)
@@ -2401,7 +2401,7 @@ bge_blockinit(struct bge_softc *sc)
 	DELAY(40);
 
 	/* Set misc. local control, enable interrupts on attentions */
-	CSR_WRITE_4(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN);
+	BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN);
 
 #ifdef notdef
 	/* Assert GPIO pins for PHY reset */

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 01:27:06 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 1791C728;
 Wed, 10 Jul 2013 01:27:06 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 09DF81A8D;
 Wed, 10 Jul 2013 01:27:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A1R5QV022499;
 Wed, 10 Jul 2013 01:27:05 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A1R5Xk022498;
 Wed, 10 Jul 2013 01:27:05 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307100127.r6A1R5Xk022498@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jul 2013 01:27:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253127 - stable/8/sys/dev/bge
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 01:27:06 -0000

Author: yongari
Date: Wed Jul 10 01:27:05 2013
New Revision: 253127
URL: http://svnweb.freebsd.org/changeset/base/253127

Log:
  MFC r252227:
    Don't blidly clear GPIOs configuration. Just use firmware configured
    one.  This change also fixes non-working traffic LED on BCM57780.

Modified:
  stable/8/sys/dev/bge/if_bge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/bge/   (props changed)

Modified: stable/8/sys/dev/bge/if_bge.c
==============================================================================
--- stable/8/sys/dev/bge/if_bge.c	Wed Jul 10 01:26:22 2013	(r253126)
+++ stable/8/sys/dev/bge/if_bge.c	Wed Jul 10 01:27:05 2013	(r253127)
@@ -2400,7 +2400,7 @@ bge_blockinit(struct bge_softc *sc)
 	DELAY(40);
 
 	/* Set misc. local control, enable interrupts on attentions */
-	CSR_WRITE_4(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN);
+	BGE_SETBIT(sc, BGE_MISC_LOCAL_CTL, BGE_MLC_INTR_ONATTN);
 
 #ifdef notdef
 	/* Assert GPIO pins for PHY reset */

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 01:29:51 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id E871396B;
 Wed, 10 Jul 2013 01:29:51 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id DB8911AA6;
 Wed, 10 Jul 2013 01:29:51 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A1TpLM022881;
 Wed, 10 Jul 2013 01:29:51 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A1Tprw022876;
 Wed, 10 Jul 2013 01:29:51 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307100129.r6A1Tprw022876@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jul 2013 01:29:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253128 - stable/9/sys/dev/bce
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 01:29:52 -0000

Author: yongari
Date: Wed Jul 10 01:29:51 2013
New Revision: 253128
URL: http://svnweb.freebsd.org/changeset/base/253128

Log:
  MFC r252402:
    Fix triggering false watchdog timeout when controller is in PAUSE
    state.  Previously it used to check if controller has sent a
    PAUSE frame to the remote peer.

Modified:
  stable/9/sys/dev/bce/if_bce.c
  stable/9/sys/dev/bce/if_bcereg.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/bce/if_bce.c
==============================================================================
--- stable/9/sys/dev/bce/if_bce.c	Wed Jul 10 01:27:05 2013	(r253127)
+++ stable/9/sys/dev/bce/if_bce.c	Wed Jul 10 01:29:51 2013	(r253128)
@@ -2077,10 +2077,12 @@ bce_miibus_statchg(device_t dev)
 		DBPRINT(sc, BCE_INFO_PHY,
 		    "%s(): Enabling RX flow control.\n", __FUNCTION__);
 		BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN);
+		sc->bce_flags |= BCE_USING_RX_FLOW_CONTROL;
 	} else {
 		DBPRINT(sc, BCE_INFO_PHY,
 		    "%s(): Disabling RX flow control.\n", __FUNCTION__);
 		BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN);
+		sc->bce_flags &= ~BCE_USING_RX_FLOW_CONTROL;
 	}
 
 	if ((IFM_OPTIONS(media_active) & IFM_ETH_TXPAUSE) != 0) {
@@ -7828,18 +7830,42 @@ bce_ioctl(struct ifnet *ifp, u_long comm
 static void
 bce_watchdog(struct bce_softc *sc)
 {
+	uint32_t status;
+
 	DBENTER(BCE_EXTREME_SEND);
 
 	BCE_LOCK_ASSERT(sc);
 
+	status = 0;
 	/* If the watchdog timer hasn't expired then just exit. */
 	if (sc->watchdog_timer == 0 || --sc->watchdog_timer)
 		goto bce_watchdog_exit;
 
+	status = REG_RD(sc, BCE_EMAC_RX_STATUS);
 	/* If pause frames are active then don't reset the hardware. */
-	/* ToDo: Should we reset the timer here? */
-	if (REG_RD(sc, BCE_EMAC_TX_STATUS) & BCE_EMAC_TX_STATUS_XOFFED)
-		goto bce_watchdog_exit;
+	if ((sc->bce_flags & BCE_USING_RX_FLOW_CONTROL) != 0) {
+		if ((status & BCE_EMAC_RX_STATUS_FFED) != 0) {
+			/*
+			 * If link partner has us in XOFF state then wait for
+			 * the condition to clear.
+			 */
+			sc->watchdog_timer = BCE_TX_TIMEOUT;
+			goto bce_watchdog_exit;
+		} else if ((status & BCE_EMAC_RX_STATUS_FF_RECEIVED) != 0 &&
+			(status & BCE_EMAC_RX_STATUS_N_RECEIVED) != 0) {
+			/*
+			 * If we're not currently XOFF'ed but have recently
+			 * been XOFF'd/XON'd then assume that's delaying TX
+			 * this time around.
+			 */
+			sc->watchdog_timer = BCE_TX_TIMEOUT;
+			goto bce_watchdog_exit;
+		}
+		/*
+		 * Any other condition is unexpected and the controller
+		 * should be reset.
+		 */
+	}
 
 	BCE_PRINTF("%s(%d): Watchdog timeout occurred, resetting!\n",
 	    __FILE__, __LINE__);
@@ -7863,6 +7889,7 @@ bce_watchdog(struct bce_softc *sc)
 	sc->bce_ifp->if_oerrors++;
 
 bce_watchdog_exit:
+	REG_WR(sc, BCE_EMAC_RX_STATUS, status);
 	DBEXIT(BCE_EXTREME_SEND);
 }
 

Modified: stable/9/sys/dev/bce/if_bcereg.h
==============================================================================
--- stable/9/sys/dev/bce/if_bcereg.h	Wed Jul 10 01:27:05 2013	(r253127)
+++ stable/9/sys/dev/bce/if_bcereg.h	Wed Jul 10 01:29:51 2013	(r253128)
@@ -6466,6 +6466,7 @@ struct bce_softc
 #define BCE_USING_MSIX_FLAG			0x00000100
 #define BCE_PCIE_FLAG				0x00000200
 #define BCE_USING_TX_FLOW_CONTROL		0x00000400
+#define BCE_USING_RX_FLOW_CONTROL		0x00000800
 
 	/* Controller capability flags. */
 	u32			bce_cap_flags;

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 01:30:36 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 6ABA5AA7;
 Wed, 10 Jul 2013 01:30:36 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 5D6FC1AB3;
 Wed, 10 Jul 2013 01:30:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A1UaTJ023120;
 Wed, 10 Jul 2013 01:30:36 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A1Uap3023118;
 Wed, 10 Jul 2013 01:30:36 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307100130.r6A1Uap3023118@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jul 2013 01:30:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253129 - stable/8/sys/dev/bce
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 01:30:36 -0000

Author: yongari
Date: Wed Jul 10 01:30:35 2013
New Revision: 253129
URL: http://svnweb.freebsd.org/changeset/base/253129

Log:
  MFC r252402:
    Fix triggering false watchdog timeout when controller is in PAUSE
    state.  Previously it used to check if controller has sent a
    PAUSE frame to the remote peer.

Modified:
  stable/8/sys/dev/bce/if_bce.c
  stable/8/sys/dev/bce/if_bcereg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/bce/   (props changed)

Modified: stable/8/sys/dev/bce/if_bce.c
==============================================================================
--- stable/8/sys/dev/bce/if_bce.c	Wed Jul 10 01:29:51 2013	(r253128)
+++ stable/8/sys/dev/bce/if_bce.c	Wed Jul 10 01:30:35 2013	(r253129)
@@ -2097,10 +2097,12 @@ bce_miibus_statchg(device_t dev)
 		DBPRINT(sc, BCE_INFO_PHY,
 		    "%s(): Enabling RX flow control.\n", __FUNCTION__);
 		BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN);
+		sc->bce_flags |= BCE_USING_RX_FLOW_CONTROL;
 	} else {
 		DBPRINT(sc, BCE_INFO_PHY,
 		    "%s(): Disabling RX flow control.\n", __FUNCTION__);
 		BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN);
+		sc->bce_flags &= ~BCE_USING_RX_FLOW_CONTROL;
 	}
 
 	if ((IFM_OPTIONS(media_active) & IFM_ETH_TXPAUSE) != 0) {
@@ -7889,18 +7891,42 @@ bce_ioctl(struct ifnet *ifp, u_long comm
 static void
 bce_watchdog(struct bce_softc *sc)
 {
+	uint32_t status;
+
 	DBENTER(BCE_EXTREME_SEND);
 
 	BCE_LOCK_ASSERT(sc);
 
+	status = 0;
 	/* If the watchdog timer hasn't expired then just exit. */
 	if (sc->watchdog_timer == 0 || --sc->watchdog_timer)
 		goto bce_watchdog_exit;
 
+	status = REG_RD(sc, BCE_EMAC_RX_STATUS);
 	/* If pause frames are active then don't reset the hardware. */
-	/* ToDo: Should we reset the timer here? */
-	if (REG_RD(sc, BCE_EMAC_TX_STATUS) & BCE_EMAC_TX_STATUS_XOFFED)
-		goto bce_watchdog_exit;
+	if ((sc->bce_flags & BCE_USING_RX_FLOW_CONTROL) != 0) {
+		if ((status & BCE_EMAC_RX_STATUS_FFED) != 0) {
+			/*
+			 * If link partner has us in XOFF state then wait for
+			 * the condition to clear.
+			 */
+			sc->watchdog_timer = BCE_TX_TIMEOUT;
+			goto bce_watchdog_exit;
+		} else if ((status & BCE_EMAC_RX_STATUS_FF_RECEIVED) != 0 &&
+			(status & BCE_EMAC_RX_STATUS_N_RECEIVED) != 0) {
+			/*
+			 * If we're not currently XOFF'ed but have recently
+			 * been XOFF'd/XON'd then assume that's delaying TX
+			 * this time around.
+			 */
+			sc->watchdog_timer = BCE_TX_TIMEOUT;
+			goto bce_watchdog_exit;
+		}
+		/*
+		 * Any other condition is unexpected and the controller
+		 * should be reset.
+		 */
+	}
 
 	BCE_PRINTF("%s(%d): Watchdog timeout occurred, resetting!\n",
 	    __FILE__, __LINE__);
@@ -7924,6 +7950,7 @@ bce_watchdog(struct bce_softc *sc)
 	sc->bce_ifp->if_oerrors++;
 
 bce_watchdog_exit:
+	REG_WR(sc, BCE_EMAC_RX_STATUS, status);
 	DBEXIT(BCE_EXTREME_SEND);
 }
 

Modified: stable/8/sys/dev/bce/if_bcereg.h
==============================================================================
--- stable/8/sys/dev/bce/if_bcereg.h	Wed Jul 10 01:29:51 2013	(r253128)
+++ stable/8/sys/dev/bce/if_bcereg.h	Wed Jul 10 01:30:35 2013	(r253129)
@@ -6470,6 +6470,7 @@ struct bce_softc
 #define BCE_USING_MSIX_FLAG			0x00000100
 #define BCE_PCIE_FLAG				0x00000200
 #define BCE_USING_TX_FLOW_CONTROL		0x00000400
+#define BCE_USING_RX_FLOW_CONTROL		0x00000800
 
 	/* Controller capability flags. */
 	u32			bce_cap_flags;

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 01:32:58 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id E639EDCB;
 Wed, 10 Jul 2013 01:32:58 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id BEC8B1AD8;
 Wed, 10 Jul 2013 01:32:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A1WwWU025099;
 Wed, 10 Jul 2013 01:32:58 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A1WwTC025097;
 Wed, 10 Jul 2013 01:32:58 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307100132.r6A1WwTC025097@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jul 2013 01:32:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253130 - stable/9/sys/dev/bge
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 01:32:59 -0000

Author: yongari
Date: Wed Jul 10 01:32:58 2013
New Revision: 253130
URL: http://svnweb.freebsd.org/changeset/base/253130

Log:
  MFC r252404:
    Fix triggering false watchdog timeout as done in bce(4) when
    controller is in PAUSE state.

Modified:
  stable/9/sys/dev/bge/if_bge.c
  stable/9/sys/dev/bge/if_bgereg.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/bge/if_bge.c
==============================================================================
--- stable/9/sys/dev/bge/if_bge.c	Wed Jul 10 01:30:35 2013	(r253129)
+++ stable/9/sys/dev/bge/if_bge.c	Wed Jul 10 01:32:58 2013	(r253130)
@@ -5296,7 +5296,7 @@ bge_start_locked(struct ifnet *ifp)
 		/*
 		 * Set a timeout in case the chip goes out to lunch.
 		 */
-		sc->bge_timer = 5;
+		sc->bge_timer = BGE_TX_TIMEOUT;
 	}
 }
 
@@ -5801,12 +5801,40 @@ static void
 bge_watchdog(struct bge_softc *sc)
 {
 	struct ifnet *ifp;
+	uint32_t status;
 
 	BGE_LOCK_ASSERT(sc);
 
 	if (sc->bge_timer == 0 || --sc->bge_timer)
 		return;
 
+	/* If pause frames are active then don't reset the hardware. */
+	if ((CSR_READ_4(sc, BGE_RX_MODE) & BGE_RXMODE_FLOWCTL_ENABLE) != 0) {
+		status = CSR_READ_4(sc, BGE_RX_STS);
+		if ((status & BGE_RXSTAT_REMOTE_XOFFED) != 0) {
+			/*
+			 * If link partner has us in XOFF state then wait for
+			 * the condition to clear.
+			 */
+			CSR_WRITE_4(sc, BGE_RX_STS, status);
+			sc->bge_timer = BGE_TX_TIMEOUT;
+			return;
+		} else if ((status & BGE_RXSTAT_RCVD_XOFF) != 0 &&
+		    (status & BGE_RXSTAT_RCVD_XON) != 0) {
+			/*
+			 * If link partner has us in XOFF state then wait for
+			 * the condition to clear.
+			 */
+			CSR_WRITE_4(sc, BGE_RX_STS, status);
+			sc->bge_timer = BGE_TX_TIMEOUT;
+			return;
+		}
+		/*
+		 * Any other condition is unexpected and the controller
+		 * should be reset.
+		 */
+	}
+
 	ifp = sc->bge_ifp;
 
 	if_printf(ifp, "watchdog timeout -- resetting\n");

Modified: stable/9/sys/dev/bge/if_bgereg.h
==============================================================================
--- stable/9/sys/dev/bge/if_bgereg.h	Wed Jul 10 01:30:35 2013	(r253129)
+++ stable/9/sys/dev/bge/if_bgereg.h	Wed Jul 10 01:32:58 2013	(r253130)
@@ -2928,6 +2928,7 @@ struct bge_dmamap_arg {
 #define	BGE_HWREV_TIGON_II	0x02
 #define	BGE_TIMEOUT		100000
 #define	BGE_TXCONS_UNSET		0xFFFF	/* impossible value */
+#define	BGE_TX_TIMEOUT		5
 
 struct bge_bcom_hack {
 	int			reg;

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 01:33:50 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 17A4EF11;
 Wed, 10 Jul 2013 01:33:50 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id E3DD51AE9;
 Wed, 10 Jul 2013 01:33:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A1Xn5a025295;
 Wed, 10 Jul 2013 01:33:49 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A1Xnkc025293;
 Wed, 10 Jul 2013 01:33:49 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307100133.r6A1Xnkc025293@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jul 2013 01:33:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253131 - stable/8/sys/dev/bge
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 01:33:50 -0000

Author: yongari
Date: Wed Jul 10 01:33:49 2013
New Revision: 253131
URL: http://svnweb.freebsd.org/changeset/base/253131

Log:
  MFC r252404:
    Fix triggering false watchdog timeout as done in bce(4) when
    controller is in PAUSE state.

Modified:
  stable/8/sys/dev/bge/if_bge.c
  stable/8/sys/dev/bge/if_bgereg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/bge/   (props changed)

Modified: stable/8/sys/dev/bge/if_bge.c
==============================================================================
--- stable/8/sys/dev/bge/if_bge.c	Wed Jul 10 01:32:58 2013	(r253130)
+++ stable/8/sys/dev/bge/if_bge.c	Wed Jul 10 01:33:49 2013	(r253131)
@@ -5309,7 +5309,7 @@ bge_start_locked(struct ifnet *ifp)
 		/*
 		 * Set a timeout in case the chip goes out to lunch.
 		 */
-		sc->bge_timer = 5;
+		sc->bge_timer = BGE_TX_TIMEOUT;
 	}
 }
 
@@ -5814,12 +5814,40 @@ static void
 bge_watchdog(struct bge_softc *sc)
 {
 	struct ifnet *ifp;
+	uint32_t status;
 
 	BGE_LOCK_ASSERT(sc);
 
 	if (sc->bge_timer == 0 || --sc->bge_timer)
 		return;
 
+	/* If pause frames are active then don't reset the hardware. */
+	if ((CSR_READ_4(sc, BGE_RX_MODE) & BGE_RXMODE_FLOWCTL_ENABLE) != 0) {
+		status = CSR_READ_4(sc, BGE_RX_STS);
+		if ((status & BGE_RXSTAT_REMOTE_XOFFED) != 0) {
+			/*
+			 * If link partner has us in XOFF state then wait for
+			 * the condition to clear.
+			 */
+			CSR_WRITE_4(sc, BGE_RX_STS, status);
+			sc->bge_timer = BGE_TX_TIMEOUT;
+			return;
+		} else if ((status & BGE_RXSTAT_RCVD_XOFF) != 0 &&
+		    (status & BGE_RXSTAT_RCVD_XON) != 0) {
+			/*
+			 * If link partner has us in XOFF state then wait for
+			 * the condition to clear.
+			 */
+			CSR_WRITE_4(sc, BGE_RX_STS, status);
+			sc->bge_timer = BGE_TX_TIMEOUT;
+			return;
+		}
+		/*
+		 * Any other condition is unexpected and the controller
+		 * should be reset.
+		 */
+	}
+
 	ifp = sc->bge_ifp;
 
 	if_printf(ifp, "watchdog timeout -- resetting\n");

Modified: stable/8/sys/dev/bge/if_bgereg.h
==============================================================================
--- stable/8/sys/dev/bge/if_bgereg.h	Wed Jul 10 01:32:58 2013	(r253130)
+++ stable/8/sys/dev/bge/if_bgereg.h	Wed Jul 10 01:33:49 2013	(r253131)
@@ -2928,6 +2928,7 @@ struct bge_dmamap_arg {
 #define	BGE_HWREV_TIGON_II	0x02
 #define	BGE_TIMEOUT		100000
 #define	BGE_TXCONS_UNSET		0xFFFF	/* impossible value */
+#define	BGE_TX_TIMEOUT		5
 
 struct bge_bcom_hack {
 	int			reg;

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 04:48:48 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 2086D69;
 Wed, 10 Jul 2013 04:48:48 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au
 [211.29.132.249])
 by mx1.freebsd.org (Postfix) with ESMTP id 8DDB61263;
 Wed, 10 Jul 2013 04:48:47 +0000 (UTC)
Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au
 (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23])
 by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 26F2A104287D;
 Wed, 10 Jul 2013 14:48:35 +1000 (EST)
Date: Wed, 10 Jul 2013 14:48:34 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Jim Harris 
Subject: Re: svn commit: r252672 - head/sbin/nvmecontrol
In-Reply-To: 
Message-ID: <20130710132921.C1142@besplex.bde.org>
References: <201307040026.r640QOCd079203@svn.freebsd.org>
 <20130704105843.B982@besplex.bde.org>
 <20130706184249.GD25842@garage.freebsd.pl>
 <20130706195108.GA34684@stack.nl> <20130707114237.L897@besplex.bde.org>
 
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.0 cv=eqSHVfVX c=1 sm=1 a=RvpeemXtX5oA:10
 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=X2rCv88ZkwkA:10
 a=AfsLrsXV64LQ2t5jXzMA:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117
Cc: src-committers@freebsd.org, Pawel Jakub Dawidek ,
 Jilles Tjoelker , svn-src-all@freebsd.org,
 Bruce Evans , svn-src-head@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 04:48:48 -0000

On Tue, 9 Jul 2013, Jim Harris wrote:

> On Sat, Jul 6, 2013 at 7:26 PM, Bruce Evans  wrote:
>
>> On Sat, 6 Jul 2013, Jilles Tjoelker wrote:
>>
>>  On Sat, Jul 06, 2013 at 08:42:49PM +0200, Pawel Jakub Dawidek wrote:
>[>]* ...
>>>  Bruce, until sysexits(3) doesn't explicitly say it shouldn't be used,
>>>> please stop calling this a bug, because you are just confusing people.
>>>> At this point sysexits(3) actually even suggests it is blessed by
>>>> style(9). This is how it starts:
>>>
>>>          According to style(9), it is not a good practice to call exit(3)
>>>>         with arbitrary values to indicate a failure condition when
>>>>         ending a program. Instead, the pre-defined exit codes from
>>>>         sysexits should be used, so the caller of the process can get a
>>>>         rough estimation about the failure class without looking up the
>>>>         source code.
>>>
>> This is just another bug in sysexits(3).  This is not according to
>> style(9), since style(9) was fixed to not say that after I complained
>> previously :-).  It has never been normal practice to use sysexits(3),
>> but someone who likes it added recommendations to use it to style(9) when
>> they added the man pages for sysexits(3).  Before that, it was
>> so rarely used that it had no man page.
>
> To add to the areas of confusion already stated in this thread, err(3)
> explicitly recommends using sysexits(3) and uses it in all of the examples.

Hmm, that isn't in err(3) in the old version of FreeBSD that I use.

> I decided to use 0/1 instead of sysexits since it seems most appropriate
> based on the discussion here and other examples in sbin.  I incorporated
> these changes as well as addressing some of Bruce's other feedback in
> r253109.

Thanks.

The examples in err(3) always were bad.  They currently are:

% EXAMPLES
%      Display the current errno information string and exit:
% 
%            if ((p = malloc(size)) == NULL)
%                    err(EX_OSERR, NULL);

This has no string at all.  Use of err() and EX_OSERR are wrong too,
or at least a style bug and gratuitously unportable.  In Standard C,
malloc() is not specified to set errno.  In POSIX it is specified to
set errno to ENOMEM iff it fails.  The POSIX setting of errno just
allows sloppy code like the above to work -- ENOMEM will be translated
to "Cannot allocate memory" by err().

Normal style is to not depend on this and print the more specific
message "malloc failed" using errx().  Note that err() is not
sophisticated enough to print a good message following "malloc failed".
'err(1, "malloc failed")' would print "foo: malloc failed: Cannot
allocate memory\n").  This is missing a " (duh)" after the redundant
"Cannot allocate memory".

In $(find /usr/src/*bin -name *.c), there are 136 lines matching
"malloc f":
- 17 of these lines use precisely warnx("malloc failed").
- 49 use precisely errx(1, "malloc failed").
All these have normal style.
- 13 mire use errx(), with assorted bugs and style bugs:
   - 2 have a bogus newline at the end of the string
   - 4 say "failure" instead of "failed"
   - 1 says "malloc for continent submenu"
   - 1 says "malloc for submenu"
   - 1 says "kern.consile malloc failed"
   - 3 use EX_OSERR
   - 1 uses unusual whitespace
- 10 use printf or fprintf.  Most of these print the normal message
   "malloc failed" and not much more.  The only obvious stle bug is
   that 4 of these terminate the message with a "."
Most of the remaining 47 have style bugs:
- 4 use precisely err(1, "malloc failed")
- 6 in ar use precisely bsdar_errc(bsdar, EX_SOFTWARE, errno, "malloc failed")
- 2 in ar use "malloc failed" on a line by itself, presumably because the
   verboseness is large enough to defeat my simple regexp
- 3 in gzip use maybe_error("malloc failed")
- 1 uses precisely warn(1, "malloc failed")
- 13 use syslog(LOG_ERR, ...).  Mostly with "malloc failed" annotated
   inconsistently.  bsnmpd uses strerror(errno) a lot. It should use %m
   unless that is too unportable.  It mostly formats this using ": %s",
   but it sometimes uses " - %s" and sometimes doesn't print the errno.
   - 5 of the 13 don't print the redundant errno, so don't have any obvious
     style bugs
- 2 are in comments, with the bad grammar "If the malloc fail".
- 1 is in a comment, with the less bad grammar "malloc fail"
- 3 use precisely fatal(EX_UNAVAIL, "malloc faield"
- 3 more use strerror(errno) to add nothing
- 2 more seem to use syslog via a utility function (no errno, so OK)
- 3 use yp_error("malloc failed" or similar
- the remaining 4 use "[...] malloc [...] failed" to add something.

The example used to be worse.   It said just err(1, NULL).  No hint about
the source of the error.

%            if ((fd = open(file_name, O_RDONLY, 0)) == -1)
%                    err(EX_NOINPUT, "%s", file_name);

Error messages for open failure are more varied than for malloc failure.
I like to put at least the syscall or function name in all error messages
when not trying hard to write a very detailed but concise message.

% 
%      Display an error message and exit:
% 
%            if (tm.tm_hour < START_TIME)
%                    errx(EX_DATAERR, "too early, wait until %s",
%                        start_time_string);

Might be precise enough in context.

The message has a grammar error (comma splice).

Timing errors are unlikely to be related to data errors.  EX_TEMPFAIL
would be better, but I prefer 1 with a better message of course.

% 
%      Warn of an error:
% 
%            if ((fd = open(raw_device, O_RDONLY, 0)) == -1)
%                    warnx("%s: %s: trying the block device",
%                        raw_device, strerror(errno));

This is really an example of how to print the errno when you want it
but don't want it in the standard position given by warn().

%            if ((fd = open(block_device, O_RDONLY, 0)) == -1)
%                    err(EX_OSFILE, "%s", block_device);

This is not a warning, but a fatal error.

Both examples could be improved by giving the function name, possibly
by using "opening" instead of "trying".

Bruce

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 04:51:08 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id A65741DB;
 Wed, 10 Jul 2013 04:51:08 +0000 (UTC)
 (envelope-from bryanv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 89ACF1275;
 Wed, 10 Jul 2013 04:51:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A4p8pp087662;
 Wed, 10 Jul 2013 04:51:08 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A4p74F087655;
 Wed, 10 Jul 2013 04:51:07 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201307100451.r6A4p74F087655@svn.freebsd.org>
From: Bryan Venteicher 
Date: Wed, 10 Jul 2013 04:51:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253132 - in stable/9/sys/dev/virtio: . balloon block
 network pci scsi
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 04:51:08 -0000

Author: bryanv
Date: Wed Jul 10 04:51:07 2013
New Revision: 253132
URL: http://svnweb.freebsd.org/changeset/base/253132

Log:
  MFC VirtIO r252702,r252703,r252704,r252706,r252707,r252708,r252709
  
  This brings in several bug fixes and better conformance with various
  aspects of the spec that have changed.
  
  r252702: Convert VirtIO to use ithreads instead of taskqueues
  r252703: Block driver bug fixes and spec changes
  r252704: Balloon driver improvements
  r252706: Minor network driver improvements
  r252707: Minor misc VirtIO changes
  r252708: PCI driver bug fixes and cleanup
  r252709: Fix SCSI driver lock not owned panic

Modified:
  stable/9/sys/dev/virtio/balloon/virtio_balloon.c
  stable/9/sys/dev/virtio/block/virtio_blk.c
  stable/9/sys/dev/virtio/block/virtio_blk.h
  stable/9/sys/dev/virtio/network/if_vtnet.c
  stable/9/sys/dev/virtio/network/if_vtnetvar.h
  stable/9/sys/dev/virtio/pci/virtio_pci.c
  stable/9/sys/dev/virtio/scsi/virtio_scsi.c
  stable/9/sys/dev/virtio/scsi/virtio_scsivar.h
  stable/9/sys/dev/virtio/virtio.c
  stable/9/sys/dev/virtio/virtio.h
  stable/9/sys/dev/virtio/virtio_bus_if.m
  stable/9/sys/dev/virtio/virtio_if.m
  stable/9/sys/dev/virtio/virtqueue.c
  stable/9/sys/dev/virtio/virtqueue.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/virtio/balloon/virtio_balloon.c
==============================================================================
--- stable/9/sys/dev/virtio/balloon/virtio_balloon.c	Wed Jul 10 01:33:49 2013	(r253131)
+++ stable/9/sys/dev/virtio/balloon/virtio_balloon.c	Wed Jul 10 04:51:07 2013	(r253132)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2011, Bryan Venteicher 
+ * Copyright (c) 2011, Bryan Venteicher 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -70,7 +70,7 @@ struct vtballoon_softc {
 	uint32_t		 vtballoon_current_npages;
 	TAILQ_HEAD(,vm_page)	 vtballoon_pages;
 
-	struct proc		*vtballoon_kproc;
+	struct thread		*vtballoon_td;
 	uint32_t		*vtballoon_page_frames;
 	int			 vtballoon_timeout;
 };
@@ -90,7 +90,7 @@ static int	vtballoon_config_change(devic
 static void	vtballoon_negotiate_features(struct vtballoon_softc *);
 static int	vtballoon_alloc_virtqueues(struct vtballoon_softc *);
 
-static int	vtballoon_vq_intr(void *);
+static void	vtballoon_vq_intr(void *);
 
 static void	vtballoon_inflate(struct vtballoon_softc *, int);
 static void	vtballoon_deflate(struct vtballoon_softc *, int);
@@ -127,9 +127,9 @@ CTASSERT(VTBALLOON_PAGES_PER_REQUEST * s
 
 #define VTBALLOON_MTX(_sc)		&(_sc)->vtballoon_mtx
 #define VTBALLOON_LOCK_INIT(_sc, _name)	mtx_init(VTBALLOON_MTX((_sc)), _name, \
-					    "VirtIO Balloon Lock", MTX_SPIN)
-#define VTBALLOON_LOCK(_sc)		mtx_lock_spin(VTBALLOON_MTX((_sc)))
-#define VTBALLOON_UNLOCK(_sc)		mtx_unlock_spin(VTBALLOON_MTX((_sc)))
+					    "VirtIO Balloon Lock", MTX_DEF)
+#define VTBALLOON_LOCK(_sc)		mtx_lock(VTBALLOON_MTX((_sc)))
+#define VTBALLOON_UNLOCK(_sc)		mtx_unlock(VTBALLOON_MTX((_sc)))
 #define VTBALLOON_LOCK_DESTROY(_sc)	mtx_destroy(VTBALLOON_MTX((_sc)))
 
 static device_method_t vtballoon_methods[] = {
@@ -206,10 +206,10 @@ vtballoon_attach(device_t dev)
 		goto fail;
 	}
 
-	error = kproc_create(vtballoon_thread, sc, &sc->vtballoon_kproc,
+	error = kthread_add(vtballoon_thread, sc, NULL, &sc->vtballoon_td,
 	    0, 0, "virtio_balloon");
 	if (error) {
-		device_printf(dev, "cannot create balloon kproc\n");
+		device_printf(dev, "cannot create balloon kthread\n");
 		goto fail;
 	}
 
@@ -230,15 +230,14 @@ vtballoon_detach(device_t dev)
 
 	sc = device_get_softc(dev);
 
-	if (sc->vtballoon_kproc != NULL) {
+	if (sc->vtballoon_td != NULL) {
 		VTBALLOON_LOCK(sc);
 		sc->vtballoon_flags |= VTBALLOON_FLAG_DETACH;
 		wakeup_one(sc);
-		msleep_spin(sc->vtballoon_kproc, VTBALLOON_MTX(sc),
-		    "vtbdth", 0);
+		msleep(sc->vtballoon_td, VTBALLOON_MTX(sc), 0, "vtbdth", 0);
 		VTBALLOON_UNLOCK(sc);
 
-		sc->vtballoon_kproc = NULL;
+		sc->vtballoon_td = NULL;
 	}
 
 	if (device_is_attached(dev)) {
@@ -300,7 +299,7 @@ vtballoon_alloc_virtqueues(struct vtball
 	return (virtio_alloc_virtqueues(dev, 0, nvqs, vq_info));
 }
 
-static int
+static void
 vtballoon_vq_intr(void *xsc)
 {
 	struct vtballoon_softc *sc;
@@ -310,8 +309,6 @@ vtballoon_vq_intr(void *xsc)
 	VTBALLOON_LOCK(sc);
 	wakeup_one(sc);
 	VTBALLOON_UNLOCK(sc);
-
-	return (1);
 }
 
 static void
@@ -322,28 +319,26 @@ vtballoon_inflate(struct vtballoon_softc
 	int i;
 
 	vq = sc->vtballoon_inflate_vq;
-	m = NULL;
 
 	if (npages > VTBALLOON_PAGES_PER_REQUEST)
 		npages = VTBALLOON_PAGES_PER_REQUEST;
-	KASSERT(npages > 0, ("balloon doesn't need inflating?"));
 
 	for (i = 0; i < npages; i++) {
-		if ((m = vtballoon_alloc_page(sc)) == NULL)
+		if ((m = vtballoon_alloc_page(sc)) == NULL) {
+			sc->vtballoon_timeout = VTBALLOON_LOWMEM_TIMEOUT;
 			break;
+		}
 
 		sc->vtballoon_page_frames[i] =
 		    VM_PAGE_TO_PHYS(m) >> VIRTIO_BALLOON_PFN_SHIFT;
 
-		KASSERT(m->queue == PQ_NONE, ("allocated page on queue"));
+		KASSERT(m->queue == PQ_NONE,
+		    ("%s: allocated page %p on queue", __func__, m));
 		TAILQ_INSERT_TAIL(&sc->vtballoon_pages, m, pageq);
 	}
 
 	if (i > 0)
 		vtballoon_send_page_frames(sc, vq, i);
-
-	if (m == NULL)
-		sc->vtballoon_timeout = VTBALLOON_LOWMEM_TIMEOUT;
 }
 
 static void
@@ -359,11 +354,10 @@ vtballoon_deflate(struct vtballoon_softc
 
 	if (npages > VTBALLOON_PAGES_PER_REQUEST)
 		npages = VTBALLOON_PAGES_PER_REQUEST;
-	KASSERT(npages > 0, ("balloon doesn't need deflating?"));
 
 	for (i = 0; i < npages; i++) {
 		m = TAILQ_FIRST(&sc->vtballoon_pages);
-		KASSERT(m != NULL, ("no more pages to deflate"));
+		KASSERT(m != NULL, ("%s: no more pages to deflate", __func__));
 
 		sc->vtballoon_page_frames[i] =
 		    VM_PAGE_TO_PHYS(m) >> VIRTIO_BALLOON_PFN_SHIFT;
@@ -385,7 +379,9 @@ vtballoon_deflate(struct vtballoon_softc
 	KASSERT((TAILQ_EMPTY(&sc->vtballoon_pages) &&
 	    sc->vtballoon_current_npages == 0) ||
 	    (!TAILQ_EMPTY(&sc->vtballoon_pages) &&
-	    sc->vtballoon_current_npages != 0), ("balloon empty?"));
+	    sc->vtballoon_current_npages != 0),
+	    ("%s: bogus page count %d", __func__,
+	    sc->vtballoon_current_npages));
 }
 
 static void
@@ -413,7 +409,7 @@ vtballoon_send_page_frames(struct vtball
 	 */
 	VTBALLOON_LOCK(sc);
 	while ((c = virtqueue_dequeue(vq, NULL)) == NULL)
-		msleep_spin(sc, VTBALLOON_MTX(sc), "vtbspf", 0);
+		msleep(sc, VTBALLOON_MTX(sc), 0, "vtbspf", 0);
 	VTBALLOON_UNLOCK(sc);
 
 	KASSERT(c == vq, ("unexpected balloon operation response"));
@@ -512,7 +508,7 @@ vtballoon_sleep(struct vtballoon_softc *
 		if (current < desired && timeout == 0)
 			break;
 
-		msleep_spin(sc, VTBALLOON_MTX(sc), "vtbslp", timeout);
+		msleep(sc, VTBALLOON_MTX(sc), 0, "vtbslp", timeout);
 	}
 	VTBALLOON_UNLOCK(sc);
 
@@ -544,7 +540,7 @@ vtballoon_thread(void *xsc)
 		}
 	}
 
-	kproc_exit(0);
+	kthread_exit();
 }
 
 static void

Modified: stable/9/sys/dev/virtio/block/virtio_blk.c
==============================================================================
--- stable/9/sys/dev/virtio/block/virtio_blk.c	Wed Jul 10 01:33:49 2013	(r253131)
+++ stable/9/sys/dev/virtio/block/virtio_blk.c	Wed Jul 10 04:51:07 2013	(r253132)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2011, Bryan Venteicher 
+ * Copyright (c) 2011, Bryan Venteicher 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -36,10 +36,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
@@ -62,6 +62,12 @@ struct vtblk_request {
 	TAILQ_ENTRY(vtblk_request)	 vbr_link;
 };
 
+enum vtblk_cache_mode {
+	VTBLK_CACHE_WRITETHROUGH,
+	VTBLK_CACHE_WRITEBACK,
+	VTBLK_CACHE_MAX
+};
+
 struct vtblk_softc {
 	device_t		 vtblk_dev;
 	struct mtx		 vtblk_mtx;
@@ -73,6 +79,7 @@ struct vtblk_softc {
 #define VTBLK_FLAG_SUSPEND	0x0008
 #define VTBLK_FLAG_DUMPING	0x0010
 #define VTBLK_FLAG_BARRIER	0x0020
+#define VTBLK_FLAG_WC_CONFIG	0x0040
 
 	struct virtqueue	*vtblk_vq;
 	struct sglist		*vtblk_sglist;
@@ -85,11 +92,9 @@ struct vtblk_softc {
 				 vtblk_req_ready;
 	struct vtblk_request	*vtblk_req_ordered;
 
-	struct taskqueue	*vtblk_tq;
-	struct task		 vtblk_intr_task;
-
 	int			 vtblk_max_nsegs;
 	int			 vtblk_request_count;
+	enum vtblk_cache_mode	 vtblk_write_cache;
 
 	struct vtblk_request	 vtblk_dump_request;
 };
@@ -102,8 +107,9 @@ static struct virtio_feature_desc vtblk_
 	{ VIRTIO_BLK_F_RO,		"ReadOnly"	},
 	{ VIRTIO_BLK_F_BLK_SIZE,	"BlockSize"	},
 	{ VIRTIO_BLK_F_SCSI,		"SCSICmds"	},
-	{ VIRTIO_BLK_F_FLUSH,		"FlushCmd"	},
+	{ VIRTIO_BLK_F_WCE,		"WriteCache"	},
 	{ VIRTIO_BLK_F_TOPOLOGY,	"Topology"	},
+	{ VIRTIO_BLK_F_CONFIG_WCE,	"ConfigWCE"	},
 
 	{ 0, NULL }
 };
@@ -116,6 +122,7 @@ static int	vtblk_detach(device_t);
 static int	vtblk_suspend(device_t);
 static int	vtblk_resume(device_t);
 static int	vtblk_shutdown(device_t);
+static int	vtblk_config_change(device_t);
 
 static int	vtblk_open(struct disk *);
 static int	vtblk_close(struct disk *);
@@ -128,6 +135,10 @@ static void	vtblk_negotiate_features(str
 static int	vtblk_maximum_segments(struct vtblk_softc *,
 		    struct virtio_blk_config *);
 static int	vtblk_alloc_virtqueue(struct vtblk_softc *);
+static void	vtblk_set_write_cache(struct vtblk_softc *, int);
+static int	vtblk_write_cache_enabled(struct vtblk_softc *sc,
+		    struct virtio_blk_config *);
+static int	vtblk_write_cache_sysctl(SYSCTL_HANDLER_ARGS);
 static void	vtblk_alloc_disk(struct vtblk_softc *,
 		    struct virtio_blk_config *);
 static void	vtblk_create_disk(struct vtblk_softc *);
@@ -138,11 +149,12 @@ static struct vtblk_request * vtblk_bio_
 static int	vtblk_execute_request(struct vtblk_softc *,
 		    struct vtblk_request *);
 
-static int	vtblk_vq_intr(void *);
-static void	vtblk_intr_task(void *, int);
+static void	vtblk_vq_intr(void *);
 
 static void	vtblk_stop(struct vtblk_softc *);
 
+static void	vtblk_read_config(struct vtblk_softc *,
+		    struct virtio_blk_config *);
 static void	vtblk_get_ident(struct vtblk_softc *);
 static void	vtblk_prepare_dump(struct vtblk_softc *);
 static int	vtblk_write_dump(struct vtblk_softc *, void *, off_t, size_t);
@@ -167,9 +179,14 @@ static void	vtblk_enqueue_ready(struct v
 static int	vtblk_request_error(struct vtblk_request *);
 static void	vtblk_finish_bio(struct bio *, int);
 
+static void	vtblk_setup_sysctl(struct vtblk_softc *);
+static int	vtblk_tunable_int(struct vtblk_softc *, const char *, int);
+
 /* Tunables. */
 static int vtblk_no_ident = 0;
 TUNABLE_INT("hw.vtblk.no_ident", &vtblk_no_ident);
+static int vtblk_writecache_mode = -1;
+TUNABLE_INT("hw.vtblk.writecache_mode", &vtblk_writecache_mode);
 
 /* Features desired/implemented by this driver. */
 #define VTBLK_FEATURES \
@@ -179,13 +196,14 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_
      VIRTIO_BLK_F_GEOMETRY		| \
      VIRTIO_BLK_F_RO			| \
      VIRTIO_BLK_F_BLK_SIZE		| \
-     VIRTIO_BLK_F_FLUSH			| \
+     VIRTIO_BLK_F_WCE			| \
+     VIRTIO_BLK_F_CONFIG_WCE		| \
      VIRTIO_RING_F_INDIRECT_DESC)
 
 #define VTBLK_MTX(_sc)		&(_sc)->vtblk_mtx
 #define VTBLK_LOCK_INIT(_sc, _name) \
 				mtx_init(VTBLK_MTX((_sc)), (_name), \
-				    "VTBLK Lock", MTX_DEF)
+				    "VirtIO Block Lock", MTX_DEF)
 #define VTBLK_LOCK(_sc)		mtx_lock(VTBLK_MTX((_sc)))
 #define VTBLK_UNLOCK(_sc)	mtx_unlock(VTBLK_MTX((_sc)))
 #define VTBLK_LOCK_DESTROY(_sc)	mtx_destroy(VTBLK_MTX((_sc)))
@@ -211,6 +229,9 @@ static device_method_t vtblk_methods[] =
 	DEVMETHOD(device_resume,	vtblk_resume),
 	DEVMETHOD(device_shutdown,	vtblk_shutdown),
 
+	/* VirtIO methods. */
+	DEVMETHOD(virtio_config_change,	vtblk_config_change),
+
 	DEVMETHOD_END
 };
 
@@ -284,10 +305,13 @@ vtblk_attach(device_t dev)
 		sc->vtblk_flags |= VTBLK_FLAG_READONLY;
 	if (virtio_with_feature(dev, VIRTIO_BLK_F_BARRIER))
 		sc->vtblk_flags |= VTBLK_FLAG_BARRIER;
+	if (virtio_with_feature(dev, VIRTIO_BLK_F_CONFIG_WCE))
+		sc->vtblk_flags |= VTBLK_FLAG_WC_CONFIG;
+
+	vtblk_setup_sysctl(sc);
 
 	/* Get local copy of config. */
-	virtio_read_device_config(dev, 0, &blkcfg,
-	    sizeof(struct virtio_blk_config));
+	vtblk_read_config(sc, &blkcfg);
 
 	/*
 	 * With the current sglist(9) implementation, it is not easy
@@ -333,24 +357,12 @@ vtblk_attach(device_t dev)
 
 	vtblk_alloc_disk(sc, &blkcfg);
 
-	TASK_INIT(&sc->vtblk_intr_task, 0, vtblk_intr_task, sc);
-	sc->vtblk_tq = taskqueue_create_fast("vtblk_taskq", M_NOWAIT,
-	    taskqueue_thread_enqueue, &sc->vtblk_tq);
-	if (sc->vtblk_tq == NULL) {
-		error = ENOMEM;
-		device_printf(dev, "cannot allocate taskqueue\n");
-		goto fail;
-	}
-
 	error = virtio_setup_intr(dev, INTR_TYPE_BIO | INTR_ENTROPY);
 	if (error) {
 		device_printf(dev, "cannot setup virtqueue interrupt\n");
 		goto fail;
 	}
 
-	taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq",
-	    device_get_nameunit(dev));
-
 	vtblk_create_disk(sc);
 
 	virtqueue_enable_intr(sc->vtblk_vq);
@@ -375,12 +387,6 @@ vtblk_detach(device_t dev)
 		vtblk_stop(sc);
 	VTBLK_UNLOCK(sc);
 
-	if (sc->vtblk_tq != NULL) {
-		taskqueue_drain(sc->vtblk_tq, &sc->vtblk_intr_task);
-		taskqueue_free(sc->vtblk_tq);
-		sc->vtblk_tq = NULL;
-	}
-
 	vtblk_drain(sc);
 
 	if (sc->vtblk_disk != NULL) {
@@ -441,6 +447,13 @@ vtblk_shutdown(device_t dev)
 }
 
 static int
+vtblk_config_change(device_t dev)
+{
+
+	return (0);
+}
+
+static int
 vtblk_open(struct disk *dp)
 {
 	struct vtblk_softc *sc;
@@ -541,8 +554,8 @@ vtblk_strategy(struct bio *bp)
 		max_nsegs = sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS;
 
 		KASSERT(nsegs <= max_nsegs,
-		    ("bio %p spanned too many segments: %d, max: %d",
-		    bp, nsegs, max_nsegs));
+		    ("%s: bio %p spanned too many segments: %d, max: %d",
+		    __func__, bp, nsegs, max_nsegs));
 	}
 #endif
 
@@ -606,6 +619,59 @@ vtblk_alloc_virtqueue(struct vtblk_softc
 }
 
 static void
+vtblk_set_write_cache(struct vtblk_softc *sc, int wc)
+{
+
+	/* Set either writeback (1) or writethrough (0) mode. */
+	virtio_write_dev_config_1(sc->vtblk_dev,
+	    offsetof(struct virtio_blk_config, writeback), wc);
+}
+
+static int
+vtblk_write_cache_enabled(struct vtblk_softc *sc,
+    struct virtio_blk_config *blkcfg)
+{
+	int wc;
+
+	if (sc->vtblk_flags & VTBLK_FLAG_WC_CONFIG) {
+		wc = vtblk_tunable_int(sc, "writecache_mode",
+		    vtblk_writecache_mode);
+		if (wc >= 0 && wc < VTBLK_CACHE_MAX)
+			vtblk_set_write_cache(sc, wc);
+		else
+			wc = blkcfg->writeback;
+	} else
+		wc = virtio_with_feature(sc->vtblk_dev, VIRTIO_BLK_F_WCE);
+
+	return (wc);
+}
+
+static int
+vtblk_write_cache_sysctl(SYSCTL_HANDLER_ARGS)
+{
+	struct vtblk_softc *sc;
+	int wc, error;
+
+	sc = oidp->oid_arg1;
+	wc = sc->vtblk_write_cache;
+
+	error = sysctl_handle_int(oidp, &wc, 0, req);
+	if (error || req->newptr == NULL)
+		return (error);
+	if ((sc->vtblk_flags & VTBLK_FLAG_WC_CONFIG) == 0)
+		return (EPERM);
+	if (wc < 0 || wc >= VTBLK_CACHE_MAX)
+		return (EINVAL);
+
+	VTBLK_LOCK(sc);
+	sc->vtblk_write_cache = wc;
+	vtblk_set_write_cache(sc, sc->vtblk_write_cache);
+	VTBLK_UNLOCK(sc);
+
+	return (0);
+}
+
+static void
 vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio_blk_config *blkcfg)
 {
 	device_t dev;
@@ -621,6 +687,11 @@ vtblk_alloc_disk(struct vtblk_softc *sc,
 	dp->d_name = VTBLK_DISK_NAME;
 	dp->d_unit = device_get_unit(dev);
 	dp->d_drv1 = sc;
+	dp->d_flags = DISKFLAG_CANFLUSHCACHE;
+	dp->d_hba_vendor = virtio_get_vendor(dev);
+	dp->d_hba_device = virtio_get_device(dev);
+	dp->d_hba_subvendor = virtio_get_subvendor(dev);
+	dp->d_hba_subdevice = virtio_get_subdevice(dev);
 
 	if ((sc->vtblk_flags & VTBLK_FLAG_READONLY) == 0)
 		dp->d_dump = vtblk_dump;
@@ -656,8 +727,18 @@ vtblk_alloc_disk(struct vtblk_softc *sc,
 		dp->d_fwheads = blkcfg->geometry.heads;
 	}
 
-	if (virtio_with_feature(dev, VIRTIO_BLK_F_FLUSH))
-		dp->d_flags |= DISKFLAG_CANFLUSHCACHE;
+	if (virtio_with_feature(dev, VIRTIO_BLK_F_TOPOLOGY)) {
+		dp->d_stripesize = dp->d_sectorsize *
+		    (1 << blkcfg->topology.physical_block_exp);
+		dp->d_stripeoffset = (dp->d_stripesize -
+		    blkcfg->topology.alignment_offset * dp->d_sectorsize) %
+		    dp->d_stripesize;
+	}
+
+	if (vtblk_write_cache_enabled(sc, blkcfg) != 0)
+		sc->vtblk_write_cache = VTBLK_CACHE_WRITEBACK;
+	else
+		sc->vtblk_write_cache = VTBLK_CACHE_WRITETHROUGH;
 }
 
 static void
@@ -765,8 +846,7 @@ vtblk_bio_request(struct vtblk_softc *sc
 		req->vbr_hdr.sector = bp->bio_offset / 512;
 		break;
 	default:
-		panic("%s: bio with unhandled cmd: %d", __FUNCTION__,
-		    bp->bio_cmd);
+		panic("%s: bio with unhandled cmd: %d", __func__, bp->bio_cmd);
 	}
 
 	return (req);
@@ -809,14 +889,13 @@ vtblk_execute_request(struct vtblk_softc
 	}
 
 	sglist_reset(sg);
-
 	sglist_append(sg, &req->vbr_hdr, sizeof(struct virtio_blk_outhdr));
 
 	if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) {
 		error = sglist_append(sg, bp->bio_data, bp->bio_bcount);
 		if (error || sg->sg_nseg == sg->sg_maxseg)
 			panic("%s: data buffer too big bio:%p error:%d",
-			    __FUNCTION__, bp, error);
+			    __func__, bp, error);
 
 		/* BIO_READ means the host writes into our buffer. */
 		if (bp->bio_cmd == BIO_READ)
@@ -834,28 +913,16 @@ vtblk_execute_request(struct vtblk_softc
 	return (error);
 }
 
-static int
-vtblk_vq_intr(void *xsc)
-{
-	struct vtblk_softc *sc;
-
-	sc = xsc;
-
-	virtqueue_disable_intr(sc->vtblk_vq);
-	taskqueue_enqueue_fast(sc->vtblk_tq, &sc->vtblk_intr_task);
-
-	return (1);
-}
-
 static void
-vtblk_intr_task(void *arg, int pending)
+vtblk_vq_intr(void *xsc)
 {
 	struct vtblk_softc *sc;
 	struct virtqueue *vq;
 
-	sc = arg;
+	sc = xsc;
 	vq = sc->vtblk_vq;
 
+again:
 	VTBLK_LOCK(sc);
 	if (sc->vtblk_flags & VTBLK_FLAG_DETACH) {
 		VTBLK_UNLOCK(sc);
@@ -872,9 +939,7 @@ vtblk_intr_task(void *arg, int pending)
 	if (virtqueue_enable_intr(vq) != 0) {
 		virtqueue_disable_intr(vq);
 		VTBLK_UNLOCK(sc);
-		taskqueue_enqueue_fast(sc->vtblk_tq,
-		    &sc->vtblk_intr_task);
-		return;
+		goto again;
 	}
 
 	VTBLK_UNLOCK(sc);
@@ -888,6 +953,37 @@ vtblk_stop(struct vtblk_softc *sc)
 	virtio_stop(sc->vtblk_dev);
 }
 
+#define VTBLK_GET_CONFIG(_dev, _feature, _field, _cfg)			\
+	if (virtio_with_feature(_dev, _feature)) {			\
+		virtio_read_device_config(_dev,				\
+		    offsetof(struct virtio_blk_config, _field),		\
+		    &(_cfg)->_field, sizeof((_cfg)->_field));		\
+	}
+
+static void
+vtblk_read_config(struct vtblk_softc *sc, struct virtio_blk_config *blkcfg)
+{
+	device_t dev;
+
+	dev = sc->vtblk_dev;
+
+	bzero(blkcfg, sizeof(struct virtio_blk_config));
+
+	/* The capacity is always available. */
+	virtio_read_device_config(dev, offsetof(struct virtio_blk_config,
+	    capacity), &blkcfg->capacity, sizeof(blkcfg->capacity));
+
+	/* Read the configuration if the feature was negotiated. */
+	VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_SIZE_MAX, size_max, blkcfg);
+	VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_SEG_MAX, seg_max, blkcfg);
+	VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_GEOMETRY, geometry, blkcfg);
+	VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_BLK_SIZE, blk_size, blkcfg);
+	VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_TOPOLOGY, topology, blkcfg);
+	VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_CONFIG_WCE, writeback, blkcfg);
+}
+
+#undef VTBLK_GET_CONFIG
+
 static void
 vtblk_get_ident(struct vtblk_softc *sc)
 {
@@ -899,7 +995,7 @@ vtblk_get_ident(struct vtblk_softc *sc)
 	dp = sc->vtblk_disk;
 	len = MIN(VIRTIO_BLK_ID_BYTES, DISK_IDENT_SIZE);
 
-	if (vtblk_no_ident != 0)
+	if (vtblk_tunable_int(sc, "no_ident", vtblk_no_ident) != 0)
 		return;
 
 	req = vtblk_dequeue_request(sc);
@@ -949,8 +1045,10 @@ vtblk_prepare_dump(struct vtblk_softc *s
 	 */
 	vtblk_drain_vq(sc, 1);
 
-	if (virtio_reinit(dev, sc->vtblk_features) != 0)
-		panic("cannot reinit VirtIO block device during dump");
+	if (virtio_reinit(dev, sc->vtblk_features) != 0) {
+		panic("%s: cannot reinit VirtIO block device during dump",
+		    device_get_nameunit(dev));
+	}
 
 	virtqueue_disable_intr(vq);
 	virtio_reinit_complete(dev);
@@ -1003,7 +1101,6 @@ static int
 vtblk_poll_request(struct vtblk_softc *sc, struct vtblk_request *req)
 {
 	struct virtqueue *vq;
-	struct vtblk_request *r;
 	int error;
 
 	vq = sc->vtblk_vq;
@@ -1016,14 +1113,12 @@ vtblk_poll_request(struct vtblk_softc *s
 		return (error);
 
 	virtqueue_notify(vq);
-
-	r = virtqueue_poll(vq, NULL);
-	KASSERT(r == req, ("unexpected request response: %p/%p", r, req));
+	virtqueue_poll(vq, NULL);
 
 	error = vtblk_request_error(req);
 	if (error && bootverbose) {
 		device_printf(sc->vtblk_dev,
-		    "%s: IO error: %d\n", __FUNCTION__, error);
+		    "%s: IO error: %d\n", __func__, error);
 	}
 
 	return (error);
@@ -1154,7 +1249,7 @@ vtblk_free_requests(struct vtblk_softc *
 	struct vtblk_request *req;
 
 	KASSERT(TAILQ_EMPTY(&sc->vtblk_req_ready),
-	    ("ready requests left on queue"));
+	    ("%s: ready requests left on queue", __func__));
 
 	while ((req = vtblk_dequeue_request(sc)) != NULL) {
 		sc->vtblk_request_count--;
@@ -1162,7 +1257,7 @@ vtblk_free_requests(struct vtblk_softc *
 	}
 
 	KASSERT(sc->vtblk_request_count == 0,
-	    ("leaked requests: %d", sc->vtblk_request_count));
+	    ("%s: leaked %d requests", __func__, sc->vtblk_request_count));
 }
 
 static struct vtblk_request *
@@ -1236,3 +1331,33 @@ vtblk_finish_bio(struct bio *bp, int err
 
 	biodone(bp);
 }
+
+static void
+vtblk_setup_sysctl(struct vtblk_softc *sc)
+{
+	device_t dev;
+	struct sysctl_ctx_list *ctx;
+	struct sysctl_oid *tree;
+	struct sysctl_oid_list *child;
+
+	dev = sc->vtblk_dev;
+	ctx = device_get_sysctl_ctx(dev);
+	tree = device_get_sysctl_tree(dev);
+	child = SYSCTL_CHILDREN(tree);
+
+	SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "writecache_mode",
+	    CTLTYPE_INT | CTLFLAG_RW, sc, 0, vtblk_write_cache_sysctl,
+	    "I", "Write cache mode (writethrough (0) or writeback (1))");
+}
+
+static int
+vtblk_tunable_int(struct vtblk_softc *sc, const char *knob, int def)
+{
+	char path[64];
+
+	snprintf(path, sizeof(path),
+	    "hw.vtblk.%d.%s", device_get_unit(sc->vtblk_dev), knob);
+	TUNABLE_INT_FETCH(path, &def);
+
+	return (def);
+}

Modified: stable/9/sys/dev/virtio/block/virtio_blk.h
==============================================================================
--- stable/9/sys/dev/virtio/block/virtio_blk.h	Wed Jul 10 01:33:49 2013	(r253131)
+++ stable/9/sys/dev/virtio/block/virtio_blk.h	Wed Jul 10 04:51:07 2013	(r253132)
@@ -39,8 +39,9 @@
 #define VIRTIO_BLK_F_RO		0x0020	/* Disk is read-only */
 #define VIRTIO_BLK_F_BLK_SIZE	0x0040	/* Block size of disk is available*/
 #define VIRTIO_BLK_F_SCSI	0x0080	/* Supports scsi command passthru */
-#define VIRTIO_BLK_F_FLUSH	0x0200	/* Cache flush command support */
+#define VIRTIO_BLK_F_WCE	0x0200	/* Writeback mode enabled after reset */
 #define VIRTIO_BLK_F_TOPOLOGY	0x0400	/* Topology information is available */
+#define VIRTIO_BLK_F_CONFIG_WCE 0x0800	/* Writeback mode available in config */
 
 #define VIRTIO_BLK_ID_BYTES	20	/* ID string length */
 
@@ -51,15 +52,27 @@ struct virtio_blk_config {
 	uint32_t size_max;
 	/* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */
 	uint32_t seg_max;
-	/* geometry the device (if VIRTIO_BLK_F_GEOMETRY) */
+	/* Geometry of the device (if VIRTIO_BLK_F_GEOMETRY) */
 	struct virtio_blk_geometry {
 		uint16_t cylinders;
 		uint8_t heads;
 		uint8_t sectors;
 	} geometry;
 
-	/* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
+	/* Block size of device (if VIRTIO_BLK_F_BLK_SIZE) */
 	uint32_t blk_size;
+
+	/* Topology of the device (if VIRTIO_BLK_F_TOPOLOGY) */
+	struct virtio_blk_topology {
+		uint8_t physical_block_exp;
+		uint8_t alignment_offset;
+		uint16_t min_io_size;
+		uint16_t opt_io_size;
+	} topology;
+
+	/* Writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */
+	uint8_t writeback;
+
 } __packed;
 
 /*

Modified: stable/9/sys/dev/virtio/network/if_vtnet.c
==============================================================================
--- stable/9/sys/dev/virtio/network/if_vtnet.c	Wed Jul 10 01:33:49 2013	(r253131)
+++ stable/9/sys/dev/virtio/network/if_vtnet.c	Wed Jul 10 04:51:07 2013	(r253132)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2011, Bryan Venteicher 
+ * Copyright (c) 2011, Bryan Venteicher 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -97,7 +96,6 @@ static void	vtnet_set_hwaddr(struct vtne
 static int	vtnet_is_link_up(struct vtnet_softc *);
 static void	vtnet_update_link_status(struct vtnet_softc *);
 static void	vtnet_watchdog(struct vtnet_softc *);
-static void	vtnet_config_change_task(void *, int);
 static int	vtnet_change_mtu(struct vtnet_softc *, int);
 static int	vtnet_ioctl(struct ifnet *, u_long, caddr_t);
 
@@ -123,8 +121,7 @@ static int	vtnet_rx_csum(struct vtnet_so
 		    struct virtio_net_hdr *);
 static int	vtnet_rxeof_merged(struct vtnet_softc *, struct mbuf *, int);
 static int	vtnet_rxeof(struct vtnet_softc *, int, int *);
-static void	vtnet_rx_intr_task(void *, int);
-static int	vtnet_rx_vq_intr(void *);
+static void	vtnet_rx_vq_intr(void *);
 
 static void	vtnet_txeof(struct vtnet_softc *);
 static struct mbuf * vtnet_tx_offload(struct vtnet_softc *, struct mbuf *,
@@ -135,8 +132,7 @@ static int	vtnet_encap(struct vtnet_soft
 static void	vtnet_start_locked(struct ifnet *);
 static void	vtnet_start(struct ifnet *);
 static void	vtnet_tick(void *);
-static void	vtnet_tx_intr_task(void *, int);
-static int	vtnet_tx_vq_intr(void *);
+static void	vtnet_tx_vq_intr(void *);
 
 static void	vtnet_stop(struct vtnet_softc *);
 static int	vtnet_reinit(struct vtnet_softc *);
@@ -427,19 +423,6 @@ vtnet_attach(device_t dev)
 	ifp->if_capabilities |= IFCAP_POLLING;
 #endif
 
-	TASK_INIT(&sc->vtnet_rx_intr_task, 0, vtnet_rx_intr_task, sc);
-	TASK_INIT(&sc->vtnet_tx_intr_task, 0, vtnet_tx_intr_task, sc);
-	TASK_INIT(&sc->vtnet_cfgchg_task, 0, vtnet_config_change_task, sc);
-
-	sc->vtnet_tq = taskqueue_create_fast("vtnet_taskq", M_NOWAIT,
-	    taskqueue_thread_enqueue, &sc->vtnet_tq);
-	if (sc->vtnet_tq == NULL) {
-		error = ENOMEM;
-		device_printf(dev, "cannot allocate taskqueue\n");
-		ether_ifdetach(ifp);
-		goto fail;
-	}
-
 	error = virtio_setup_intr(dev, INTR_TYPE_NET);
 	if (error) {
 		device_printf(dev, "cannot setup virtqueue interrupts\n");
@@ -447,9 +430,6 @@ vtnet_attach(device_t dev)
 		goto fail;
 	}
 
-	taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq",
-	    device_get_nameunit(dev));
-
 	/*
 	 * Device defaults to promiscuous mode for backwards
 	 * compatibility. Turn it off if possible.
@@ -495,18 +475,10 @@ vtnet_detach(device_t dev)
 		VTNET_UNLOCK(sc);
 
 		callout_drain(&sc->vtnet_tick_ch);
-		taskqueue_drain(taskqueue_fast, &sc->vtnet_cfgchg_task);
 
 		ether_ifdetach(ifp);
 	}
 
-	if (sc->vtnet_tq != NULL) {
-		taskqueue_drain(sc->vtnet_tq, &sc->vtnet_rx_intr_task);
-		taskqueue_drain(sc->vtnet_tq, &sc->vtnet_tx_intr_task);
-		taskqueue_free(sc->vtnet_tq);
-		sc->vtnet_tq = NULL;
-	}
-
 	if (sc->vtnet_vlan_attach != NULL) {
 		EVENTHANDLER_DEREGISTER(vlan_config, sc->vtnet_vlan_attach);
 		sc->vtnet_vlan_attach = NULL;
@@ -590,9 +562,11 @@ vtnet_config_change(device_t dev)
 
 	sc = device_get_softc(dev);
 
-	taskqueue_enqueue_fast(taskqueue_fast, &sc->vtnet_cfgchg_task);
+	VTNET_LOCK(sc);
+	vtnet_update_link_status(sc);
+	VTNET_UNLOCK(sc);
 
-	return (1);
+	return (0);
 }
 
 static void
@@ -788,18 +762,6 @@ vtnet_watchdog(struct vtnet_softc *sc)
 	vtnet_init_locked(sc);
 }
 
-static void
-vtnet_config_change_task(void *arg, int pending)
-{
-	struct vtnet_softc *sc;
-
-	sc = arg;
-
-	VTNET_LOCK(sc);
-	vtnet_update_link_status(sc);
-	VTNET_UNLOCK(sc);
-}
-
 static int
 vtnet_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 {
@@ -1705,15 +1667,16 @@ vtnet_rxeof(struct vtnet_softc *sc, int 
 }
 
 static void
-vtnet_rx_intr_task(void *arg, int pending)
+vtnet_rx_vq_intr(void *xsc)
 {
 	struct vtnet_softc *sc;
 	struct ifnet *ifp;
 	int more;
 
-	sc = arg;
+	sc = xsc;
 	ifp = sc->vtnet_ifp;
 
+again:
 	VTNET_LOCK(sc);
 
 #ifdef DEVICE_POLLING
@@ -1730,31 +1693,15 @@ vtnet_rx_intr_task(void *arg, int pendin
 	}
 
 	more = vtnet_rxeof(sc, sc->vtnet_rx_process_limit, NULL);
-	if (!more && vtnet_enable_rx_intr(sc) != 0) {
-		vtnet_disable_rx_intr(sc);
-		more = 1;
-	}
-
-	VTNET_UNLOCK(sc);
-
-	if (more) {
+	if (more || vtnet_enable_rx_intr(sc) != 0) {
+		if (!more)
+			vtnet_disable_rx_intr(sc);
 		sc->vtnet_stats.rx_task_rescheduled++;
-		taskqueue_enqueue_fast(sc->vtnet_tq,
-		    &sc->vtnet_rx_intr_task);
+		VTNET_UNLOCK(sc);
+		goto again;
 	}
-}
-
-static int
-vtnet_rx_vq_intr(void *xsc)
-{
-	struct vtnet_softc *sc;
-
-	sc = xsc;
 
-	vtnet_disable_rx_intr(sc);
-	taskqueue_enqueue_fast(sc->vtnet_tq, &sc->vtnet_rx_intr_task);
-
-	return (1);
+	VTNET_UNLOCK(sc);
 }
 
 static void
@@ -1800,7 +1747,6 @@ vtnet_tx_offload(struct vtnet_softc *sc,
 	uint8_t ip_proto, gso_type;
 
 	ifp = sc->vtnet_ifp;
-	M_ASSERTPKTHDR(m);
 
 	ip_offset = sizeof(struct ether_header);
 	if (m->m_len < ip_offset) {
@@ -1918,7 +1864,7 @@ vtnet_enqueue_txbuf(struct vtnet_softc *
 	sglist_init(&sg, VTNET_MAX_TX_SEGS, segs);
 	error = sglist_append(&sg, &txhdr->vth_uhdr, sc->vtnet_hdr_size);
 	KASSERT(error == 0 && sg.sg_nseg == 1,
-	    ("cannot add header to sglist"));
+	    ("%s: cannot add header to sglist error %d", __func__, error));
 
 again:
 	error = sglist_append_mbuf(&sg, m);
@@ -1955,6 +1901,7 @@ vtnet_encap(struct vtnet_softc *sc, stru
 	int error;
 
 	m = *m_head;
+	M_ASSERTPKTHDR(m);
 
 	txhdr = uma_zalloc(vtnet_tx_header_zone, M_NOWAIT | M_ZERO);
 	if (txhdr == NULL) {
@@ -2077,14 +2024,15 @@ vtnet_tick(void *xsc)
 }
 
 static void
-vtnet_tx_intr_task(void *arg, int pending)
+vtnet_tx_vq_intr(void *xsc)
 {
 	struct vtnet_softc *sc;
 	struct ifnet *ifp;
 
-	sc = arg;
+	sc = xsc;
 	ifp = sc->vtnet_ifp;
 
+again:
 	VTNET_LOCK(sc);
 
 #ifdef DEVICE_POLLING
@@ -2109,26 +2057,12 @@ vtnet_tx_intr_task(void *arg, int pendin
 		vtnet_disable_tx_intr(sc);
 		sc->vtnet_stats.tx_task_rescheduled++;
 		VTNET_UNLOCK(sc);
-		taskqueue_enqueue_fast(sc->vtnet_tq, &sc->vtnet_tx_intr_task);
-		return;
+		goto again;
 	}
 
 	VTNET_UNLOCK(sc);
 }
 
-static int
-vtnet_tx_vq_intr(void *xsc)
-{
-	struct vtnet_softc *sc;
-
-	sc = xsc;
-
-	vtnet_disable_tx_intr(sc);
-	taskqueue_enqueue_fast(sc->vtnet_tq, &sc->vtnet_tx_intr_task);
-
-	return (1);
-}
-
 static void
 vtnet_stop(struct vtnet_softc *sc)
 {

Modified: stable/9/sys/dev/virtio/network/if_vtnetvar.h
==============================================================================
--- stable/9/sys/dev/virtio/network/if_vtnetvar.h	Wed Jul 10 01:33:49 2013	(r253131)
+++ stable/9/sys/dev/virtio/network/if_vtnetvar.h	Wed Jul 10 04:51:07 2013	(r253132)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2011, Bryan Venteicher 
+ * Copyright (c) 2011, Bryan Venteicher 
  * All rights reserved.

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

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 06:46:46 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 91D08B00;
 Wed, 10 Jul 2013 06:46:46 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 848D717A7;
 Wed, 10 Jul 2013 06:46:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A6kkau021914;
 Wed, 10 Jul 2013 06:46:46 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A6kkMC021913;
 Wed, 10 Jul 2013 06:46:46 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307100646.r6A6kkMC021913@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Jul 2013 06:46:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253134 - head/sys/dev/hme
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 06:46:46 -0000

Author: yongari
Date: Wed Jul 10 06:46:46 2013
New Revision: 253134
URL: http://svnweb.freebsd.org/changeset/base/253134

Log:
  Avoid controller reinitialization which could be triggered by
  dhclient(8) or alias addresses are added.
  
  Tested by:	dcx dcy 

Modified:
  head/sys/dev/hme/if_hme.c

Modified: head/sys/dev/hme/if_hme.c
==============================================================================
--- head/sys/dev/hme/if_hme.c	Wed Jul 10 04:59:10 2013	(r253133)
+++ head/sys/dev/hme/if_hme.c	Wed Jul 10 06:46:46 2013	(r253134)
@@ -742,6 +742,10 @@ hme_init_locked(struct hme_softc *sc)
 	u_int32_t n, v;
 
 	HME_LOCK_ASSERT(sc, MA_OWNED);
+
+	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+		return;
+
 	/*
 	 * Initialization sequence. The numbered steps below correspond
 	 * to the sequence outlined in section 6.3.5.1 in the Ethernet
@@ -1324,6 +1328,7 @@ hme_eint(struct hme_softc *sc, u_int sta
 	/* check for fatal errors that needs reset to unfreeze DMA engine */
 	if ((status & HME_SEB_STAT_FATAL_ERRORS) != 0) {
 		HME_WHINE(sc->sc_dev, "error signaled, status=%#x\n", status);
+		sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 		hme_init_locked(sc);
 	}
 }
@@ -1370,6 +1375,7 @@ hme_watchdog(struct hme_softc *sc)
 		device_printf(sc->sc_dev, "device timeout (no link)\n");
 	++ifp->if_oerrors;
 
+	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 	hme_init_locked(sc);
 	hme_start_locked(ifp);
 	return (EJUSTRETURN);

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 07:15:40 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 42EF67FC;
 Wed, 10 Jul 2013 07:15:40 +0000 (UTC)
 (envelope-from kevlo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 35B3718CC;
 Wed, 10 Jul 2013 07:15:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A7Feld032066;
 Wed, 10 Jul 2013 07:15:40 GMT (envelope-from kevlo@svn.freebsd.org)
Received: (from kevlo@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A7FedG032065;
 Wed, 10 Jul 2013 07:15:40 GMT (envelope-from kevlo@svn.freebsd.org)
Message-Id: <201307100715.r6A7FedG032065@svn.freebsd.org>
From: Kevin Lo 
Date: Wed, 10 Jul 2013 07:15:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253136 - head/sys/sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 07:15:40 -0000

Author: kevlo
Date: Wed Jul 10 07:15:39 2013
New Revision: 253136
URL: http://svnweb.freebsd.org/changeset/base/253136

Log:
  Add the ARM processor-specific section types.
  
  Reviewed by:	imp

Modified:
  head/sys/sys/elf_common.h

Modified: head/sys/sys/elf_common.h
==============================================================================
--- head/sys/sys/elf_common.h	Wed Jul 10 07:12:55 2013	(r253135)
+++ head/sys/sys/elf_common.h	Wed Jul 10 07:15:39 2013	(r253136)
@@ -296,6 +296,13 @@ typedef struct {
 #define	SHT_HIOS		0x6fffffff	/* Last of OS specific semantics */
 #define	SHT_LOPROC		0x70000000	/* reserved range for processor */
 #define	SHT_AMD64_UNWIND	0x70000001	/* unwind information */
+#define	SHT_ARM_EXIDX		0x70000001	/* Exception index table. */
+#define	SHT_ARM_PREEMPTMAP	0x70000002	/* BPABI DLL dynamic linking 
+						   pre-emption map. */
+#define	SHT_ARM_ATTRIBUTES	0x70000003	/* Object file compatibility 
+						   attributes. */
+#define	SHT_ARM_DEBUGOVERLAY	0x70000004	/* See DBGOVL for details. */
+#define	SHT_ARM_OVERLAYSECTION	0x70000005	/* See DBGOVL for details. */
 #define	SHT_MIPS_REGINFO	0x70000006
 #define	SHT_MIPS_OPTIONS	0x7000000d
 #define	SHT_MIPS_DWARF		0x7000001e	/* MIPS gcc uses MIPS_DWARF */

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 07:40:31 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 659DE332;
 Wed, 10 Jul 2013 07:40:31 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 3F19519D7;
 Wed, 10 Jul 2013 07:40:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A7eViR040040;
 Wed, 10 Jul 2013 07:40:31 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A7eVnd040039;
 Wed, 10 Jul 2013 07:40:31 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201307100740.r6A7eVnd040039@svn.freebsd.org>
From: Dag-Erling Smørgrav 
Date: Wed, 10 Jul 2013 07:40:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253138 - head/usr.sbin/authpf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 07:40:31 -0000

Author: des
Date: Wed Jul 10 07:40:30 2013
New Revision: 253138
URL: http://svnweb.freebsd.org/changeset/base/253138

Log:
  Install authpf-noip.
  
  MFC after:	3 days

Modified:
  head/usr.sbin/authpf/Makefile

Modified: head/usr.sbin/authpf/Makefile
==============================================================================
--- head/usr.sbin/authpf/Makefile	Wed Jul 10 07:21:59 2013	(r253137)
+++ head/usr.sbin/authpf/Makefile	Wed Jul 10 07:40:30 2013	(r253138)
@@ -18,4 +18,7 @@ DPADD+= ${LIBM} ${LIBMD} ${LIBUTIL}
 
 WARNS?=	3
 
+LINKS=	${BINDIR}/authpf ${BINDIR}/authpf-noip
+MLINKS=	authpf.8 authpf-noip.8
+
 .include 

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 08:21:12 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id C3156C3B;
 Wed, 10 Jul 2013 08:21:12 +0000 (UTC)
 (envelope-from hiren@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id B309C1B44;
 Wed, 10 Jul 2013 08:21:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A8LCWh052448;
 Wed, 10 Jul 2013 08:21:12 GMT (envelope-from hiren@svn.freebsd.org)
Received: (from hiren@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A8LADo052432;
 Wed, 10 Jul 2013 08:21:10 GMT (envelope-from hiren@svn.freebsd.org)
Message-Id: <201307100821.r6A8LADo052432@svn.freebsd.org>
From: Hiren Panchasara 
Date: Wed, 10 Jul 2013 08:21:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253139 - in head: share/doc/legal
 share/doc/legal/realtek sys/conf sys/contrib/dev/urtwn sys/dev/usb/wlan
 sys/modules/usb/urtwnfw sys/modules/usb/urtwnfw/urtwnrtl8192cT
 sys/modules/usb...
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 08:21:12 -0000

Author: hiren
Date: Wed Jul 10 08:21:09 2013
New Revision: 253139
URL: http://svnweb.freebsd.org/changeset/base/253139

Log:
  Adding urtwn(4) firmware and related changes.
  
  Reviewed by:	rpaulo
  Approved by:	sbruno (mentor)

Added:
  head/share/doc/legal/realtek/
  head/share/doc/legal/realtek/Makefile   (contents, props changed)
  head/sys/contrib/dev/urtwn/
  head/sys/contrib/dev/urtwn/LICENSE
  head/sys/contrib/dev/urtwn/urtwn-rtl8192cfwT.fw.uu
  head/sys/contrib/dev/urtwn/urtwn-rtl8192cfwU.fw.uu
  head/sys/modules/usb/urtwnfw/
  head/sys/modules/usb/urtwnfw/Makefile   (contents, props changed)
  head/sys/modules/usb/urtwnfw/Makefile.inc   (contents, props changed)
  head/sys/modules/usb/urtwnfw/urtwnrtl8192cT/
  head/sys/modules/usb/urtwnfw/urtwnrtl8192cT/Makefile   (contents, props changed)
  head/sys/modules/usb/urtwnfw/urtwnrtl8192cU/
  head/sys/modules/usb/urtwnfw/urtwnrtl8192cU/Makefile   (contents, props changed)
Modified:
  head/share/doc/legal/Makefile
  head/sys/conf/WITHOUT_SOURCELESS_UCODE
  head/sys/conf/files
  head/sys/dev/usb/wlan/if_urtwn.c

Modified: head/share/doc/legal/Makefile
==============================================================================
--- head/share/doc/legal/Makefile	Wed Jul 10 07:40:30 2013	(r253138)
+++ head/share/doc/legal/Makefile	Wed Jul 10 08:21:09 2013	(r253139)
@@ -3,6 +3,7 @@
 SUBDIR=	intel_ipw \
 	intel_iwi \
 	intel_iwn \
-	intel_wpi
+	intel_wpi \
+	realtek
 
 .include 

Added: head/share/doc/legal/realtek/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/doc/legal/realtek/Makefile	Wed Jul 10 08:21:09 2013	(r253139)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+NO_OBJ=
+FILES=		${.CURDIR}/../../../../sys/contrib/dev/urtwn/LICENSE
+FILESDIR=	${SHAREDIR}/doc/legal/realtek
+
+.include 

Modified: head/sys/conf/WITHOUT_SOURCELESS_UCODE
==============================================================================
--- head/sys/conf/WITHOUT_SOURCELESS_UCODE	Wed Jul 10 07:40:30 2013	(r253138)
+++ head/sys/conf/WITHOUT_SOURCELESS_UCODE	Wed Jul 10 08:21:09 2013	(r253139)
@@ -39,3 +39,4 @@ nodevice	rum
 nodevice	uath
 nodevice	zyd
 nodevice	kue
+nodevice	urtwnfw

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Jul 10 07:40:30 2013	(r253138)
+++ head/sys/conf/files	Wed Jul 10 08:21:09 2013	(r253139)
@@ -2327,6 +2327,35 @@ dev/usb/wlan/if_upgt.c		optional upgt
 dev/usb/wlan/if_ural.c		optional ural
 dev/usb/wlan/if_urtw.c		optional urtw
 dev/usb/wlan/if_urtwn.c		optional urtwn
+urtwnrtl8192cfwT.c		optional urtwn-rtl8192cfwT | urtwnfw	\
+	compile-with	"${AWK} -f $S/tools/fw_stub.awk urtwnrtl8192cT.fw:urtwnrtl8192cfwT -murtwnrtl8192cfwT -c${.TARGET}" \
+	no-implicit-rule before-depend local				\
+	clean		"urtwnrtl8192cfwT.c"
+urtwnrtl8192cfwT.fwo		optional urtwn-rtl8192cfwT | urtwnfw	\
+	dependency	"urtwnrtl8192cT.fw"				\
+	compile-with	"${NORMAL_FWO}"					\
+	no-implicit-rule						\
+	clean		"urtwnrtl8192cfwT.fwo"
+urtwnrtl8192cT.fw		optional urtwn-rtl8192cfwT | urtwnfw	\
+	dependency	"$S/contrib/dev/urtwn/urtwn-rtl8192cfwT.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
+	no-obj no-implicit-rule						\
+	clean		"urtwnrtl8192cT.fw"
+urtwnrtl8192cfwU.c		optional urtwn-rtl8192cfwU | urtwnfw	\
+	compile-with	"${AWK} -f $S/tools/fw_stub.awk urtwnrtl8192cU.fw:urtwnrtl8192cfwU -murtwnrtl8192cfwU -c${.TARGET}" \
+	no-implicit-rule before-depend local				\
+	clean		"urtwnrtl8192cfwU.c"
+urtwnrtl8192cfwU.fwo		optional urtwn-rtl8192cfwU | urtwnfw	\
+	dependency	"urtwnrtl8192cU.fw"				\
+	compile-with	"${NORMAL_FWO}"					\
+	no-implicit-rule						\
+	clean		"urtwnrtl8192cfwU.fwo"
+urtwnrtl8192cU.fw		optional urtwn-rtl8192cfwU | urtwnfw	\
+	dependency	"$S/contrib/dev/urtwn/urtwn-rtl8192cfwU.fw.uu"	\
+	compile-with	"${NORMAL_FW}"					\
+	no-obj no-implicit-rule						\
+	clean		"urtwnrtl8192cU.fw"
+
 dev/usb/wlan/if_zyd.c		optional zyd
 #
 # USB serial and parallel port drivers

Added: head/sys/contrib/dev/urtwn/LICENSE
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/contrib/dev/urtwn/LICENSE	Wed Jul 10 08:21:09 2013	(r253139)
@@ -0,0 +1,39 @@
+Copyright (c) 2010, Realtek Semiconductor Corporation 
+All rights reserved.
+
+Redistribution.  Redistribution and use in binary form, without 
+modification, are permitted provided that the following conditions are 
+met:
+
+* Redistributions must reproduce the above copyright notice and the 
+  following disclaimer in the documentation and/or other materials 
+  provided with the distribution. 
+* Neither the name of Realtek Semiconductor Corporation nor the names of its
+  suppliers may be used to endorse or promote products derived from this
+  software without specific prior written permission. 
+* No reverse engineering, decompilation, or disassembly of this software 
+  is permitted.
+
+Limited patent license. Realtek Semiconductor Corporation grants a world-wide, 
+royalty-free, non-exclusive license under patents it now or hereafter 
+owns or controls to make, have made, use, import, offer to sell and 
+sell ("Utilize") this software, but solely to the extent that any 
+such patent is necessary to Utilize the software alone, or in 
+combination with an operating system licensed under an approved Open 
+Source license as listed by the Open Source Initiative at 
+http://opensource.org/licenses.  The patent license shall not apply to 
+any other combinations which include this software.  No hardware per 
+se is licensed hereunder.
+
+DISCLAIMER.  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.

Added: head/sys/contrib/dev/urtwn/urtwn-rtl8192cfwT.fw.uu
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/contrib/dev/urtwn/urtwn-rtl8192cfwT.fw.uu	Wed Jul 10 08:21:09 2013	(r253139)
@@ -0,0 +1,285 @@
+begin-base64 644 urtwn-rtl8192cfwT.fw.uu
+wYgCADwAAAAKKBQZrD4AAEM0AQAAAAAAAAAAAAAAAAACdFwAAAAAAAAAAAAAAAAAAAAAAlmZAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnK6AAAAAAACaAEAAAUE
+AwIAAwYFBAMABAYFBAIABAgHBgQABgoJCAYACAoJCAQACAoJCAIACAoJCAAACBIREAgAEBoZGBAA
+GCIhIBgAICIhIBAAICIhIAgAICIhHAgAICIhFAgAICIgGAgAIDEwIBAAMDEwGAAAMDEvEBAAMDEs
+EBAAMDEoEAAAMDEgEAAAMDEQEAAAMAQEBAUEBAUHBwcICgQEBAQGCg0OBQUHBwgMFBQEBAQFBwcJ
+CQwOExMEBAQEBQoREwkJCQkMExQVBQUFBQUFBQYGBgYGBQUFBgYGBgYFBQYGBgYGBgUFBQUJCQkJ
+Cw0QEgUJCgwNDhASCQkODhAQEhIAAAAAAAAAAAAkJioYGh0fIScpKgAAAB8jKCosAAQABAAIABAA
+GAAkADAASABgAJAAwADYAFAAeACgAMgBQAGQAeACMAEsAUAB4ALQA+gEsAZAB9AAAgACAAQACAAM
+ABIAGAAkADAASABgAGwAKAA8AFAAZACgAMgA8AEYAGQAoADwAWgB9AJYAyAD6AAAAAABAgICAwQF
+CAECAgIEBw8eBQYHDxIjRmQBAQEBAQIDBAUGBwgBAgMEBQYHCAUGBwgJCgsMIh8eGAAgAAAAAAAA
+AAAAAAAAqwd0hCv1guQ0BPWD4FR/kJd08OBUH6Pw+nXwCeukJGf1guXwNJP1g+D5kJd38Osl4CSB
+9YLkNJL1g+D/o+CQl3jP8KPv8Osl4CQE9YLkNJb1g+D/o+CQl3rP8KPv8Ool4CRm9YLkNEH1g+ST
+/nQBk//k/P3rJeAl4CTh9YLkNJL1gxIqf+rDmUADAkNZkJd14P90xSv1guQ0lvWD7/DvBJCXdvCQ
+l3fg/5CXduD+059AAwJDmO7DlBBAIe4k8P90AX4AqAcIgAXDM84zztj5/5CXeOBe/qPgX05wJ5CX
+duD/w5QQUEp0AX4AqAcIgAXDM84zztj5/5CXeuBe/qPgX05gLZCXduD/ZBNgCe9kEmAE77QRDZCX
+eOAw4AaQl3Z0GPCQl3bgkJd18JCXdPCASJCXduAE8AJCxJCXd+D6kJd14P9qcHl0xSv1guQ0lvWD
+7/B18AnrpCRp9YLl8DST9YPgtAETkJd04P8w5gEikJd14ERAkJd08JCXdeD/JeAknvWC5DRB9YPk
+k/x0AZP97yXgJGb1guQ0QfWDdAGTLf/kkzzDE/7vE//k/P3rJeAl4CTh9YLkNJL1gxIqf4BpkJd1
+4NOaQGGQl3fg/3TFK/WC5DSW9YPv8JCXde/wkJd08Pqj4P8l4CSe9YLkNEH1g+ST/HQBk/3vJeAk
+ZvWC5DRB9YN0AZMt/+STPMMT/u8T/+T8/esl4CXgJOH1guQ0kvWDEip/rwIidAEr9YLkNJL1g+Tw
+kJd04ESA/3SEK/WC5DQE9YPv8CKQl2br8KPq8KPp8KKv5DOj8MKvkJdm4Puj4Pqj4PmQAAESYzf6
+5fAkAP/kOv6Ql2aj4PqQAAHuj/ASY44SKdn/YDe1IhuQl2bg+6Pg+qPg+ZAAARJjN2UkcATlI2Xw
+YC6Ql2bg+6Pg+qPg+ZAAARJjN/+u8BJ79IAVkJdm4Puj4Pqj4PkSKdllImADEn6CkJdp4CT/kq8i
+5PUlIgJ+lQJ+nOSQl1rwkJda4P/DlCBAAwJOXHXwCe+kJGr1guXwNJP1g+BkAWADAk5TkJda4CXg
+JMD1guQ0kfWD4Pyj4NOUAOyUAFADAk5T73XwCqQkAPl0kDXw+nsBixT1FYkWkJda4CXgJMD1guQ0
+kfWD4P2j4JCXZs3wo+3w7yXgJIP1guQ0lPWD4P+j4JCXaM/wo+/wkAACEmM3/67wEmMML//l8D6Q
+l2/wo+/wkAAGEmM3/67wkAAEEmM3L//l8D6Ql23wo+/wkAAIEmM3/5CXa+Xw8KPv8JCXWuD+JIT1
+guQ0BPWD4FQ/kJdc8OD9VB+j8HXwCe6kJGf1guXwNJP1g+CQl3HwkJda4PskhPWC5DSW9YPgw5QF
+QAMCSbqQl3Hg/pCXXeCeQBOQl3HgkJdd8O1UQP2Ql1zw7k3wkAT94GQBcCiQl13g/5BBSpP+dEMr
+9YLkNJX1g+DDnkAG75BBEoAykJdd4JBBLoApkJdd4P+QQUqT/pCXWuAkQ/WC5DSV9YPgw55ABu+Q
+QNqAB5CXXeCQQPaTkJdq8JCXauB18AakJFD5dEA18HUR//USiROQl1zgkEHyk//TkJdp4J+Ql2jg
+lABADZCXWuD/5P0SXzICTemQl1rgJeAl4CTh9YLkNJL1g+D8o+D9o+D+o+D/kJdeEip/kJde4Pij
+4Pmj4Pqj4PvAAMABwALAA6sRqhKpExIp2f9+AKsUqhWpFhJjDP2s8BIp8uT8/dAD0ALQAdAA6y//
+6j7+7Tn97Dj8kJdeEip/kJde4Pij4Pmj4Pqj4PvAAMABwALAA6sRqhKpE5AAARJif/9+AKsUqhWp
+FpAAAhJjN/2s8BIp8uT8/dAD0ALQAdAA6y//6j7+7Tn97Dj8kJdeEip/kJde4Pij4Pmj4Pqj4PvA
+AMABwALAA6sRqhKpE5AAAhJif/9+AKsUqhWpFpAABBJjN/2s8BIp8uT8/dAD0ALQAdAA6y//6j7+
+7Tn97Dj8kJdeEip/kJde4Pij4Pmj4Pqj4PvAAMABwALAA6sRqhKpE5AAAxJif/9+AKsUqhWpFpAA
+BhJjN/2s8BIp8uT8/dAD0ALQAdAA6y//6j7+7Tn97Dj8kJdeEip/kJde4Pij4Pmj4Pqj4PvAAMAB
+wALAA6sRqhKpE5AABBJif/9+AKsUqhWpFpAACBJjN/2s8BIp8uT8/dAD0ALQAdAA6y//6j7+7Tn9
+7Dj8kJdeEip/qxGqEqkTkAAFEmJ//34AkJdm4Pyj4P0SKfLk/P2Ql17g+KPg+aPg+qPg+9MSY7uQ
+l15AUOD8o+D9o+D+o+D/wATABcAGwAerEaoSqROQAAUSYn//fgCQl2bg/KPg/RIp8qsHqgbQB9AG
+0AXQBMPvm//umv7tlAD97JQA/JCXXhIqf4AHEiqLAAAAAJCXXuD8o+D9o+D+o+D/kJda4CXgJeAk
+4fWC5DSS9YMSKn+Ql1zgJeAkZvWC5DRB9YPkk/50AZP/5Pz9kJde4Pij4Pmj4Pqj4PvTEmO7QAuQ
+l1rg/xJCIAJNYJCXXOAl4CSe9YLkNEH1g+ST/nQBk//k/P2Ql17g+KPg+aPg+qPg+8MSY7tAAwJN
+YJCXWuD/fQESXzICTWCQl1rg/ySE9YLkNJb1g+BkBWADAkujdfAJ76Qka/WC5fA0k/WD4GQBcAMC
+S6OQk2Lg/7QDC5CXXeDDlBlAPYAu77QCC5CXXeDDlBFALoAfkJNi4P+0AQuQl13gw5QKQBuADO9w
+EZCXXeDDlANADZCVY3QB8IAF5JCVY/CQl1rg/yRD9YLkNJX1g+D+w5QwUAvkkJdy8HSELwJLTZCV
+Y+BkAWADAktCkJda4CRk9YLkNJX1g+BkCmBbkJda4P/uJAX95DP8dCEv9YLkNJL1g+D/053sZID4
+dICYUDiQl1rg/u8kBf3kM/x0Qy71guQ0lfWD4NOd7GSA+HSAmFAWkJda4CSk9YLkNJb1g+D/kJdd
+4G9gVpCXWuAkQ/WC5DSV9YPg/9OURkAIkJdydAXwgBHv05Q8kJdyQAV0A/CAA3QB8JCXWuD/JEP1
+guQ0lfWD4P50IS/1guQ0kvWD7vCQl1rgJGT1guQ0lYAvkJda4P8khPWC5DSW9YPk8HRkL/WC5DSV
+9YPgBPCAFOSQl3LwkJda4CSE9YLkNJb1g+TwkJdd4P+Ql1rg/iSk9YLkNJb1g+/w7jDgHpCXcuDE
+VPDwkJda4MMT/ySk9YLkNAT1g+BUDwJNQ5CXWuDDE/8kpPWC5DQE9YPgVPACTUOQl1rg/ySE9YLk
+NJb1g+BkBmADAk1gdfAJ76Qka/WC5fA0k/WD4GQBcAMCTWCQl14SKosAAAAAkEIT5JP/fgCQl2bg
+/KPg/RIp8uT8/ZCXYhIqf+SQl1vwkJde4Pij4Pmj4Pqj4PvAAMABwALAA6sUqhWpFpCXW+D/dfAC
+pPWChfCDEmM3/azw75BCDpP/fgASKfLk/P3QA9AC0AHQAOsv/+o+/u05/ew4/JCXXhIqf5CXYuD8
+o+D9o+D+o+D/kJde4Pij4Pmj4Pqj4PvTEmO7UA6Ql1vgBPDgZAVgAwJL+5CXW+DDE/CQl3Lg/7QB
+DZCXW+BwXZCXcgTwgFvvtAMdkJdb4P9wCJCXcnQD8IBI77QBCJCXcnQB8IA8gDWQl3LgZAVwMpCX
+W+D/cAiQl3J0BfCAD++Ql3K0AQV0A/CAA3QB8NOQl2nglAOQl2jglABABeSQl3Lw05CXaeCUA5CX
+aOCUAEAF5JCXcvCQl1rg/zDgGpCXcuDEVPDw78MT/ySk9YLkNAT1g+BUD4ATkJda4MMT/ySk9YLk
+NAT1g+BU8PB0pC/1guQ0BPWDwIPAguD/kJdy4P7vTtCC0IPwkJda4P8khPWC5DSW9YPg05QFUA90
+hC/1guQ0lvWD4ATwgA+Ql1rgJIT1guQ0lvWD5PCQl1rg/ySE9YLkNAT1g+BUH8OUCVAFkJIAgBF0
+hC/1guQ0BPWD4JCSACDiBXQI8IADdATwkJda4GANkJbE4P+QkgDgw59QCJCSAOCQlsTwkJbE4JAE
+gPCrFKoVqRbk9fASY2+rFKoVqRaQAALk9fASY46QAATk9fASY46QAAbk9fASY46QAAjk9fASY46Q
+l1rg/yXgJMD1guQ0kfWD5PCj8O8l4CSD9YLkNJT1g+Two/DvJeAkw/WC5DSU9YPk8KPwkJda4ATw
+AkUOIu9wAwJQxZCXTeBgAwJVB5CXOeD8o+D9o+D+o+D/kICFEip/f4x+CBIv2ZCW5eD8o+D9o+D+
+o+D/kICFEip/f0R+CBIv2ZCW6eD8o+D9o+D+o+D/kICFEip/f1x+CBIv2ZCW7eD8o+D9o+D+o+D/
+kICFEip/f2x+DhIv2ZCW8eD8o+D9o+D+o+D/kICFEip/f3B+DhIv2ZCW9eD8o+D9o+D+o+D/kICF
+Eip/f3R+DhIv2ZCW+eD8o+D9o+D+o+D/kICFEip/f3h+DhIv2ZCW/eD8o+D9o+D+o+D/kICFEip/
+f3x+DhIv2ZCXAeD8o+D9o+D+o+D/kICFEip/f4B+DhIv2ZCXBeD8o+D9o+D+o+D/kICFEip/f4R+
+DhIv2ZCXCeD8o+D9o+D+o+D/kICFEip/f4h+DhIv2ZCXDeD8o+D9o+D+o+D/kICFEip/f4x+DhIv
+2ZCXEeD8o+D9o+D+o+D/kICFEip/f9B+DhIv2ZCXFeD8o+D9o+D+o+D/kICFEip/f9R+DhIv2ZCX
+GeD8o+D9o+D+o+D/kICFEip/f9h+DhIv2ZCXHeD8o+D9o+D+o+D/kICFEip/f9x+DhIv2ZCXIeD8
+o+D9o+D+o+D/kICFEip/f+B+DhIv2ZCXJeD8o+D9o+D+o+D/kICFEip/f+x+DhIv2ZCXKeD8o+D9
+o+D+o+D/kICFEip/fwR+DBIv2ZCXLeD8o+D9o+D+o+D/kICFEip/fwR+DRIv2ZCXMeD8o+D9o+D+
+o+D/kICFEip/fwx+CRIv2ZCXNeD8o+D9o+D+o+D/kICFEip/fwR+CBIv2ZCXTXQB8CKQl03gZAFg
+AwJVB3+MfggSJ96QlzkSKn9/RH4IEifekJblEip/f1x+CBIn3pCW6RIqf39sfg4SJ96Qlu0SKn9/
+cH4OEifekJbxEip/f3R+DhIn3pCW9RIqf394fg4SJ96QlvkSKn9/fH4OEifekJb9Eip/f4B+DhIn
+3pCXARIqf3+Efg4SJ96QlwUSKn9/iH4OEifekJcJEip/f4x+DhIn3pCXDRIqf3/Qfg4SJ96QlxES
+Kn9/1H4OEifekJcVEip/f9h+DhIn3pCXGRIqf3/cfg4SJ96Qlx0SKn9/4H4OEifekJchEip/f+x+
+DhIn3pCXJRIqf38EfgwSJ96QlykSKn9/BH4NEifekJctEip/fwx+CRIn3pCXMRIqf38EfggSJ96Q
+lzUSKn9/jH4IEifekJfDEip/kJfD4Pyj4P2j4P6j4P/tRMD97JCXwxIqf5CXw+D8o+D9o+D+o+D/
+kICFEip/f4x+CBIv2ZCAhRIqiwABAAB/RH4IEi/ZkICFEiqLANslpH9cfggSL9mQgIUSKosg2yWk
+f2x+DhIv2ZCAhRIqiyDbJaR/cH4OEi/ZkICFEiqLBBslpH90fg4SL9mQgIUSKosEGyWkf3h+DhIv
+2ZCAhRIqiwQbJaR/fH4OEi/ZkICFEiqLBBslpH+Afg4SL9mQgIUSKotj2yWkf4R+DhIv2ZCAhRIq
+iwQbJaR/iH4OEi/ZkICFEiqLINslpH+Mfg4SL9mQgIUSKosg2yWkf9B+DhIv2ZCAhRIqiyDbJaR/
+1H4OEi/ZkICFEiqLINslpH/Yfg4SL9mQgIUSKosAGyWkf9x+DhIv2ZCAhRIqiwAbJaR/4H4OEi/Z
+kICFEiqLJNslpH/sfg4SL9l/BH4MEifekJfDEip/kJfD4Pyj4P2j4P7k/+yQl8MSKn+Ql8Pg/KPg
+/aPg/qPgRBH/7JCXwxIqf5CXw+D8o+D9o+D+o+D/kICFEip/fwR+DBIv2X8Efg0SJ96Ql8MSKn+Q
+l8Pg/KPg/aPg/qPgVPD/7JCXwxIqf5CXw+D8o+D9o+D+o+BEAf/skJfDEip/kJfD4Pyj4P2j4P6j
+4P+QgIUSKn9/BH4NEi/Zfwx+CRIn3pCXwxIqf5CXw+D8o+D9o+D+5P/skJfDEip/kJfD4Pyj4P2j
+4P6j4EQR/+yQl8MSKn+Ql8Pg/KPg/aPg/qPg/5CAhRIqf38MfgkSL9l/DH4JEifekJfDEip/kJfD
+4Pyj4P2j4P6j4P/tVA/97FTw/JCXwxIqf5CXw+D8o+D9o+D+o+D/7UQQ/exEAfyQl8MSKn+Ql8Pg
+/KPg/aPg/qPg/5CAhRIqf38MfgkSL9l/BH4IEifekJfDEip/kJfD4Pyj4P2j4P6j4FTw/+yQl8MS
+Kn+Ql8Pg/KPg/aPg/qPgRAH/7JCXwxIqf5CXw+D8o+D9o+D+o+D/kICFEip/fwR+CBIv2eSQl03w
+Io8R7yXgJAT1guQ0lq+C9RKPE+URdfACpCSB+XSSNfB1FAH1FYkWdfAJ5RGkJGX1guXwNJOvgvUX
+jxjlEXXwCaQkY/l0kzXwdRkB9RqJG3TBJRH1guQ0kvWD4BJj2FWKAFWfAVW0AlXJA1XzBFYIBVYd
+BlZEDFZyDVafDlbMDwAAVwDlESXgJAT1guQ0lvWDdPDwo3QVgDzlESXgJAT1guQ0lvWDdPDwo3QQ
+gCflESXgJAT1guQ0lvWDdPDwo3QFgBLlESXgJAT1guQ0lvWDdPDwo+Tw5REl4CSB9YLkNJL1g3QP
+8KN0j/ACVwDlESXgJAT1guQ0lvWDdA/wo3T1gCflESXgJAT1guQ0lvWDdA/wo3TwgBLlESXgJAT1
+guQ0lvWD5PCjdA3w5REl4CSB9YLkNJL1g+Two/ACVwCQBEfgqxSqFakWEmKskARG4KsUqhWpFpAA
+ARJivpAEReCFE4KFEoPwkAREAlb3kARL4KsUqhWpFhJirJAESuCrFKoVqRaQAAESYr6QBEnghROC
+hRKD8JAESIBYkARP4KsUqhWpFhJirJAETuCrFKoVqRaQAAESYr6QBE3ghROChRKD8JAETIArkART
+4KsUqhWpFhJirJAEUuCrFKoVqRaQAAESYr6QBFHghROChRKD8JAEUOCFE4KFEoOj8KsUqhWpFsAD
+wALAARIp2f+rGaoaqRsSKdlf0AHQAtADEmKsqxTlFiQB+eQ1FfrAA8ACwAESKdn/qxmqGqkbkAAB
+EmJ/X9AB0ALQAxJirIUTgoUSg8CDwILg/4UYgoUXg+D+717QgtCD8IUTgoUSg6PAg8CC4P+FGIKF
+F4Oj4P7vXtCC0IPw5REl4CSB9YLkNJL1g+D+o+BOYEyQl3J0C/CQl3Lg/8OUAFADAlhGdAF+AKgH
+CIAFwzPOM87Y+f/lESXgJIH1guQ0kvWD4F7+o+BfTmAKkJdy4CQQo/CAaJCXcuAU8IC65REl4CQE
+9YLkNJb1g+D+o+BOYEeQl3J0D/CQl3Lg/8OUAEA8dAF+AKgHCIAFwzPOM87Y+f/lESXgJAT1guQ0
+lvWD4F7+o+BfTmAIkJdy4KPwgA2Ql3LgFPCAv+SQl3Pw5REl4CQE9YLkNJb1g+D+o+BOYEfkkJdy
+8JCXcuD/w5QQQAMCWQB0AX4AqAcIgAXDM84zztj5/+URJeAkBPWC5DSW9YPgXv6j4F9OYAaQl3Lg
+gGOQl3LgBPCAvuURJeAkgfWC5DSS9YPg/qPgTmBG5JCXcvCQl3Lg/8OUDFA8dAF+AKgHCIAFwzPO
+M87Y+f/lESXgJIH1guQ0kvWD4F7+o+BfTmAIkJdy4CQQgAmQl3LgBPCAv+SQl3TwkJdz4P918Anl
+EaQkZ/WC5fA0k/WD7/CQl3Tg/nXwCeURpCRo9YLl8DST9YPu8HSEJRH1guQ0BPWD4NOfQB+Ql3Pg
+/3SkJRH1guQ0lvWD7/B0hCUR9YLkNAT1g+/wkJdz4P/TlBNACJCTYnQD8IAh79OUC0AIkJNidALw
+gBPv05QDQAiQk2J0AfCABeSQk2LwkJNi4JAEsfAiwODA8MCDwILA0HXQAMAAwAHAAsADwATABcAG
+wAeQAcR0mfB0WaPwkAE34FUr9S+QATTgVSj1LJABNuBVKvUu5Swg4AMCW0uQATR0AfCF0U2F0k6F
+00+F1FCF1VGF1lKF11OF2VTlVFRAwxP/5VNUIG9wAwJa+OVUMOUDAlr45VJUH/UI5U1UP/UJ5VFU
+H//lCCXgJAP1guQ0lfWD5I/wEmLg5VNUH//lCCXgJMD1guQ0kfWD5I/wEmLg5QnTlARAA3UJBHXw
+CuUIpCQA9YLl8DSQ9YN18ALlCRJjzOD+o+D/5VNUHy//5D7+dfAK5QikJAD1guXwNJD1g3XwAuUJ
+EmPM7vCj7/DlVCDmJOVTVB//5Qgl4CSD9YLkNJT1g+SP8BJi4OVPMOc2rwgSddiAL+VTVB//5Qgl
+4CTD9YLkNJT1g+SP8BJi4OVPMOcS5U9Uf/3lU1Qf9Q2rCa8IEna65WZgT5CXreBgNZABW+TwkAE8
+dATwkAQb4FR/ZH9wNHVEFPVF+/1/WH4BEjWrkAFbdAXwkAaSdAHwkJen8IAUkAQb4FR//79/CpCX
+q+D/fQESb0nlLDDhIZABNHQC8IXRVoXSV4XTWIXUWYXVWoXWW4XXXIXZXRJ82eUsMOMGkAE0dAjw
+5Sww5AmQATR0EPBDVRDlLDDlIZABz+Aw5RrgVN/wkAE0dCDwkAAD4FT78H8QfgASN1SA/uUsMOYG
+kAE0dEDw5S4w4QmQATZ0AvBDVUDlLjDgCZABNnQB8BJ1YuUuMOJjkAE2dATw5WVkAXBX5WZgU+Vm
+ZAJwJ5AGq+CQl5/wkAaq4JCXqvCQl5/gcAeQl6rg/4AFkJef4P+Ql5/v8JCXoeBgA+AU8JCXoOTw
+kAFX8JABPHQC8JCXr+BU/fDgVO/wEnZO5S4w4zGQATZ0CPDlZWQBcCXlZmAhkAFX5PCQATx0AvB1
+RAN1RQDk+/1/VH4BEjWrkAFXdAXw5S4w5DqQATZ0EPDlZWQBcC7lZmAqkAFX5PCQATx0AvCQl67k
+8JCXr+BU/fDgVANwDpCXqfCQl6vg/30BEm9J5S4w5RKQATZ0IPDlZbQBB+VmYAMSffrlLjDmKpAB
+NnRA8OVlZAFwHuVmYBqQl6/gVP7w4FQDcA6Ql6nwkJer4P99ARJvSeUvMOEJkAE3dALwEnwodJkE
+kAHE8HRZo/DQB9AG0AXQBNAD0ALQAdAA0NDQgtCD0PDQ4DKQBER0EfCjdPDwo3QP8KPk8JCXWvCQ
+l1rg/8OUEFAUdKQv9YLkNAT1g+TwkJda4ATwgOLkkJda8JCXWuD7w5QgQAMCXzHg/3XwCqQkAPWC
+5fA0kPWD5PCj8HXwCu+kJAL1guXwNJD1g+Two/B18ArvpCQE9YLl8DSQ9YPk8KPwdfAK76QkBvWC
+5fA0kPWD5PCj8HXwCu+kJAj1guXwNJD1g+Two/B0pC/1guQ0lvWDdBPwdGQv9YLkNJX1g+Tw7yXg
+JMD1guQ0kfWD5PCj8O8l4CSD9YLkNJT1g+Two/DvJeAkA/WC5DSV9YPk8KPw7yXgJMP1guQ0lPWD
+5PCj8O8l4CSE9YLkNJX1g+Two/DvJeAkxPWC5DSV9YPk8KPwdGQv9YLkNJb1g+TwdEQv9YLkNJb1
+g+TwdIQv9YLkNJb1g+TwkEHEk/50AZP/kEGMdAGTL//kkz7DE/7vE//k/P3rJeAl4CTh9YLkNJL1
+gxIqf3XwCeukJGr1guXwNJP1g3QB8HXwCeukJGn1guXwNJP1g3QB8HTBK/WC5DSS9YN0DPB18Anr
+pCRl9YLl8DST9YN0//Cj8HXwCeukJGP1guXwNJP1g+Two3QP8HXwCeukJGf1guXwNJP1g3QT8HXw
+CeukJGj1guXwNJP1g+TwdIQr9YLkNAT1g3QT8JCXWuAE8AJdZiKpB3SEKfWC5DQE9YPgVH+Ql3Tw
+4FQf/5CXd/B18AnppCRo9YLl8DST9YPgkJd58HXwCemkJGf1guXwNJP1g+D+kJd68Okl4CQE9YLk
+NJb1g+D7o+CQl3vL8KPr8Okl4CSB9YLkNJL1g+D7o+CQl33L8KPr8O/TnkAMkJd64JCXd/CQl3Tw
+7XADAmCRkJd47fCQl3TgMOYOkJd34JCXdPCQl3jgFPCQl3jgcAMCYJGQl3fg/9OUAFADAmCR5JCX
+dvDvFJCXdfCQl3ng/ZCXdeD/051Ab++UEEAh7yTw/3QBfgCoBwiABcMzzjPO2Pn/kJd94F7+o+Bf
+TnAnkJd14P/DlBBQN3QBfgCoBwiABcMzzjPO2Pn/kJd74F7+o+BfTmAakJd14JCXdPCQl3bgBPCQ
+l3jg/5CXduBvYAiQl3XgFPCAg5CXeOD/kJd24MOfUA+Ql3XgtQUIkJd54JCXdPCQl3Tg/yXgJJ71
+guQ0QfWD5JP8dAGT/e8l4CRm9YLkNEH1g3QBky3/5JM8wxP+7xP/5Pz96SXgJeAk4fWC5DSS9YMS
+Kn+Ql3Tg/3SEKfWC5DQE9YPv8CKQAczgVA+Ql1rwkJda4P1wAwJifpCX0eD/dAF+AKgHCIAFwzPO
+M87Y+f/vXXADAmJfkJfR4HXwBKQk0PWC5fA0AfWD4JCXW/Cir+Qzo/DCr3VhAXVil3VjW3VkAXsB
+epd5XRJ4j5CXXOAk/5Kvo+D/xBMTE1QBkJfRMOBw4HXwAqQkiPWC5DXw9YPgkJde8JCX0eB18AKk
+JIn1guQ18PWD4JCXX/CQl9HgdfAEpCTR9YLl8DQB9YPgkJdg8JCX0eB18ASkJNL1guXwNAH1g+CQ
+l2HwkJfR4HXwBKQk0/WC5fA0AfWD4JCXYvCAQuB18ASkJNH1guXwNAH1g+CQl17wkJfR4HXwBKQk
+0vWC5fA0AfWD4JCXX/CQl9HgdfAEpCTT9YLl8DQB9YPgkJdg8O9Uf/97AXqXeV4SbbmQl1rg/5CX
+0eD+dAGoBgiAAsMz2Pz0X5CXWvCQl9Hg/3QBqAcIgALDM9j8kAHM8JCX0eAE8OBUA/ACYPLCr3To
+BJABxPB0YKPwkJda4JABxvCQl9HgkAHH8ID+IrsBDOWCKfWC5YM69YPgIlAG6SWC+OYiu/4G6SWC
++OIi5YIp9YLlgzr1g+STIrsBBomCioPwIlAC9yK7/gHzIvi7AQ3lgin1guWDOvWD6PAiUAbpJYLI
+9iK7/gXpJYLI8iLF8Pij4CjwxfD45YIVgnACFYPgOPAio/jgxfAl8PDlghWCcAIVg+DIOPDoIrsB
+ComCioPg9fCj4CJQBofwCecZIrv+B+P18AnjGSKJgoqD5JP18HQBkyK7ARDlgin1guWDOvWD4PXw
+o+AiUAnpJYL4hvAI5iK7/grpJYL44vXwCOIi5YMq9YPpk/Xwo+mTIrsBComCioPw5fCj8CJQBvcJ
+p/AZIrv+BvPl8AnzGSL4uwER5YIp9YLlgzr1g+jw5fCj8CJQCeklgsj2CKbwIrv+Ceklgsjy5fAI
+8iLrn/Xw6p5C8OmdQvDonEXwIqQlgvWC5fA1g/WDItCD0IL45JNwEnQBk3ANo6OT+HQBk/WCiIPk
+c3QCk2hg76Ojo4Df5JCXV/Cj8BJ5hZAAAuBU4JCXtmAFdAHwgAN0AvCQAPPgMOMIkJe3dAHwgAXk
+kJe38JCXt+C0AROQAPLgMOcMkJewdP3wo3Qz8IAKkJewdP3wo3Qv8OT1VRJdLhJ+jBJ5NhIyPRJE
+/3UoM+T1KXUqAvUrkAEw5Sjwo+Up8KPlKvCj5SvwkADz4DDiDZAFQXQQ8JAFWvCj5PCQAWR0oPB1
+RP/k9UX7fQF/UH4BEjWrdTAfdTEB5PUykAE45TDwo+Ux8KPlMvASeDiQl1nl2fCQATx0//Cj8KPw
+kAE08KPwo/Cj8MKvkACA4ERA8H8QfgASN1R16ANDqIXSr5ABwOTwo/Cj8KPwkAHG8KPwkJdX4GQB
+8CT+kAHE8HRjo/DlVTDmF8KvU1W/0q8SRQmQl43g/2ADtAEDEmkS5VUw5wfCr1NVf9Kv5VUw5ArC
+r1NV79KvEmDokJeN4HADEmwKEnyFgKqQAAISYn+Ql4vwkAABEmJ/JeAl4JCXivASKdkl4CXgkJeO
+8JCXi+CQBJjwkJeK4BMTVD+QBJnwkJeO4BMTVD+QBJrwkAVg4JCXmfCQBWHgkJea8JAFYuCQl5vw
+kAVj4JCXnPCir+QzkJdp8MKvkJeK4P8SeOSQl2ngJP+Sr5CXi+BwAwJmjJCXiuBwAwJmjJCXjuBw
+AwJmjKKv5DOQl2nwwq+Ql510AfCQl2ngJP+Sr5AAReBU/vCj4EQB8JCXg+BgHZCXj+D8o+D9o+D+
+o+D/kICFEip/f4B+CBIv2YAGkAUidH/wkABF4FTv8JAFh+BkgPCQl5ngkAWE8JCXmuCQBYXwkJeb
+4JAFhvCQl5zgkAWH8KKv5DOQl2nwwq+QATzgRCDwfSDk/xI3AIArkJeL4HAtkJed8JAAReBU/vCj
+4FT+8JAFIuTwoq8zkJdp8MKvfSDk/xI2kpCXaeAk/5KvIpCXZuvwo+rwo+nwkJdm4Puj4Pqj4PmQ
+AAQSYn//VB+Ql2nwkAADEmJ/VPDEVA+Ql2rw71QgxBNUB6PwkAAEEmJ/VEDEExNUA5CXbPCQl2ng
+/3XwCaQkZfWC5fA0k62CkJdt8KPt8O918AmkJGP5dJM18PqjdAHwo+rwo+nwkJdmo+D6o+D5kAAD
+EmJ/VA//kJdv4Puj4Pqj4PnvEmKskJdm4Puj4Pqj4PmQAAISYn//kJdv4Puj4Pqj4PmQAAHvEmK+
+kJdm4Puj4Pqj4PmQAAESYn//kJdt4Pyj4P31goyD7/ASKdmNgoyDo/CQl2rg/pCXaeD/JMH1guQ0
+kvWD7vCQl2vg/nXwCe+kJGn1guXwNJP1g+7wdfAJ76QkavWC5fA0k/WDdAHwkJds4P518AnvpCRr
+9YLl8DST9YPu8AJVCMDgwPDAg8CCwNB10ADAAMABwALAA8AEwAXABsAHkAHEdAHwdGij8FOR35AB
+POBVMPU0o+BVMfU1o+BVMvU25TQw4A+QATx0AfCQAVN0B/BDVYDlNDDhCZABPHQC8BJ50eU0MOI6
+kAE8dATwkAaS4DDgHnVEFHVFAOT7/X9YfgESNauQAVt0BfCQBpJ0AfCAD5CXp+TwkJer4P99ARJv
+SeU0MOMGkAE8dAjw5TQw5AmQATx0EPASfgvlNDDlCZABPHQg8BJuheU1MOAVkAE9dAHwkACD4JCX
+q/Dg/30BEm9J5TYw4waQAT50CPB0AQSQAcTwdGij8NAH0AbQBdAE0APQAtAB0ADQ0NCC0IPQ8NDg
+MpCXhODDlBRQBuAE8AJpzJCXhOBkFGADAmnMkJeT4HAlkJeW4HAfkJeU4HAZkJeX4HATkJeV4HAN
+kJeY4HAHkAT94FT+8JCXk+CQBIjwkJeU4JAEifCQl5XgkASK8KPk8JCXluCQBIzwkJeX4JAEjfCQ
+l5jgkASO8KPk8JCXf+CQBJDwkJeA4JAEkfCQl4HgkASS8JCXguCQBJPw5JCXhPCQl38E8OSj8KPw
+o/CQl5Pwo/Cj8KPwo/Cj8JAFYOCQl1rwkAVh4JCXW/CQBWLgkJdc8JAFY+CQl13wkJec4P+Ql13g
+/tOfUAuQl5zgw57TlAFAEZCXiuC0AQKAA5CXjuD/EnjkIpCX0O3wkJfP7/DTlAdQbeD/dAGoBwiA
+AsMz2Pz0/5AAR+Bf8H8QfgASN1SQl8/g/3QBqAcIgALDM9j8/5AARuBP8H8QfgASN1SQl9DgYBaQ
+l8/g/3QBqAcIgALDM9j8/5AARYB4kJfP4P90AagHCIACwzPY/PT/kABFgH2Ql8/gJPjw4P90AagH
+CIACwzPY/MRU8PT/kABD4F/wfxB+ABI3VJCXz+D/dAGoBwiAAsMz2Pz/kABD4E/wfxB+ABI3VJCX
+0OBgG5CXz+D/dAGoBwiAAsMz2PzEVPD/kABC4E+AGpCXz+D/dAGoBwiAAsMz2PzEVPD0/5AAQuBf
+8H8QfgASN1Qif3h+CBIn3pCXPRIqf38EfgwSJ96Ql0ESKn9/AH4IEifekJdFEip/kJe34JCXPbQB
+E+D8o+D9o+D+o+BUx//tVMf9gA3g/KPg/aPg/qPgVMf/7JCAhRIqf394fggSL9mQl0Hg/KPg/aPg
+/qPgVA//7JCAhRIqf38EfgwSL9mQl0Xg/KPg/aPg/qPgRAL/7JCAhRIqf38AfggSL9l/cH4OEife
+kJdJEip/kICFEiqLABsloH9wfg4SL9mQgFkSKosAAAAA5P3/EjSBkJe34LQBEZCAWRIqiwAAAADk
+/X8BEjSBkAAR4FT28H8QfgACN1SQl53gZAFgCZCXi+BgAwJs4pCXf+DDlP9QBeAE8IA7kJeA4MOU
+/1AG4ATw5IAokJeB4MOU/1AK4ATw5JCXgPCAFZCXguDDlP9QEOAE8OSQl4HwkJeA8JCXf/CQAETg
+VAxgduAw4jKQl5Pgw5T/UAXgBPCAJJCXlODDlP9QBuAE8OSAEZCXleDDlP9QDOAE8OSQl5TwkJeT
+8JAAROAw4zKQl5bgw5T/UAXgBPCAJJCXl+DDlP9QBuAE8OSAEZCXmODDlP9QDOAE8OSQl5fwkJeW
+8JAE/eBEAfAiixGKEokTkAACEmJ/kJeM8OAw4FyQl4N0AfB/gH4IEifekJeFEip/qxGqEqkTkAAB
+EmJ//+T8/f54GhIqbKgEqQWqBqsHkJeF4Pyj4P2j4P6j4P/sVAP860//6k7+6U396Ez8kJePEip/
+kAUi5PCANeSQl4Pwf4B+CBIn3uxUA/zsRMD8kJeFEip/kJeF4Pyj4P2j4P6j4P+QgIUSKn9/gH4I
+Ei/ZkJeM4JAARzDhEXQM8KPgRAzwkABG4EQQ8IAQ4FTz8KPgVPPwkABG4FTv8OSQl4nwIpCXY+vw
+o+rwo+nw7xJj2G3qAW34Am4GA24UBW4iBm4wB24+CW5MDG5aDW5oDgAAbnaQl2Pg+6Pg+qPg+QJ8
+spCXY+D7o+D6o+D5An6jkJdj4Puj4Pqj4PkCfFeQl2Pg+6Pg+qPg+QJ63pCXY+D7o+D6o+D5AmbA
+kJdj4Puj4Pqj4PkCflSQl2Pg+6Pg+qPg+QJEaJCXY+D7o+D6o+D5AmVfkJdj4Puj4Pqj4PkCe4mQ
+l2Pg+6Pg+qPg+QJs48KvdLkEkAHE8HRto/CA/pCXi+BkAWADAm9IkABG4EQB8JCXneBwQJCXg+Bg
+HZCXj+D8o+D9o+D+o+D/kICFEip/f4B+CBIv2YAGkAUidH/wkJeK4P8SeOSQl510AfCQAEXgVP7w
+gESQl53gZAFwPJCXjuD/Enjk5JCXnfCQAEXgRAHwkJeD4GAdkJeF4Pyj4P2j4P6j4P+QgIUSKn9/
+gH4IEi/ZgAWQBSLk8JAFh+BkgPCQl5ngkAWE8JCXmuCQBYXwkJeb4JAFhvCQl5zgkAWH8CKPJo0n
+5SZUD/+Ql6jgVA9vYHjlJjDiMJCXqOAg4gV/ARJ9PpCXqOAw4wrlJiDjBRJ9XYBWkJeo4CDjT+Um
+MONKrycSfR6AQ5CXqOBUD/+/DA7lJiDjCRJ8/e9gLhJ9XZCXqOBUD/+/BA7lJiDiCRJ7Gu9gFhJ7
+UpCXqOBUD/+/AgkSeqDvYAMSfXqQl6jgVA//kJer4FQPb3Aj4DDmH5CXqOBUD/+Ql57g/k+QAS/w
+7mSAkJee8JCXq+BUv/AikJdQ6/Cj6vCj6fCQl7bgZAJwAwJwvJABr+BgCZABx+AE8PCA8ZCX0+D/
+BPCQl1Dg+6Pg+qPg+ZAAAe8SYr6ir+QzkJdW8MKvkJdQ4Puj4Pqj4IthimL1Y3VkAnsBegF5oBJ4
+j5CXVuAk/5Kvoq/kM/DCr5CXU+D7o+D6o+CLYYpi9WOQl1Dg+6Pg+qPg+RIp2f/EVA/1ZHsBegF5
+ohJ4j5CXVuAk/5KvkAGvdP/wkAHL4GSA8CKQl77v8KPt8OSj8KPw5WZgBeT/En20kJe+4DDgCZCX
+wOTwo3SA8JAEHeBgHZAFIuCQl8Lw4P9UkGDskAHIdPzw71RvkAUi8IDdkJe+4P/DE5D9EPCQBCXv
+8JCXv+BgH6Oj4P8kD/WC5DT89YPgRIDwdBAv9YLkNPz1g+BEgPCQl8Cj4P/9JAj1guQ0/PWD5PB0
+CS31guQ0/PWD4FTw8HQhL/WC5DT89YPgVPfwkJfA4P6j4P8ikJfV7/DTlAdQSuD/dAGoBwiAAsMz
+2Pz0/5AARuBf8H8QfgASN1SQl9Xg/XQBfgCoBQiABcMzzjPO2Pn/kABE4Pvk/u9bqAUIgAbOoucT
+zhPY+P8ikJfV4CT48OD/dAGoBwiAAsMz2Pz0/5AAQ+Bf8H8QfgASN1SQl9Xg/XQBfgCoBQiABcMz
+zjPO2Pn/kABC4Pvk/u9bqAUIgAbOoucTzhPY+P8ikAAR4EQJ8H8QfgASN1SQlz3g/KPg/aPg/qPg
+/5CAhRIqf394fggSL9mQl0Hg/KPg/aPg/qPg/5CAhRIqf38EfgwSL9mQl0Xg/KPg/aPg/qPg/5CA
+hRIqf38AfggSL9mQl0ng/KPg/aPg/qPg/5CAhRIqf39wfg4SL9mQgFkSKosAAy2V5P3/EjSBkJe3
+4LQBEZCAWRIqiwADLZXk/X8BEjSBIsDgwPDAg8CCwNB10ADAAMABwALAA8AEwAXABsAHkAHEdLrw
+dHKj8FOR75AAUeD/kABV4F/1PeU9MOYYdEDwkJeM4FQD/78DC5CXieBgBX8BEnPY5T0w5xWQAFV0
+gPCQl4zgVAP/vwMFfwISc9iQAcR0uvB0cqPw0AfQBtAF0ATQA9AC0AHQANDQ0ILQg9Dw0OAy72A0
+fX1/AhI2dX0CfwMSNnWQAVfk8JABPHQC8H0BfwwSb0nk/xJ9tJAGBOBUf/CQBgrgVPjwIpABNnR9
+8KN0AvB9ff8SNuZ9An8DEjbmkAYE4ESA8JAGCuBEB/CQl6Pgo+CQBVjw5WUw4BuQl6HgcBrgBPCQ
+l6jgVA/DlARQDH0BfwQCb0nkkJeh8CLvFGAgFGBLJAJweJCXiXQC8JAASOBEDPCQAEfgRAjwkABF
+gFvkkJeJ8JCXheD8o+D9o+D+o+D/kICFEip/f4B+CBIv2ZAAReBE7/DgVO/wo4AtkJeJdAHwkJeP
+4Pyj4P2j4P6j4P+QgIUSKn9/gH4IEi/ZkABF4EQg8OBEEPCj4EQQ8CICdJoCY/7kk6P45JOjQAP2
+gAHyCN/0gCnkk6P4VAckDMjDM8RUD0QgyINABPRWgAFG9t/kgAsBAgQIECBAgJB+OuR+AZNgvKP/
+VD8w5QlUH/7kk6NgAQ7PVMAl4GCoQLjkk6P65JOj+OSTo8jFgsjKxYPK8KPIxYLIysWDyt/p3ueA
+vpCXbO/w05QHUDPg/3QBqAcIgALDM9j89P+QAEfgX/B/EH4AEjdUkJds4P90AagHCIACwzPY/PT/
+kABGgDuQl2zgJPjw4P90AagHCIACwzPY/MRU8PT/kABD4F/wfxB+ABI3VJCXbOD/dAGoBwiAAsMz
+2Pz0/5AAQ+Bf8H8QfgASN1Qi5JCXTvDlZmBs5WVkAXBm5WZkAmAG5WZkA3AdkJef4BTw4GAEo+Bg
+FpCXn+BwCpCXquCQl5/wgACQl050AfCQl07gYDGQl6/gRBDwkJel4PVE5PVF+/1/VH4BEjWrkAFX
+dAXwkJeo4FQPw5QEUAd9AX8EEm9JIqsHdfAJ66QkZ/WC5fA0k/WD4P90xSv1guQ0lvWD4FQf+tOf
+QAKqB+ol4CSe9YLkNEH1g+ST/nQBk//qJeAkZvWC5DRB9YN0AZMv/+STPsMT/u8T/+T8/esl4CXg
+JOH1guQ0kvWDEip/dIQr9YLkNAT1g+rw/yKQBqng9QpUwHAOkJep8JCXq+D/fQECb0nlCjDmEpCX
+qXQB8JCXr+BEAfASffqAB5CXr+BU/vDlCjDnKZCXqXQB8JCXr+BEAvB1RAPk9UX7/X9UfgESNauQ
+AVd0BfCQl650AfAikJev4FT98CKNC+ULVB/1D3QBL/WC5DSS9YPg9Q6QBP3gtAEFdRADgAN1EAHr
+05UQQAMCddjlDiUN/uUPkEHWk/3u0510AUAYL/WC5DSS9YPk8HSEL/WC5DQE9YPlC/AiL/WC5DSS
+9YPu8CKQACvgRAHwf+h+AxI3VJAACOBEEPB/EH4AEjdUkAAJ4FT38H8QfgASN1SQACjgVP7wfxB+
+ABI3VJAAIOBU/vB/EH4AEjdUkAAl4ERA8H8QfgASN1SQAAngVO/wfxB+AAI3VIsRihKJExJ96KsR
+qhKpExIp2fVmFGAOFGAPFGAaJANwPH8BgDXk/4AxkJeqdAHwkJef8OT/gCOrEaoSqROQAAISYn//
+kJeqcAV0BfCAAu/wkJeq4JCXn/Dk/xJzTCKQACXgVL/wfxB+ABI3VJAAIOBEAfB/EH4AEjdUkAAo
+4EQB8H8QfgASN1SQAPDgMOH5kAAJ4EQI8H8QfgASN1SQAAjgVO/wfxB+ABI3VJAAK+BU/vB/6H4D
+AjdUkABF5PCQBP3wo/CQl43wkJeT8JCXlvCQl5TwkJeX8JCXlfCQl5jwkJd/BPDko/Cj8KPwkJeE
+8JCXifCQl4vwkJed8JCXjvCQl4rwkJeD8JAAUeBEwPAii16KX4lgkJe46/Cj6vCj6fCj5WHwo+Vi
+8KPlY/CvZBVk72AqkJe74Puj5HXwARJi9qnw+hIp2f+Ql7jg+6PkdfABEmL2qfD67xJirIDPq16q
+X6lgIpAFYOCQl5nwkAVh4JCXmvCQBWLgkJeb8JAFY+CQl5zww3T/n/6Ql5rg055AHuAv8KPgtP8P
+5PCj4LT/A+TwIpCXnIADkJeb4ATwIpCXmuAv8CLk9WWQl6/w9WaQl6t0DPCQl6jw5JCXrfCQl6fw
+kJem8JCXqgTwkJef8OSQl67wkJep8JCXofCQl6V0B/DkkJeg8JCXo/CjdALw5JCXrPAi5JCXtfCi
+rzOQl1vwkACA4CDhGhI3ehI3epCXWuBkAfDgJIWQAcTwdHmj8IDfkAYwdAHwwq+QAIDgRIDwfxB+
+ABI3VJCXW+Ak/5KvIpCXruBgEuTwo+BU/fDgVANwM5CXqfCAI5CXoOAE8JCXr+BU7/CQl6Dg05QB
+QA3lZbQBEqPgcA7gBPAikJer4P99ARJvSSLkkJfN8KPwkAX44HAPo+BwC6PgcAej4HADfwEi05CX
+zuCU6JCXzeCUA0ADfwAifzJ+ABI3VJCXzuAE8HDKkJfN4ATwgMLkkJda8O+QADHw7lQD/6PgVPxP
+8KPgVH/wkAAw4CDnDpCXWuDDlGRQBeAE8IDrkJda4MOUZFAKkAAw4BJirH8BIn8AIuVVcDeQl6vg
+VA/TlAFQLJACh+BwJpCXtuC0AhCQl7Dg/qPg9YKOg+BgCIAPkAGv4HAJkJes4GADfwEifwAiEinZ
+/8OUIFAVkAACEmJ//nRDL/WC5DSV9YPu8IAO77QgCpAAAhJif5CTYfB0Qy/1guQ0lfWD4JAEsvAi
+kAQb4FR/ZH9wK5CXqeBkAWAjkJer4FQP05QCUBiQl6/gIOQRkJen4GQBYAmQl6HgcAN/ASJ/ACKQ
+ATd0AvCQBSJ0//ASehfvcAaQAch0/fB9An8DEjbm5WZgBX8BEn20EmsbkJeo4FTw8OBEAvAikAAC
+EmJ/kJeN8OCQBJvwkJeN4GAE4LT/HKKv5DP1EcKvkABH4FT78H1AfwESNq/lEST/kq8ij2eQl7Tg
+/30BEnC95WdgEHQhL/WC5DT89YPgRBDwgA50IS/1guQ0/PWD4FTv8JAEH3QB8CKQl2ru8KPv8HUi
+AY4j9SR/CxJ03xJ9l+T/En5HkJdq4Pyj4P3s+41E5PVFfQF/YH4BAjWrfQJ/AxI2deVmYCOQl63g
+YAZ9AX8MgA+Ql6jgVA/DlARQB30BfwQSb0nk/xJ9tCKQAgng/RIp2f6vBe0ukJey8JAAARJif//t
+L5CXs/CQAAISYn//rgXtL5CXtPAikAY04GAmFHAbewF6Bnk1f/l+ARJ6XL8BCZAGNeBUD/CABYAA
+An4s5JAGNPAikAABEmJ/kJet8BIp2WVmYBWir+QzkJdm8MKvEnd/kJdm4CT/kq8ikJdO4FTwRAPw
+VA9EgPCQl1Pk8KN0APCjdFbwewF6l3lOAnAHkAQb4FR//79/FJCXp+BwDpCXq+BUD9OUBFADfwEi
+fwAikAYE4FS/8O9gCuVltAEF5P8Se7+Ql6jgVPDw4EQM8CKQl9Lv8BJyF5CX0uBgBZAFIuTwkJeo
+4FTw8OBEBPAikAYE4ERA8OVltAEFfwESe7+Ql6jgVPDw4EQE8CKQl6jgVPDw4EQB8BJ3HRJ33ZCX
+qOBU8PDgRALwIn8LEnFy72UlYBDlJbQBBeT1JYADdSUBfwEifwAi72ALkJe34LQBEOT/gAmQl7fg
+tAEFfwESTl0ikABJ4JCX1PDgVA/w4P9E8JAASfDvRLDwIuSQl67wkJeg8JCXqfCQl6/wIpCXs+D/
+5P0ScL2QBB90AfAi5SK0AQsSfZe/AQV/ARJ+RyKQCSjv8KPwo/Cj8KPwo/AikAY0dP/w5KPwo/Cj
+8CJBl9EAQZeegEGX0wAAkAHK5SXw72ADEn3PIpCXZuvwo+rwo+nwIpCXx+vwo+rwo+nwIpCXyuvw
+o+rwo+nwIo+CjoOjo6Pk8CLk9SJ/YH4BAn54kJe34JCXTfAijxyMHY0eIo8fjCCNISISKdn1ZSIi
+4fs=
+====

Added: head/sys/contrib/dev/urtwn/urtwn-rtl8192cfwU.fw.uu
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/contrib/dev/urtwn/urtwn-rtl8192cfwU.fw.uu	Wed Jul 10 08:21:09 2013	(r253139)
@@ -0,0 +1,285 @@
+begin-base64 644 urtwn-rtl8192cfwU.fw.uu
+wYgCADwAAAAKKBQkrD4BAEM0AQAAAAAAAAAAAAAAAAACdFwAAAAAAAAAAAAAAAAAAAAAAlmZAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnK6AAAAAAACaAEAAAUE
+AwIAAwYFBAMABAYFBAIABAgHBgQABgoJCAYACAoJCAQACAoJCAIACAoJCAAACBIREAgAEBoZGBAA
+GCIhIBgAICIhIBAAICIhIAgAICIhHAgAICIhFAgAICIgGAgAIDEwIBAAMDEwGAAAMDEvEBAAMDEs
+EBAAMDEoEAAAMDEgEAAAMDEQEAAAMAQEBAUEBAUHBwcICgQEBAQGCg0OBQUHBwgMFBQEBAQFBwcJ
+CQwOExMEBAQEBQoREwkJCQkMExQVBQUFBQUFBQYGBgYGBQUFBgYGBgYFBQYGBgYGBgUFBQUJCQkJ
+Cw0QEgUJCgwNDhASCQkODhAQEhIAAAAAAAAAAAAkJioYGh0fIScpKgAAAB8jKCosAAQABAAIABAA
+GAAkADAASABgAJAAwADYAFAAeACgAMgBQAGQAeACMAEsAUAB4ALQA+gEsAZAB9AAAgACAAQACAAM
+ABIAGAAkADAASABgAGwAKAA8AFAAZACgAMgA8AEYAGQAoADwAWgB9AJYAyAD6AAAAAABAgICAwQF
+CAECAgIEBw8eBQYHDxIjRmQBAQEBAQIDBAUGBwgBAgMEBQYHCAUGBwgJCgsMIh8eGAAgAAAAAAAA
+AAAAAAAAqwd0hCv1guQ0BPWD4FR/kJd08OBUH6Pw+nXwCeukJGf1guXwNJP1g+D5kJd38Osl4CSB
+9YLkNJL1g+D/o+CQl3jP8KPv8Osl4CQE9YLkNJb1g+D/o+CQl3rP8KPv8Ool4CRm9YLkNEH1g+ST
+/nQBk//k/P3rJeAl4CTh9YLkNJL1gxIlCOrDmUADAkNZkJd14P90xSv1guQ0lvWD7/DvBJCXdvCQ
+l3fg/5CXduD+059AAwJDmO7DlBBAIe4k8P90AX4AqAcIgAXDM84zztj5/5CXeOBe/qPgX05wJ5CX
+duD/w5QQUEp0AX4AqAcIgAXDM84zztj5/5CXeuBe/qPgX05gLZCXduD/ZBNgCe9kEmAE77QRDZCX
+eOAw4AaQl3Z0GPCQl3bgkJd18JCXdPCASJCXduAE8AJCxJCXd+D6kJd14P9qcHl0xSv1guQ0lvWD
+7/B18AnrpCRp9YLl8DST9YPgtAETkJd04P8w5gEikJd14ERAkJd08JCXdeD/JeAknvWC5DRB9YPk
+k/x0AZP97yXgJGb1guQ0QfWDdAGTLf/kkzzDE/7vE//k/P3rJeAl4CTh9YLkNJL1gxIlCIBpkJd1
+4NOaQGGQl3fg/3TFK/WC5DSW9YPv8JCXde/wkJd08Pqj4P8l4CSe9YLkNEH1g+ST/HQBk/3vJeAk
+ZvWC5DRB9YN0AZMt/+STPMMT/u8T/+T8/esl4CXgJOH1guQ0kvWDEiUIrwIidAEr9YLkNJL1g+Tw
+kJd04ESA/3SEK/WC5DQE9YPv8CKQl2br8KPq8KPp8KKv5DOj8MKvkJdm4Puj4Pqj4PmQAAESYzf6
+5fAkAP/kOv6Ql2aj4PqQAAHuj/ASY44SJGL/YDe1IhuQl2bg+6Pg+qPg+ZAAARJjN2UkcATlI2Xw
+YC6Ql2bg+6Pg+qPg+ZAAARJjN/+u8BJ79IAVkJdm4Puj4Pqj4PkSJGJlImADEn6CkJdp4CT/kq8i
+5PUlIgJ+lQJ+nOSQl1rwkJda4P/DlCBAAwJOXHXwCe+kJGr1guXwNJP1g+BkAWADAk5TkJda4CXg
+JMD1guQ0kfWD4Pyj4NOUAOyUAFADAk5T73XwCqQkAPl0kDXw+nsBixT1FYkWkJda4CXgJMD1guQ0
+kfWD4P2j4JCXZs3wo+3w7yXgJIP1guQ0lPWD4P+j4JCXaM/wo+/wkAACEmM3/67wEmMML//l8D6Q
+l2/wo+/wkAAGEmM3/67wkAAEEmM3L//l8D6Ql23wo+/wkAAIEmM3/5CXa+Xw8KPv8JCXWuD+JIT1
+guQ0BPWD4FQ/kJdc8OD9VB+j8HXwCe6kJGf1guXwNJP1g+CQl3HwkJda4PskhPWC5DSW9YPgw5QF
+QAMCSbqQl3Hg/pCXXeCeQBOQl3HgkJdd8O1UQP2Ql1zw7k3wkAT94GQBcCiQl13g/5BBSpP+dEMr
+9YLkNJX1g+DDnkAG75BBEoAykJdd4JBBLoApkJdd4P+QQUqT/pCXWuAkQ/WC5DSV9YPgw55ABu+Q
+QNqAB5CXXeCQQPaTkJdq8JCXauB18AakJFD5dEA18HUR//USiROQl1zgkEHyk//TkJdp4J+Ql2jg
+lABADZCXWuD/5P0SXzICTemQl1rgJeAl4CTh9YLkNJL1g+D8o+D9o+D+o+D/kJdeEiUIkJde4Pij
+4Pmj4Pqj4PvAAMABwALAA6sRqhKpExIkYv9+AKsUqhWpFhJjDP2s8BIke+T8/dAD0ALQAdAA6y//
+6j7+7Tn97Dj8kJdeEiUIkJde4Pij4Pmj4Pqj4PvAAMABwALAA6sRqhKpE5AAARJif/9+AKsUqhWp
+FpAAAhJjN/2s8BIke+T8/dAD0ALQAdAA6y//6j7+7Tn97Dj8kJdeEiUIkJde4Pij4Pmj4Pqj4PvA
+AMABwALAA6sRqhKpE5AAAhJif/9+AKsUqhWpFpAABBJjN/2s8BIke+T8/dAD0ALQAdAA6y//6j7+
+7Tn97Dj8kJdeEiUIkJde4Pij4Pmj4Pqj4PvAAMABwALAA6sRqhKpE5AAAxJif/9+AKsUqhWpFpAA
+BhJjN/2s8BIke+T8/dAD0ALQAdAA6y//6j7+7Tn97Dj8kJdeEiUIkJde4Pij4Pmj4Pqj4PvAAMAB
+wALAA6sRqhKpE5AABBJif/9+AKsUqhWpFpAACBJjN/2s8BIke+T8/dAD0ALQAdAA6y//6j7+7Tn9
+7Dj8kJdeEiUIqxGqEqkTkAAFEmJ//34AkJdm4Pyj4P0SJHvk/P2Ql17g+KPg+aPg+qPg+9MSY7uQ
+l15AUOD8o+D9o+D+o+D/wATABcAGwAerEaoSqROQAAUSYn//fgCQl2bg/KPg/RIke6sHqgbQB9AG
+0AXQBMPvm//umv7tlAD97JQA/JCXXhIlCIAHEiUUAAAAAJCXXuD8o+D9o+D+o+D/kJda4CXgJeAk
+4fWC5DSS9YMSJQiQl1zgJeAkZvWC5DRB9YPkk/50AZP/5Pz9kJde4Pij4Pmj4Pqj4PvTEmO7QAuQ
+l1rg/xJCIAJNYJCXXOAl4CSe9YLkNEH1g+ST/nQBk//k/P2Ql17g+KPg+aPg+qPg+8MSY7tAAwJN
+YJCXWuD/fQESXzICTWCQl1rg/ySE9YLkNJb1g+BkBWADAkujdfAJ76Qka/WC5fA0k/WD4GQBcAMC
+S6OQk2Lg/7QDC5CXXeDDlBlAPYAu77QCC5CXXeDDlBFALoAfkJNi4P+0AQuQl13gw5QKQBuADO9w
+EZCXXeDDlANADZCVY3QB8IAF5JCVY/CQl1rg/yRD9YLkNJX1g+D+w5QwUAvkkJdy8HSELwJLTZCV
+Y+BkAWADAktCkJda4CRk9YLkNJX1g+BkCmBbkJda4P/uJAX95DP8dCEv9YLkNJL1g+D/053sZID4
+dICYUDiQl1rg/u8kBf3kM/x0Qy71guQ0lfWD4NOd7GSA+HSAmFAWkJda4CSk9YLkNJb1g+D/kJdd
+4G9gVpCXWuAkQ/WC5DSV9YPg/9OURkAIkJdydAXwgBHv05Q8kJdyQAV0A/CAA3QB8JCXWuD/JEP1
+guQ0lfWD4P50IS/1guQ0kvWD7vCQl1rgJGT1guQ0lYAvkJda4P8khPWC5DSW9YPk8HRkL/WC5DSV
+9YPgBPCAFOSQl3LwkJda4CSE9YLkNJb1g+TwkJdd4P+Ql1rg/iSk9YLkNJb1g+/w7jDgHpCXcuDE
+VPDwkJda4MMT/ySk9YLkNAT1g+BUDwJNQ5CXWuDDE/8kpPWC5DQE9YPgVPACTUOQl1rg/ySE9YLk
+NJb1g+BkBmADAk1gdfAJ76Qka/WC5fA0k/WD4GQBcAMCTWCQl14SJRQAAAAAkEIT5JP/fgCQl2bg
+/KPg/RIke+T8/ZCXYhIlCOSQl1vwkJde4Pij4Pmj4Pqj4PvAAMABwALAA6sUqhWpFpCXW+D/dfAC
+pPWChfCDEmM3/azw75BCDpP/fgASJHvk/P3QA9AC0AHQAOsv/+o+/u05/ew4/JCXXhIlCJCXYuD8
+o+D9o+D+o+D/kJde4Pij4Pmj4Pqj4PvTEmO7UA6Ql1vgBPDgZAVgAwJL+5CXW+DDE/CQl3Lg/7QB
+DZCXW+BwXZCXcgTwgFvvtAMdkJdb4P9wCJCXcnQD8IBI77QBCJCXcnQB8IA8gDWQl3LgZAVwMpCX
+W+D/cAiQl3J0BfCAD++Ql3K0AQV0A/CAA3QB8NOQl2nglAOQl2jglABABeSQl3Lw05CXaeCUA5CX
+aOCUAEAF5JCXcvCQl1rg/zDgGpCXcuDEVPDw78MT/ySk9YLkNAT1g+BUD4ATkJda4MMT/ySk9YLk
+NAT1g+BU8PB0pC/1guQ0BPWDwIPAguD/kJdy4P7vTtCC0IPwkJda4P8khPWC5DSW9YPg05QFUA90
+hC/1guQ0lvWD4ATwgA+Ql1rgJIT1guQ0lvWD5PCQl1rg/ySE9YLkNAT1g+BUH8OUCVAFkJIAgBF0
+hC/1guQ0BPWD4JCSACDiBXQI8IADdATwkJda4GANkJbE4P+QkgDgw59QCJCSAOCQlsTwkJbE4JAE
+gPCrFKoVqRbk9fASY2+rFKoVqRaQAALk9fASY46QAATk9fASY46QAAbk9fASY46QAAjk9fASY46Q
+l1rg/yXgJMD1guQ0kfWD5PCj8O8l4CSD9YLkNJT1g+Two/DvJeAkw/WC5DSU9YPk8KPwkJda4ATw
+AkUOIu9wAwJQxZCXTeBgAwJVB5CXOeD8o+D9o+D+o+D/kICWEiUIf4x+CBIrCJCW5eD8o+D9o+D+
+o+D/kICWEiUIf0R+CBIrCJCW6eD8o+D9o+D+o+D/kICWEiUIf1x+CBIrCJCW7eD8o+D9o+D+o+D/
+kICWEiUIf2x+DhIrCJCW8eD8o+D9o+D+o+D/kICWEiUIf3B+DhIrCJCW9eD8o+D9o+D+o+D/kICW
+EiUIf3R+DhIrCJCW+eD8o+D9o+D+o+D/kICWEiUIf3h+DhIrCJCW/eD8o+D9o+D+o+D/kICWEiUI
+f3x+DhIrCJCXAeD8o+D9o+D+o+D/kICWEiUIf4B+DhIrCJCXBeD8o+D9o+D+o+D/kICWEiUIf4R+
+DhIrCJCXCeD8o+D9o+D+o+D/kICWEiUIf4h+DhIrCJCXDeD8o+D9o+D+o+D/kICWEiUIf4x+DhIr
+CJCXEeD8o+D9o+D+o+D/kICWEiUIf9B+DhIrCJCXFeD8o+D9o+D+o+D/kICWEiUIf9R+DhIrCJCX
+GeD8o+D9o+D+o+D/kICWEiUIf9h+DhIrCJCXHeD8o+D9o+D+o+D/kICWEiUIf9x+DhIrCJCXIeD8
+o+D9o+D+o+D/kICWEiUIf+B+DhIrCJCXJeD8o+D9o+D+o+D/kICWEiUIf+x+DhIrCJCXKeD8o+D9
+o+D+o+D/kICWEiUIfwR+DBIrCJCXLeD8o+D9o+D+o+D/kICWEiUIfwR+DRIrCJCXMeD8o+D9o+D+
+o+D/kICWEiUIfwx+CRIrCJCXNeD8o+D9o+D+o+D/kICWEiUIfwR+CBIrCJCXTXQB8CKQl03gZAFg
+AwJVB3+MfggSImWQlzkSJQh/RH4IEiJlkJblEiUIf1x+CBIiZZCW6RIlCH9sfg4SImWQlu0SJQh/
+cH4OEiJlkJbxEiUIf3R+DhIiZZCW9RIlCH94fg4SImWQlvkSJQh/fH4OEiJlkJb9EiUIf4B+DhIi
+ZZCXARIlCH+Efg4SImWQlwUSJQh/iH4OEiJlkJcJEiUIf4x+DhIiZZCXDRIlCH/Qfg4SImWQlxES
+JQh/1H4OEiJlkJcVEiUIf9h+DhIiZZCXGRIlCH/cfg4SImWQlx0SJQh/4H4OEiJlkJchEiUIf+x+
+DhIiZZCXJRIlCH8EfgwSImWQlykSJQh/BH4NEiJlkJctEiUIfwx+CRIiZZCXMRIlCH8EfggSImWQ
+lzUSJQh/jH4IEiJlkJfDEiUIkJfD4Pyj4P2j4P6j4P/tRMD97JCXwxIlCJCXw+D8o+D9o+D+o+D/
+kICWEiUIf4x+CBIrCJCAlhIlFAABAAB/RH4IEisIkICWEiUUANslpH9cfggSKwiQgJYSJRQg2yWk
+f2x+DhIrCJCAlhIlFCDbJaR/cH4OEisIkICWEiUUBBslpH90fg4SKwiQgJYSJRQEGyWkf3h+DhIr
+CJCAlhIlFAQbJaR/fH4OEisIkICWEiUUBBslpH+Afg4SKwiQgJYSJRRj2yWkf4R+DhIrCJCAlhIl
+FAQbJaR/iH4OEisIkICWEiUUINslpH+Mfg4SKwiQgJYSJRQg2yWkf9B+DhIrCJCAlhIlFCDbJaR/
+1H4OEisIkICWEiUUINslpH/Yfg4SKwiQgJYSJRQAGyWkf9x+DhIrCJCAlhIlFAAbJaR/4H4OEisI
+kICWEiUUJNslpH/sfg4SKwh/BH4MEiJlkJfDEiUIkJfD4Pyj4P2j4P7k/+yQl8MSJQiQl8Pg/KPg
+/aPg/qPgRBH/7JCXwxIlCJCXw+D8o+D9o+D+o+D/kICWEiUIfwR+DBIrCH8Efg0SImWQl8MSJQiQ
+l8Pg/KPg/aPg/qPgVPD/7JCXwxIlCJCXw+D8o+D9o+D+o+BEAf/skJfDEiUIkJfD4Pyj4P2j4P6j
+4P+QgJYSJQh/BH4NEisIfwx+CRIiZZCXwxIlCJCXw+D8o+D9o+D+5P/skJfDEiUIkJfD4Pyj4P2j
+4P6j4EQR/+yQl8MSJQiQl8Pg/KPg/aPg/qPg/5CAlhIlCH8MfgkSKwh/DH4JEiJlkJfDEiUIkJfD
+4Pyj4P2j4P6j4P/tVA/97FTw/JCXwxIlCJCXw+D8o+D9o+D+o+D/7UQQ/exEAfyQl8MSJQiQl8Pg
+/KPg/aPg/qPg/5CAlhIlCH8MfgkSKwh/BH4IEiJlkJfDEiUIkJfD4Pyj4P2j4P6j4FTw/+yQl8MS
+JQiQl8Pg/KPg/aPg/qPgRAH/7JCXwxIlCJCXw+D8o+D9o+D+o+D/kICWEiUIfwR+CBIrCOSQl03w
+Io8R7yXgJAT1guQ0lq+C9RKPE+URdfACpCSB+XSSNfB1FAH1FYkWdfAJ5RGkJGX1guXwNJOvgvUX
+jxjlEXXwCaQkY/l0kzXwdRkB9RqJG3TBJRH1guQ0kvWD4BJj2FWKAFWfAVW0AlXJA1XzBFYIBVYd
+BlZEDFZyDVafDlbMDwAAVwDlESXgJAT1guQ0lvWDdPDwo3QVgDzlESXgJAT1guQ0lvWDdPDwo3QQ
+gCflESXgJAT1guQ0lvWDdPDwo3QFgBLlESXgJAT1guQ0lvWDdPDwo+Tw5REl4CSB9YLkNJL1g3QP
+8KN0j/ACVwDlESXgJAT1guQ0lvWDdA/wo3T1gCflESXgJAT1guQ0lvWDdA/wo3TwgBLlESXgJAT1
+guQ0lvWD5PCjdA3w5REl4CSB9YLkNJL1g+Two/ACVwCQBEfgqxSqFakWEmKskARG4KsUqhWpFpAA
+ARJivpAEReCFE4KFEoPwkAREAlb3kARL4KsUqhWpFhJirJAESuCrFKoVqRaQAAESYr6QBEnghROC
+hRKD8JAESIBYkARP4KsUqhWpFhJirJAETuCrFKoVqRaQAAESYr6QBE3ghROChRKD8JAETIArkART
+4KsUqhWpFhJirJAEUuCrFKoVqRaQAAESYr6QBFHghROChRKD8JAEUOCFE4KFEoOj8KsUqhWpFsAD
+wALAARIkYv+rGaoaqRsSJGJf0AHQAtADEmKsqxTlFiQB+eQ1FfrAA8ACwAESJGL/qxmqGqkbkAAB
+EmJ/X9AB0ALQAxJirIUTgoUSg8CDwILg/4UYgoUXg+D+717QgtCD8IUTgoUSg6PAg8CC4P+FGIKF
+F4Oj4P7vXtCC0IPw5REl4CSB9YLkNJL1g+D+o+BOYEyQl3J0C/CQl3Lg/8OUAFADAlhGdAF+AKgH
+CIAFwzPOM87Y+f/lESXgJIH1guQ0kvWD4F7+o+BfTmAKkJdy4CQQo/CAaJCXcuAU8IC65REl4CQE
+9YLkNJb1g+D+o+BOYEeQl3J0D/CQl3Lg/8OUAEA8dAF+AKgHCIAFwzPOM87Y+f/lESXgJAT1guQ0
+lvWD4F7+o+BfTmAIkJdy4KPwgA2Ql3LgFPCAv+SQl3Pw5REl4CQE9YLkNJb1g+D+o+BOYEfkkJdy
+8JCXcuD/w5QQQAMCWQB0AX4AqAcIgAXDM84zztj5/+URJeAkBPWC5DSW9YPgXv6j4F9OYAaQl3Lg
+gGOQl3LgBPCAvuURJeAkgfWC5DSS9YPg/qPgTmBG5JCXcvCQl3Lg/8OUDFA8dAF+AKgHCIAFwzPO
+M87Y+f/lESXgJIH1guQ0kvWD4F7+o+BfTmAIkJdy4CQQgAmQl3LgBPCAv+SQl3TwkJdz4P918Anl
+EaQkZ/WC5fA0k/WD7/CQl3Tg/nXwCeURpCRo9YLl8DST9YPu8HSEJRH1guQ0BPWD4NOfQB+Ql3Pg
+/3SkJRH1guQ0lvWD7/B0hCUR9YLkNAT1g+/wkJdz4P/TlBNACJCTYnQD8IAh79OUC0AIkJNidALw
+gBPv05QDQAiQk2J0AfCABeSQk2LwkJNi4JAEsfAiwODA8MCDwILA0HXQAMAAwAHAAsADwATABcAG
+wAeQAcR0mfB0WaPwkAE34FUr9S+QATTgVSj1LJABNuBVKvUu5Swg4AMCW0uQATR0AfCF0U2F0k6F
+00+F1FCF1VGF1lKF11OF2VTlVFRAwxP/5VNUIG9wAwJa+OVUMOUDAlr45VJUH/UI5U1UP/UJ5VFU
+H//lCCXgJAP1guQ0lfWD5I/wEmLg5VNUH//lCCXgJMD1guQ0kfWD5I/wEmLg5QnTlARAA3UJBHXw
+CuUIpCQA9YLl8DSQ9YN18ALlCRJjzOD+o+D/5VNUHy//5D7+dfAK5QikJAD1guXwNJD1g3XwAuUJ
+EmPM7vCj7/DlVCDmJOVTVB//5Qgl4CSD9YLkNJT1g+SP8BJi4OVPMOc2rwgSddiAL+VTVB//5Qgl
+4CTD9YLkNJT1g+SP8BJi4OVPMOcS5U9Uf/3lU1Qf9Q2rCa8IEna65WZgT5CXreBgNZABW+TwkAE8
+dATwkAQb4FR/ZH9wNHVEFPVF+/1/WH4BEjBikAFbdAXwkAaSdAHwkJen8IAUkAQb4FR//79/CpCX
+q+D/fQESb0nlLDDhIZABNHQC8IXRVoXSV4XTWIXUWYXVWoXWW4XXXIXZXRJ82eUsMOMGkAE0dAjw
+5Sww5AmQATR0EPBDVRDlLDDlIZABz+Aw5RrgVN/wkAE0dCDwkAAD4FT78H8QfgASMhWA/uUsMOYG
+kAE0dEDw5S4w4QmQATZ0AvBDVUDlLjDgCZABNnQB8BJ1YuUuMOJjkAE2dATw5WVkAXBX5WZgU+Vm
+ZAJwJ5AGq+CQl5/wkAaq4JCXqvCQl5/gcAeQl6rg/4AFkJef4P+Ql5/v8JCXoeBgA+AU8JCXoOTw
+kAFX8JABPHQC8JCXr+BU/fDgVO/wEnZO5S4w4zGQATZ0CPDlZWQBcCXlZmAhkAFX5PCQATx0AvB1
+RAN1RQDk+/1/VH4BEjBikAFXdAXw5S4w5DqQATZ0EPDlZWQBcC7lZmAqkAFX5PCQATx0AvCQl67k
+8JCXr+BU/fDgVANwDpCXqfCQl6vg/30BEm9J5S4w5RKQATZ0IPDlZbQBB+VmYAMSffrlLjDmKpAB
+NnRA8OVlZAFwHuVmYBqQl6/gVP7w4FQDcA6Ql6nwkJer4P99ARJvSeUvMOEJkAE3dALwEnwodJkE
+kAHE8HRZo/DQB9AG0AXQBNAD0ALQAdAA0NDQgtCD0PDQ4DKQBER0EfCjdPDwo3QP8KPk8JCXWvCQ
+l1rg/8OUEFAUdKQv9YLkNAT1g+TwkJda4ATwgOLkkJda8JCXWuD7w5QgQAMCXzHg/3XwCqQkAPWC
+5fA0kPWD5PCj8HXwCu+kJAL1guXwNJD1g+Two/B18ArvpCQE9YLl8DSQ9YPk8KPwdfAK76QkBvWC
+5fA0kPWD5PCj8HXwCu+kJAj1guXwNJD1g+Two/B0pC/1guQ0lvWDdBPwdGQv9YLkNJX1g+Tw7yXg
+JMD1guQ0kfWD5PCj8O8l4CSD9YLkNJT1g+Two/DvJeAkA/WC5DSV9YPk8KPw7yXgJMP1guQ0lPWD
+5PCj8O8l4CSE9YLkNJX1g+Two/DvJeAkxPWC5DSV9YPk8KPwdGQv9YLkNJb1g+TwdEQv9YLkNJb1
+g+TwdIQv9YLkNJb1g+TwkEHEk/50AZP/kEGMdAGTL//kkz7DE/7vE//k/P3rJeAl4CTh9YLkNJL1
+gxIlCHXwCeukJGr1guXwNJP1g3QB8HXwCeukJGn1guXwNJP1g3QB8HTBK/WC5DSS9YN0DPB18Anr
+pCRl9YLl8DST9YN0//Cj8HXwCeukJGP1guXwNJP1g+Two3QP8HXwCeukJGf1guXwNJP1g3QT8HXw
+CeukJGj1guXwNJP1g+TwdIQr9YLkNAT1g3QT8JCXWuAE8AJdZiKpB3SEKfWC5DQE9YPgVH+Ql3Tw
+4FQf/5CXd/B18AnppCRo9YLl8DST9YPgkJd58HXwCemkJGf1guXwNJP1g+D+kJd68Okl4CQE9YLk
+NJb1g+D7o+CQl3vL8KPr8Okl4CSB9YLkNJL1g+D7o+CQl33L8KPr8O/TnkAMkJd64JCXd/CQl3Tw
+7XADAmCRkJd47fCQl3TgMOYOkJd34JCXdPCQl3jgFPCQl3jgcAMCYJGQl3fg/9OUAFADAmCR5JCX
+dvDvFJCXdfCQl3ng/ZCXdeD/051Ab++UEEAh7yTw/3QBfgCoBwiABcMzzjPO2Pn/kJd94F7+o+Bf
+TnAnkJd14P/DlBBQN3QBfgCoBwiABcMzzjPO2Pn/kJd74F7+o+BfTmAakJd14JCXdPCQl3bgBPCQ
+l3jg/5CXduBvYAiQl3XgFPCAg5CXeOD/kJd24MOfUA+Ql3XgtQUIkJd54JCXdPCQl3Tg/yXgJJ71
+guQ0QfWD5JP8dAGT/e8l4CRm9YLkNEH1g3QBky3/5JM8wxP+7xP/5Pz96SXgJeAk4fWC5DSS9YMS
+JQiQl3Tg/3SEKfWC5DQE9YPv8CKQAczgVA+Ql1rwkJda4P1wAwJifpCX0eD/dAF+AKgHCIAFwzPO
+M87Y+f/vXXADAmJfkJfR4HXwBKQk0PWC5fA0AfWD4JCXW/Cir+Qzo/DCr3VhAXVil3VjW3VkAXsB
+epd5XRJ4j5CXXOAk/5Kvo+D/xBMTE1QBkJfRMOBw4HXwAqQkiPWC5DXw9YPgkJde8JCX0eB18AKk
+JIn1guQ18PWD4JCXX/CQl9HgdfAEpCTR9YLl8DQB9YPgkJdg8JCX0eB18ASkJNL1guXwNAH1g+CQ
+l2HwkJfR4HXwBKQk0/WC5fA0AfWD4JCXYvCAQuB18ASkJNH1guXwNAH1g+CQl17wkJfR4HXwBKQk
+0vWC5fA0AfWD4JCXX/CQl9HgdfAEpCTT9YLl8DQB9YPgkJdg8O9Uf/97AXqXeV4SbbmQl1rg/5CX
+0eD+dAGoBgiAAsMz2Pz0X5CXWvCQl9Hg/3QBqAcIgALDM9j8kAHM8JCX0eAE8OBUA/ACYPLCr3To
+BJABxPB0YKPwkJda4JABxvCQl9HgkAHH8ID+IrsBDOWCKfWC5YM69YPgIlAG6SWC+OYiu/4G6SWC
++OIi5YIp9YLlgzr1g+STIrsBBomCioPwIlAC9yK7/gHzIvi7AQ3lgin1guWDOvWD6PAiUAbpJYLI
+9iK7/gXpJYLI8iLF8Pij4CjwxfD45YIVgnACFYPgOPAio/jgxfAl8PDlghWCcAIVg+DIOPDoIrsB
+ComCioPg9fCj4CJQBofwCecZIrv+B+P18AnjGSKJgoqD5JP18HQBkyK7ARDlgin1guWDOvWD4PXw
+o+AiUAnpJYL4hvAI5iK7/grpJYL44vXwCOIi5YMq9YPpk/Xwo+mTIrsBComCioPw5fCj8CJQBvcJ
+p/AZIrv+BvPl8AnzGSL4uwER5YIp9YLlgzr1g+jw5fCj8CJQCeklgsj2CKbwIrv+Ceklgsjy5fAI
+8iLrn/Xw6p5C8OmdQvDonEXwIqQlgvWC5fA1g/WDItCD0IL45JNwEnQBk3ANo6OT+HQBk/WCiIPk
+c3QCk2hg76Ojo4Df5JCXV/Cj8BJ5hZAAAuBU4JCXtmAFdAHwgAN0AvCQAPPgMOMIkJe3dAHwgAXk
+kJe38JCXt+C0AROQAPLgMOcMkJewdP3wo3Qz8IAKkJewdP3wo3Qv8OT1VRJdLhJ+jBJ5NhIuARJE
+/3UoM+T1KXUqAvUrkAEw5Sjwo+Up8KPlKvCj5SvwkADz4DDiDZAFQXQQ8JAFWvCj5PCQAWR0oPB1
+RP/k9UX7fQF/UH4BEjBidTAfdTEB5PUykAE45TDwo+Ux8KPlMvASeDiQl1nl2fCQATx0//Cj8KPw
+kAE08KPwo/Cj8MKvkACA4ERA8H8QfgASMhV16ANDqIXSr5ABwOTwo/Cj8KPwkAHG8KPwkJdX4GQB
+8CT+kAHE8HRjo/DlVTDmF8KvU1W/0q8SRQmQl43g/2ADtAEDEmkS5VUw5wfCr1NVf9Kv5VUw5ArC
+r1NV79KvEmDokJeN4HADEmwKEnyFgKqQAAISYn+Ql4vwkAABEmJ/JeAl4JCXivASJGIl4CXgkJeO
+8JCXi+CQBJjwkJeK4BMTVD+QBJnwkJeO4BMTVD+QBJrwkAVg4JCXmfCQBWHgkJea8JAFYuCQl5vw
+kAVj4JCXnPCir+QzkJdp8MKvkJeK4P8SeOSQl2ngJP+Sr5CXi+BwAwJmjJCXiuBwAwJmjJCXjuBw
+AwJmjKKv5DOQl2nwwq+Ql510AfCQl2ngJP+Sr5AAReBU/vCj4EQB8JCXg+BgHZCXj+D8o+D9o+D+
+o+D/kICWEiUIf4B+CBIrCIAGkAUidH/wkABF4FTv8JAFh+BkgPCQl5ngkAWE8JCXmuCQBYXwkJeb
+4JAFhvCQl5zgkAWH8KKv5DOQl2nwwq+QATzgRCDwfSDk/xIxt4ArkJeL4HAtkJed8JAAReBU/vCj
+4FT+8JAFIuTwoq8zkJdp8MKvfSDk/xIxSZCXaeAk/5KvIpCXZuvwo+rwo+nwkJdm4Puj4Pqj4PmQ
+AAQSYn//VB+Ql2nwkAADEmJ/VPDEVA+Ql2rw71QgxBNUB6PwkAAEEmJ/VEDEExNUA5CXbPCQl2ng
+/3XwCaQkZfWC5fA0k62CkJdt8KPt8O918AmkJGP5dJM18PqjdAHwo+rwo+nwkJdmo+D6o+D5kAAD
+EmJ/VA//kJdv4Puj4Pqj4PnvEmKskJdm4Puj4Pqj4PmQAAISYn//kJdv4Puj4Pqj4PmQAAHvEmK+
+kJdm4Puj4Pqj4PmQAAESYn//kJdt4Pyj4P31goyD7/ASJGKNgoyDo/CQl2rg/pCXaeD/JMH1guQ0
+kvWD7vCQl2vg/nXwCe+kJGn1guXwNJP1g+7wdfAJ76QkavWC5fA0k/WDdAHwkJds4P518AnvpCRr
+9YLl8DST9YPu8AJVCMDgwPDAg8CCwNB10ADAAMABwALAA8AEwAXABsAHkAHEdAHwdGij8FOR35AB
+POBVMPU0o+BVMfU1o+BVMvU25TQw4A+QATx0AfCQAVN0B/BDVYDlNDDhCZABPHQC8BJ50eU0MOI6
+kAE8dATwkAaS4DDgHnVEFHVFAOT7/X9YfgESMGKQAVt0BfCQBpJ0AfCAD5CXp+TwkJer4P99ARJv
+SeU0MOMGkAE8dAjw5TQw5AmQATx0EPASfgvlNDDlCZABPHQg8BJuheU1MOAVkAE9dAHwkACD4JCX
+q/Dg/30BEm9J5TYw4waQAT50CPB0AQSQAcTwdGij8NAH0AbQBdAE0APQAtAB0ADQ0NCC0IPQ8NDg
+MpCXhODDlBRQBuAE8AJpzJCXhOBkFGADAmnMkJeT4HAlkJeW4HAfkJeU4HAZkJeX4HATkJeV4HAN
+kJeY4HAHkAT94FT+8JCXk+CQBIjwkJeU4JAEifCQl5XgkASK8KPk8JCXluCQBIzwkJeX4JAEjfCQ
+l5jgkASO8KPk8JCXf+CQBJDwkJeA4JAEkfCQl4HgkASS8JCXguCQBJPw5JCXhPCQl38E8OSj8KPw
+o/CQl5Pwo/Cj8KPwo/Cj8JAFYOCQl1rwkAVh4JCXW/CQBWLgkJdc8JAFY+CQl13wkJec4P+Ql13g
+/tOfUAuQl5zgw57TlAFAEZCXiuC0AQKAA5CXjuD/EnjkIpCX0O3wkJfP7/DTlAdQbeD/dAGoBwiA
+AsMz2Pz0/5AAR+Bf8H8QfgASMhWQl8/g/3QBqAcIgALDM9j8/5AARuBP8H8QfgASMhWQl9DgYBaQ
+l8/g/3QBqAcIgALDM9j8/5AARYB4kJfP4P90AagHCIACwzPY/PT/kABFgH2Ql8/gJPjw4P90AagH
+CIACwzPY/MRU8PT/kABD4F/wfxB+ABIyFZCXz+D/dAGoBwiAAsMz2Pz/kABD4E/wfxB+ABIyFZCX
+0OBgG5CXz+D/dAGoBwiAAsMz2PzEVPD/kABC4E+AGpCXz+D/dAGoBwiAAsMz2PzEVPD0/5AAQuBf
+8H8QfgASMhUif3h+CBIiZZCXPRIlCH8EfgwSImWQl0ESJQh/AH4IEiJlkJdFEiUIkJe34JCXPbQB
+E+D8o+D9o+D+o+BUx//tVMf9gA3g/KPg/aPg/qPgVMf/7JCAlhIlCH94fggSKwiQl0Hg/KPg/aPg
+/qPgVA//7JCAlhIlCH8EfgwSKwiQl0Xg/KPg/aPg/qPgRAL/7JCAlhIlCH8AfggSKwh/cH4OEiJl
+kJdJEiUIkICWEiUUABsloH9wfg4SKwiQgGgSJRQAAAAA5P3/EjAskJe34LQBEZCAaBIlFAAAAADk
+/X8BEjAskAAR4FT28H8QfgACMhWQl53gZAFgCZCXi+BgAwJs4pCXf+DDlP9QBeAE8IA7kJeA4MOU
+/1AG4ATw5IAokJeB4MOU/1AK4ATw5JCXgPCAFZCXguDDlP9QEOAE8OSQl4HwkJeA8JCXf/CQAETg
+VAxgduAw4jKQl5Pgw5T/UAXgBPCAJJCXlODDlP9QBuAE8OSAEZCXleDDlP9QDOAE8OSQl5TwkJeT
+8JAAROAw4zKQl5bgw5T/UAXgBPCAJJCXl+DDlP9QBuAE8OSAEZCXmODDlP9QDOAE8OSQl5fwkJeW
+8JAE/eBEAfAiixGKEokTkAACEmJ/kJeM8OAw4FyQl4N0AfB/gH4IEiJlkJeFEiUIqxGqEqkTkAAB
+EmJ//+T8/f54GhIk9agEqQWqBqsHkJeF4Pyj4P2j4P6j4P/sVAP860//6k7+6U396Ez8kJePEiUI
+kAUi5PCANeSQl4Pwf4B+CBIiZexUA/zsRMD8kJeFEiUIkJeF4Pyj4P2j4P6j4P+QgJYSJQh/gH4I
+EisIkJeM4JAARzDhEXQM8KPgRAzwkABG4EQQ8IAQ4FTz8KPgVPPwkABG4FTv8OSQl4nwIpCXY+vw
+o+rwo+nw7xJj2G3qAW34Am4GA24UBW4iBm4wB24+CW5MDG5aDW5oDgAAbnaQl2Pg+6Pg+qPg+QJ8
+spCXY+D7o+D6o+D5An6jkJdj4Puj4Pqj4PkCfFeQl2Pg+6Pg+qPg+QJ63pCXY+D7o+D6o+D5AmbA
+kJdj4Puj4Pqj4PkCflSQl2Pg+6Pg+qPg+QJEaJCXY+D7o+D6o+D5AmVfkJdj4Puj4Pqj4PkCe4mQ
+l2Pg+6Pg+qPg+QJs48KvdLkEkAHE8HRto/CA/pCXi+BkAWADAm9IkABG4EQB8JCXneBwQJCXg+Bg
+HZCXj+D8o+D9o+D+o+D/kICWEiUIf4B+CBIrCIAGkAUidH/wkJeK4P8SeOSQl510AfCQAEXgVP7w
+gESQl53gZAFwPJCXjuD/Enjk5JCXnfCQAEXgRAHwkJeD4GAdkJeF4Pyj4P2j4P6j4P+QgJYSJQh/
+gH4IEisIgAWQBSLk8JAFh+BkgPCQl5ngkAWE8JCXmuCQBYXwkJeb4JAFhvCQl5zgkAWH8CKPJo0n
+5SZUD/+Ql6jgVA9vYHjlJjDiMJCXqOAg4gV/ARJ9PpCXqOAw4wrlJiDjBRJ9XYBWkJeo4CDjT+Um
+MONKrycSfR6AQ5CXqOBUD/+/DA7lJiDjCRJ8/e9gLhJ9XZCXqOBUD/+/BA7lJiDiCRJ7Gu9gFhJ7
+UpCXqOBUD/+/AgkSeqDvYAMSfXqQl6jgVA//kJer4FQPb3Aj4DDmH5CXqOBUD/+Ql57g/k+QAS/w
+7mSAkJee8JCXq+BUv/AikJdQ6/Cj6vCj6fCQl7bgZAJwAwJwvJABr+BgCZABx+AE8PCA8ZCX0+D/
+BPCQl1Dg+6Pg+qPg+ZAAAe8SYr6ir+QzkJdW8MKvkJdQ4Puj4Pqj4IthimL1Y3VkAnsBegF5oBJ4
+j5CXVuAk/5Kvoq/kM/DCr5CXU+D7o+D6o+CLYYpi9WOQl1Dg+6Pg+qPg+RIkYv/EVA/1ZHsBegF5
+ohJ4j5CXVuAk/5KvkAGvdP/wkAHL4GSA8CKQl77v8KPt8OSj8KPw5WZgBeT/En20kJe+4DDgCZCX
+wOTwo3SA8JAEHeBgHZAFIuCQl8Lw4P9UkGDskAHIdPzw71RvkAUi8IDdkJe+4P/DE5D9EPCQBCXv
+8JCXv+BgH6Oj4P8kD/WC5DT89YPgRIDwdBAv9YLkNPz1g+BEgPCQl8Cj4P/9JAj1guQ0/PWD5PB0
+CS31guQ0/PWD4FTw8HQhL/WC5DT89YPgVPfwkJfA4P6j4P8ikJfV7/DTlAdQSuD/dAGoBwiAAsMz
+2Pz0/5AARuBf8H8QfgASMhWQl9Xg/XQBfgCoBQiABcMzzjPO2Pn/kABE4Pvk/u9bqAUIgAbOoucT
+zhPY+P8ikJfV4CT48OD/dAGoBwiAAsMz2Pz0/5AAQ+Bf8H8QfgASMhWQl9Xg/XQBfgCoBQiABcMz
+zjPO2Pn/kABC4Pvk/u9bqAUIgAbOoucTzhPY+P8ikAAR4EQJ8H8QfgASMhWQlz3g/KPg/aPg/qPg
+/5CAlhIlCH94fggSKwiQl0Hg/KPg/aPg/qPg/5CAlhIlCH8EfgwSKwiQl0Xg/KPg/aPg/qPg/5CA
+lhIlCH8AfggSKwiQl0ng/KPg/aPg/qPg/5CAlhIlCH9wfg4SKwiQgGgSJRQAAy2V5P3/EjAskJe3
+4LQBEZCAaBIlFAADLZXk/X8BEjAsIsDgwPDAg8CCwNB10ADAAMABwALAA8AEwAXABsAHkAHEdLrw
+dHKj8FOR75AAUeD/kABV4F/1PeU9MOYYdEDwkJeM4FQD/78DC5CXieBgBX8BEnPY5T0w5xWQAFV0
+gPCQl4zgVAP/vwMFfwISc9iQAcR0uvB0cqPw0AfQBtAF0ATQA9AC0AHQANDQ0ILQg9Dw0OAy72A0
+fX1/AhIxLH0CfwMSMSyQAVfk8JABPHQC8H0BfwwSb0nk/xJ9tJAGBOBUf/CQBgrgVPjwIpABNnR9
+8KN0AvB9ff8SMZ19An8DEjGdkAYE4ESA8JAGCuBEB/CQl6Pgo+CQBVjw5WUw4BuQl6HgcBrgBPCQ
+l6jgVA/DlARQDH0BfwQCb0nkkJeh8CLvFGAgFGBLJAJweJCXiXQC8JAASOBEDPCQAEfgRAjwkABF
+gFvkkJeJ8JCXheD8o+D9o+D+o+D/kICWEiUIf4B+CBIrCJAAReBE7/DgVO/wo4AtkJeJdAHwkJeP
+4Pyj4P2j4P6j4P+QgJYSJQh/gH4IEisIkABF4EQg8OBEEPCj4EQQ8CICdJoCY/7kk6P45JOjQAP2
+gAHyCN/0gCnkk6P4VAckDMjDM8RUD0QgyINABPRWgAFG9t/kgAsBAgQIECBAgJB+OuR+AZNgvKP/
+VD8w5QlUH/7kk6NgAQ7PVMAl4GCoQLjkk6P65JOj+OSTo8jFgsjKxYPK8KPIxYLIysWDyt/p3ueA
+vpCXbO/w05QHUDPg/3QBqAcIgALDM9j89P+QAEfgX/B/EH4AEjIVkJds4P90AagHCIACwzPY/PT/
+kABGgDuQl2zgJPjw4P90AagHCIACwzPY/MRU8PT/kABD4F/wfxB+ABIyFZCXbOD/dAGoBwiAAsMz
+2Pz0/5AAQ+Bf8H8QfgASMhUi5JCXTvDlZmBs5WVkAXBm5WZkAmAG5WZkA3AdkJef4BTw4GAEo+Bg
+FpCXn+BwCpCXquCQl5/wgACQl050AfCQl07gYDGQl6/gRBDwkJel4PVE5PVF+/1/VH4BEjBikAFX
+dAXwkJeo4FQPw5QEUAd9AX8EEm9JIqsHdfAJ66QkZ/WC5fA0k/WD4P90xSv1guQ0lvWD4FQf+tOf
+QAKqB+ol4CSe9YLkNEH1g+ST/nQBk//qJeAkZvWC5DRB9YN0AZMv/+STPsMT/u8T/+T8/esl4CXg
+JOH1guQ0kvWDEiUIdIQr9YLkNAT1g+rw/yKQBqng9QpUwHAOkJep8JCXq+D/fQECb0nlCjDmEpCX
+qXQB8JCXr+BEAfASffqAB5CXr+BU/vDlCjDnKZCXqXQB8JCXr+BEAvB1RAPk9UX7/X9UfgESMGKQ
+AVd0BfCQl650AfAikJev4FT98CKNC+ULVB/1D3QBL/WC5DSS9YPg9Q6QBP3gtAEFdRADgAN1EAHr
+05UQQAMCddjlDiUN/uUPkEHWk/3u0510AUAYL/WC5DSS9YPk8HSEL/WC5DQE9YPlC/AiL/WC5DSS
+9YPu8CKQACvgRAHwf+h+AxIyFZAACOBEEPB/EH4AEjIVkAAJ4FT38H8QfgASMhWQACjgVP7wfxB+
+ABIyFZAAIOBU/vB/EH4AEjIVkAAl4ERA8H8QfgASMhWQAAngVO/wfxB+AAIyFYsRihKJExJ96KsR
+qhKpExIkYvVmFGAOFGAPFGAaJANwPH8BgDXk/4AxkJeqdAHwkJef8OT/gCOrEaoSqROQAAISYn//
+kJeqcAV0BfCAAu/wkJeq4JCXn/Dk/xJzTCKQACXgVL/wfxB+ABIyFZAAIOBEAfB/EH4AEjIVkAAo
+4EQB8H8QfgASMhWQAPDgMOH5kAAJ4EQI8H8QfgASMhWQAAjgVO/wfxB+ABIyFZAAK+BU/vB/6H4D
+AjIVkABF5PCQBP3wo/CQl43wkJeT8JCXlvCQl5TwkJeX8JCXlfCQl5jwkJd/BPDko/Cj8KPwkJeE
+8JCXifCQl4vwkJed8JCXjvCQl4rwkJeD8JAAUeBEwPAii16KX4lgkJe46/Cj6vCj6fCj5WHwo+Vi
+8KPlY/CvZBVk72AqkJe74Puj5HXwARJi9qnw+hIkYv+Ql7jg+6PkdfABEmL2qfD67xJirIDPq16q
+X6lgIpAFYOCQl5nwkAVh4JCXmvCQBWLgkJeb8JAFY+CQl5zww3T/n/6Ql5rg055AHuAv8KPgtP8P
+5PCj4LT/A+TwIpCXnIADkJeb4ATwIpCXmuAv8CLk9WWQl6/w9WaQl6t0DPCQl6jw5JCXrfCQl6fw
+kJem8JCXqgTwkJef8OSQl67wkJep8JCXofCQl6V0B/DkkJeg8JCXo/CjdALw5JCXrPAi5JCXtfCi
+rzOQl1vwkACA4CDhGhIyKxIyK5CXWuBkAfDgJIWQAcTwdHmj8IDfkAYwdAHwwq+QAIDgRIDwfxB+
+ABIyFZCXW+Ak/5KvIpCXruBgEuTwo+BU/fDgVANwM5CXqfCAI5CXoOAE8JCXr+BU7/CQl6Dg05QB
+QA3lZbQBEqPgcA7gBPAikJer4P99ARJvSSLkkJfN8KPwkAX44HAPo+BwC6PgcAej4HADfwEi05CX
+zuCU6JCXzeCUA0ADfwAifzJ+ABIyFZCXzuAE8HDKkJfN4ATwgMLkkJda8O+QADHw7lQD/6PgVPxP
+8KPgVH/wkAAw4CDnDpCXWuDDlGRQBeAE8IDrkJda4MOUZFAKkAAw4BJirH8BIn8AIuVVcDeQl6vg
+VA/TlAFQLJACh+BwJpCXtuC0AhCQl7Dg/qPg9YKOg+BgCIAPkAGv4HAJkJes4GADfwEifwAiEiRi
+/8OUIFAVkAACEmJ//nRDL/WC5DSV9YPu8IAO77QgCpAAAhJif5CTYfB0Qy/1guQ0lfWD4JAEsvAi
+kAQb4FR/ZH9wK5CXqeBkAWAjkJer4FQP05QCUBiQl6/gIOQRkJen4GQBYAmQl6HgcAN/ASJ/ACKQ
+ATd0AvCQBSJ0//ASehfvcAaQAch0/fB9An8DEjGd5WZgBX8BEn20EmsbkJeo4FTw8OBEAvAikAAC
+EmJ/kJeN8OCQBJvwkJeN4GAE4LT/HKKv5DP1EcKvkABH4FT78H1AfwESMWblEST/kq8ij2eQl7Tg
+/30BEnC95WdgEHQhL/WC5DT89YPgRBDwgA50IS/1guQ0/PWD4FTv8JAEH3QB8CKQl2ru8KPv8HUi
+AY4j9SR/CxJ03xJ9l+T/En5HkJdq4Pyj4P3s+41E5PVFfQF/YH4BAjBifQJ/AxIxLOVmYCOQl63g
+YAZ9AX8MgA+Ql6jgVA/DlARQB30BfwQSb0nk/xJ9tCKQAgng/RIkYv6vBe0ukJey8JAAARJif//t
+L5CXs/CQAAISYn//rgXtL5CXtPAikAY04GAmFHAbewF6Bnk1f/l+ARJ6XL8BCZAGNeBUD/CABYAA
+An4s5JAGNPAikAABEmJ/kJet8BIkYmVmYBWir+QzkJdm8MKvEnd/kJdm4CT/kq8ikJdO4FTwRAPw
+VA9EgPCQl1Pk8KN0APCjdFbwewF6l3lOAnAHkAQb4FR//79/FJCXp+BwDpCXq+BUD9OUBFADfwEi
+fwAikAYE4FS/8O9gCuVltAEF5P8Se7+Ql6jgVPDw4EQM8CKQl9Lv8BJyF5CX0uBgBZAFIuTwkJeo
+4FTw8OBEBPAikAYE4ERA8OVltAEFfwESe7+Ql6jgVPDw4EQE8CKQl6jgVPDw4EQB8BJ3HRJ33ZCX
+qOBU8PDgRALwIn8LEnFy72UlYBDlJbQBBeT1JYADdSUBfwEifwAi72ALkJe34LQBEOT/gAmQl7fg
+tAEFfwESTl0ikABJ4JCX1PDgVA/w4P9E8JAASfDvRLDwIuSQl67wkJeg8JCXqfCQl6/wIpCXs+D/
+5P0ScL2QBB90AfAi5SK0AQsSfZe/AQV/ARJ+RyKQCSjv8KPwo/Cj8KPwo/AikAY0dP/w5KPwo/Cj
+8CJBl9EAQZeegEGX0wAAkAHK5SXw72ADEn3PIpCXZuvwo+rwo+nwIpCXx+vwo+rwo+nwIpCXyuvw
+o+rwo+nwIo+CjoOjo6Pk8CLk9SJ/YH4BAn54kJe34JCXTfAijxyMHY0eIo8fjCCNISISJGL1ZSIi
+po4=
+====

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==============================================================================
--- head/sys/dev/usb/wlan/if_urtwn.c	Wed Jul 10 07:40:30 2013	(r253138)
+++ head/sys/dev/usb/wlan/if_urtwn.c	Wed Jul 10 08:21:09 2013	(r253139)
@@ -3029,5 +3029,4 @@ DRIVER_MODULE(urtwn, uhub, urtwn_driver,
 MODULE_DEPEND(urtwn, usb, 1, 1, 1);
 MODULE_DEPEND(urtwn, wlan, 1, 1, 1);
 MODULE_DEPEND(urtwn, firmware, 1, 1, 1);
-MODULE_DEPEND(urtwn, urtwn_fw, 1, 1, 1);
 MODULE_VERSION(urtwn, 1);

Added: head/sys/modules/usb/urtwnfw/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/modules/usb/urtwnfw/Makefile	Wed Jul 10 08:21:09 2013	(r253139)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+SUBDIR=	urtwnrtl8192cT urtwnrtl8192cU
+
+.include 

Added: head/sys/modules/usb/urtwnfw/Makefile.inc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/modules/usb/urtwnfw/Makefile.inc	Wed Jul 10 08:21:09 2013	(r253139)
@@ -0,0 +1,15 @@
+# $FreeBSD$
+#
+# Common rules for building firmware.  Note this gets auto-included
+# by the subdir Makefile's as a consequence of included bsd.kmod.mk.
+
+_FIRM=	${IMG}.fw
+
+CLEANFILES+=	${_FIRM}
+
+FIRMWS=	${_FIRM}:${KMOD}:111
+
+FIRMWARE_LICENSE=	realtek
+
+${_FIRM}: ${.CURDIR}/../../../../contrib/dev/urtwn/${_FIRM}.uu
+	uudecode -p $? > ${.TARGET}

Added: head/sys/modules/usb/urtwnfw/urtwnrtl8192cT/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/modules/usb/urtwnfw/urtwnrtl8192cT/Makefile	Wed Jul 10 08:21:09 2013	(r253139)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+KMOD=	urtwn-rtl8192cfwT
+IMG=	urtwn-rtl8192cfwT
+
+.include 

Added: head/sys/modules/usb/urtwnfw/urtwnrtl8192cU/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/modules/usb/urtwnfw/urtwnrtl8192cU/Makefile	Wed Jul 10 08:21:09 2013	(r253139)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+KMOD=	urtwn-rtl8192cfwU
+IMG=	urtwn-rtl8192cfwU
+
+.include 

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 08:45:20 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id E60AD287;
 Wed, 10 Jul 2013 08:45:20 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au
 [211.29.132.249])
 by mx1.freebsd.org (Postfix) with ESMTP id 5576B1C7A;
 Wed, 10 Jul 2013 08:45:20 +0000 (UTC)
Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au
 (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23])
 by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 7D9051041279;
 Wed, 10 Jul 2013 18:45:17 +1000 (EST)
Date: Wed, 10 Jul 2013 18:45:17 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Aleksandr Rybalko 
Subject: Re: svn commit: r252425 - head/sys/arm/arm
In-Reply-To: <20130708132052.f9757df88ede1b087de9da8c@freebsd.org>
Message-ID: <20130710184356.R1991@besplex.bde.org>
References: <201306301952.r5UJqfwf010873@svn.freebsd.org>
 <20130701113808.F894@besplex.bde.org>
 <20130708132052.f9757df88ede1b087de9da8c@freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.0 cv=eqSHVfVX c=1 sm=1 a=tB-szSHScXMA:10
 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=E11o_6pwCccA:10
 a=i2sZn5OXAAAA:8 a=UzOYU2gb_QF09RkQxBUA:9 a=CjuIK1q_8ugA:10
 a=PObHtDWs1CoA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org, Bruce Evans 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 08:45:21 -0000

On Mon, 8 Jul 2013, Aleksandr Rybalko wrote:

> On Mon, 1 Jul 2013 11:56:25 +1000 (EST)
> Bruce Evans  wrote:
>
>> On Sun, 30 Jun 2013, Aleksandr Rybalko wrote:
>>
>>> Log:
>>>  Decrypt magic numbers - define names for fields of Generic Timer's CNTKCTL reg.
>>>
>>>  Submitted by:	Ruslan Bukin 
>>>
>>> Modified:
>>>  head/sys/arm/arm/generic_timer.c
>>>
>>> Modified: head/sys/arm/arm/generic_timer.c
>>> ==============================================================================
>>> --- head/sys/arm/arm/generic_timer.c	Sun Jun 30 19:36:17 2013	(r252424)
>>> +++ head/sys/arm/arm/generic_timer.c	Sun Jun 30 19:52:41 2013	(r252425)
>>> @@ -66,7 +66,22 @@ __FBSDID("$FreeBSD$");
>>> #define	GENERIC_TIMER_REG_CTRL		0
>>> #define	GENERIC_TIMER_REG_TVAL		1
>>>
>>> -#define	CNTPSIRQ	29
>>> +#define	GENERIC_TIMER_CNTKCTL_PL0PTEN	(1 << 9) /* Physical timer registers
>>> +						    access from PL0 */
>>> +#define	GENERIC_TIMER_CNTKCTL_PL0VTEN	(1 << 8) /* Virtual timer registers
>>
>> With names like these, the magic numbers are better.  The prefix name
>> GENERIC_TIMER is especially bad.  GT would be good.
>
> Changed in r252780.

Thanks.  It looks OK now.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 09:24:03 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id C7448C8A;
 Wed, 10 Jul 2013 09:24:03 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id B9EA01E4F;
 Wed, 10 Jul 2013 09:24:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A9O3IG070469;
 Wed, 10 Jul 2013 09:24:03 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6A9O3Br070468;
 Wed, 10 Jul 2013 09:24:03 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307100924.r6A9O3Br070468@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 10 Jul 2013 09:24:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253140 - head/sys/amd64/amd64
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 09:24:03 -0000

Author: kib
Date: Wed Jul 10 09:24:03 2013
New Revision: 253140
URL: http://svnweb.freebsd.org/changeset/base/253140

Log:
  Clear m->object for the page taken from the delayed free list for
  reuse as the pv chink page in reclaim_pv_chunk().  Having non-NULL
  m->object is wrong for page not owned by an object and confuses both
  vm_page_free_toq() and vm_page_remove() when the page is freed later.
  
  Reported and tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	3 days

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Wed Jul 10 08:21:09 2013	(r253139)
+++ head/sys/amd64/amd64/pmap.c	Wed Jul 10 09:24:03 2013	(r253140)
@@ -2234,6 +2234,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, str
 	if (m_pc == NULL && free != NULL) {
 		m_pc = free;
 		free = (void *)m_pc->object;
+		m_pc->object = NULL;
 		/* Recycle a freed page table page. */
 		m_pc->wire_count = 1;
 		atomic_add_int(&cnt.v_wire_count, 1);

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 10:11:44 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 249E7DF4;
 Wed, 10 Jul 2013 10:11:44 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 175DB1109;
 Wed, 10 Jul 2013 10:11:44 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AABhLD085438;
 Wed, 10 Jul 2013 10:11:43 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AABhY9085437;
 Wed, 10 Jul 2013 10:11:43 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307101011.r6AABhY9085437@svn.freebsd.org>
From: Konstantin Belousov 
Date: Wed, 10 Jul 2013 10:11:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253141 - head/sys/geom/journal
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 10:11:44 -0000

Author: kib
Date: Wed Jul 10 10:11:43 2013
New Revision: 253141
URL: http://svnweb.freebsd.org/changeset/base/253141

Log:
  When panicing due to the gjournal overflow, print the geom metadata
  journal id.
  
  Requested by:	Andreas Longwitz 
  MFC after:	1 week

Modified:
  head/sys/geom/journal/g_journal.c

Modified: head/sys/geom/journal/g_journal.c
==============================================================================
--- head/sys/geom/journal/g_journal.c	Wed Jul 10 09:24:03 2013	(r253140)
+++ head/sys/geom/journal/g_journal.c	Wed Jul 10 10:11:43 2013	(r253141)
@@ -341,7 +341,9 @@ g_journal_check_overflow(struct g_journa
 	    (sc->sc_active.jj_offset > sc->sc_inactive.jj_offset &&
 	     sc->sc_journal_offset >= sc->sc_inactive.jj_offset &&
 	     sc->sc_journal_offset < sc->sc_active.jj_offset)) {
-		panic("Journal overflow (joffset=%jd active=%jd inactive=%jd)",
+		panic("Journal overflow "
+		    "(id = %u joffset=%jd active=%jd inactive=%jd)",
+		    (unsigned)sc->sc_id,
 		    (intmax_t)sc->sc_journal_offset,
 		    (intmax_t)sc->sc_active.jj_offset,
 		    (intmax_t)sc->sc_inactive.jj_offset);

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 10:15:39 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 3F163FD0;
 Wed, 10 Jul 2013 10:15:39 +0000 (UTC) (envelope-from ray@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 30BD3112D;
 Wed, 10 Jul 2013 10:15:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AAFdgd086063;
 Wed, 10 Jul 2013 10:15:39 GMT (envelope-from ray@svn.freebsd.org)
Received: (from ray@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AAFdDK086062;
 Wed, 10 Jul 2013 10:15:39 GMT (envelope-from ray@svn.freebsd.org)
Message-Id: <201307101015.r6AAFdDK086062@svn.freebsd.org>
From: Aleksandr Rybalko 
Date: Wed, 10 Jul 2013 10:15:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253142 - head/sys/arm/arm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 10:15:39 -0000

Author: ray
Date: Wed Jul 10 10:15:38 2013
New Revision: 253142
URL: http://svnweb.freebsd.org/changeset/base/253142

Log:
  Remove trailing whitespaces.

Modified:
  head/sys/arm/arm/trap.c

Modified: head/sys/arm/arm/trap.c
==============================================================================
--- head/sys/arm/arm/trap.c	Wed Jul 10 10:11:43 2013	(r253141)
+++ head/sys/arm/arm/trap.c	Wed Jul 10 10:15:38 2013	(r253142)
@@ -238,7 +238,7 @@ data_abort_handler(trapframe_t *tf)
 	int error = 0;
 	struct ksig ksig;
 	struct proc *p;
-	
+
 
 	/* Grab FAR/FSR before enabling interrupts */
 	far = cpu_faultaddress();
@@ -262,10 +262,10 @@ data_abort_handler(trapframe_t *tf)
 
 	if (user) {
 		td->td_pticks = 0;
-		td->td_frame = tf;		
+		td->td_frame = tf;
 		if (td->td_ucred != td->td_proc->p_ucred)
 			cred_update_thread(td);
-		
+
 	}
 	/* Grab the current pcb */
 	pcb = td->td_pcb;
@@ -276,7 +276,7 @@ data_abort_handler(trapframe_t *tf)
 		if (__predict_true(tf->tf_spsr & F32_bit) == 0)
 			enable_interrupts(F32_bit);
 	}
-		
+
 
 	/* Invoke the appropriate handler, if necessary */
 	if (__predict_false(data_aborts[fsr & FAULT_TYPE_MASK].func != NULL)) {
@@ -720,7 +720,7 @@ prefetch_abort_handler(trapframe_t *tf)
 	printf("prefetch abort handler: %p %p\n", (void*)tf->tf_pc,
 	    (void*)tf->tf_usr_lr);
 #endif
-	
+
  	td = curthread;
 	p = td->td_proc;
 	PCPU_INC(cnt.v_trap);
@@ -937,7 +937,7 @@ swi_handler(trapframe_t *frame)
 	struct thread *td = curthread;
 
 	td->td_frame = frame;
-	
+
 	td->td_pticks = 0;
 	/*
       	 * Make sure the program counter is correctly aligned so we

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 10:40:52 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 9AC647EB;
 Wed, 10 Jul 2013 10:40:52 +0000 (UTC)
 (envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 739581258;
 Wed, 10 Jul 2013 10:40:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AAeqR0092476;
 Wed, 10 Jul 2013 10:40:52 GMT
 (envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AAeqbo092475;
 Wed, 10 Jul 2013 10:40:52 GMT
 (envelope-from netchild@svn.freebsd.org)
Message-Id: <201307101040.r6AAeqbo092475@svn.freebsd.org>
From: Alexander Leidinger 
Date: Wed, 10 Jul 2013 10:40:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253144 - head/sys/contrib/v4l
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 10:40:52 -0000

Author: netchild
Date: Wed Jul 10 10:40:52 2013
New Revision: 253144
URL: http://svnweb.freebsd.org/changeset/base/253144

Log:
  Fix build for gcc users by declaring variables for unions in structs which
  don't declare a variable. The size before/after this change of the structs
  doesn't change with gcc/clang.
  
  Noticed by:	several
  Suggested by:	Gary Jennejohn 

Modified:
  head/sys/contrib/v4l/videodev2.h

Modified: head/sys/contrib/v4l/videodev2.h
==============================================================================
--- head/sys/contrib/v4l/videodev2.h	Wed Jul 10 10:38:43 2013	(r253143)
+++ head/sys/contrib/v4l/videodev2.h	Wed Jul 10 10:40:52 2013	(r253144)
@@ -427,7 +427,7 @@ struct v4l2_frmsizeenum {
 	union {					/* Frame size */
 		struct v4l2_frmsize_discrete	discrete;
 		struct v4l2_frmsize_stepwise	stepwise;
-	};
+	} x;
 
 	__u32   reserved[2];			/* Reserved space for future use */
 };
@@ -457,7 +457,7 @@ struct v4l2_frmivalenum {
 	union {					/* Frame interval */
 		struct v4l2_fract		discrete;
 		struct v4l2_frmival_stepwise	stepwise;
-	};
+	} x;
 
 	__u32	reserved[2];			/* Reserved space for future use */
 };
@@ -834,7 +834,7 @@ struct v4l2_dv_timings {
 	union {
 		struct v4l2_bt_timings	bt;
 		__u32	reserved[32];
-	};
+	} x;
 } __attribute__ ((packed));
 
 /* Values for the type field */
@@ -927,7 +927,7 @@ struct v4l2_ext_control {
 		__s32 value;
 		__s64 value64;
 		char *string;
-	};
+	} x;
 } __attribute__ ((packed));
 
 struct v4l2_ext_controls {
@@ -1475,7 +1475,7 @@ struct v4l2_encoder_cmd {
 		struct {
 			__u32 data[8];
 		} raw;
-	};
+	} x;
 };
 
 #endif
@@ -1597,7 +1597,7 @@ struct v4l2_mpeg_vbi_fmt_ivtv {
 	union {
 		struct v4l2_mpeg_vbi_itv0 itv0;
 		struct v4l2_mpeg_vbi_ITV0 ITV0;
-	};
+	} x;
 } __attribute__ ((packed));
 
 /*
@@ -1648,7 +1648,7 @@ struct v4l2_dbg_match {
 	union {     /* Match this chip, meaning determined by type */
 		__u32 addr;
 		char name[32];
-	};
+	} x;
 } __attribute__ ((packed));
 
 struct v4l2_dbg_register {

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 10:48:24 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 7FD83D31;
 Wed, 10 Jul 2013 10:48:24 +0000 (UTC)
 (envelope-from theraven@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 7165D12D1;
 Wed, 10 Jul 2013 10:48:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AAmO3T095078;
 Wed, 10 Jul 2013 10:48:24 GMT
 (envelope-from theraven@svn.freebsd.org)
Received: (from theraven@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AAmNMU095069;
 Wed, 10 Jul 2013 10:48:23 GMT
 (envelope-from theraven@svn.freebsd.org)
Message-Id: <201307101048.r6AAmNMU095069@svn.freebsd.org>
From: David Chisnall 
Date: Wed, 10 Jul 2013 10:48:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r253145 - vendor/libcxxrt/dist
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 10:48:24 -0000

Author: theraven
Date: Wed Jul 10 10:48:22 2013
New Revision: 253145
URL: http://svnweb.freebsd.org/changeset/base/253145

Log:
  Import new libcxxrt into vendor branch.

Modified:
  vendor/libcxxrt/dist/atomic.h
  vendor/libcxxrt/dist/auxhelper.cc
  vendor/libcxxrt/dist/cxxabi.h
  vendor/libcxxrt/dist/dwarf_eh.h
  vendor/libcxxrt/dist/exception.cc
  vendor/libcxxrt/dist/guard.cc
  vendor/libcxxrt/dist/memory.cc

Modified: vendor/libcxxrt/dist/atomic.h
==============================================================================
--- vendor/libcxxrt/dist/atomic.h	Wed Jul 10 10:40:52 2013	(r253144)
+++ vendor/libcxxrt/dist/atomic.h	Wed Jul 10 10:48:22 2013	(r253145)
@@ -27,3 +27,4 @@
 #define ATOMIC_LOAD(addr)\
 	(__sync_synchronize(), *addr)
 #endif
+

Modified: vendor/libcxxrt/dist/auxhelper.cc
==============================================================================
--- vendor/libcxxrt/dist/auxhelper.cc	Wed Jul 10 10:40:52 2013	(r253144)
+++ vendor/libcxxrt/dist/auxhelper.cc	Wed Jul 10 10:48:22 2013	(r253145)
@@ -65,3 +65,13 @@ extern "C" void __cxa_pure_virtual()
     abort();
 }
 
+/**
+ * Compilers may (but are not required to) set any deleted-virtual function's
+ * vtable entry to this function.  This makes debugging slightly easier, as
+ * users can add a breakpoint on this function to tell if they've accidentally
+ * called a deleted-virtual function.
+ */
+extern "C" void __cxa_deleted_virtual()
+{
+    abort();
+}

Modified: vendor/libcxxrt/dist/cxxabi.h
==============================================================================
--- vendor/libcxxrt/dist/cxxabi.h	Wed Jul 10 10:40:52 2013	(r253144)
+++ vendor/libcxxrt/dist/cxxabi.h	Wed Jul 10 10:48:22 2013	(r253145)
@@ -193,6 +193,8 @@ __cxa_eh_globals *__cxa_get_globals(void
  */
 __cxa_eh_globals *__cxa_get_globals_fast(void);
 
+std::type_info * __cxa_current_exception_type();
+
 /**
  * Throws an exception returned by __cxa_current_primary_exception().  This
  * exception may have been caught in another thread.

Modified: vendor/libcxxrt/dist/dwarf_eh.h
==============================================================================
--- vendor/libcxxrt/dist/dwarf_eh.h	Wed Jul 10 10:40:52 2013	(r253144)
+++ vendor/libcxxrt/dist/dwarf_eh.h	Wed Jul 10 10:48:22 2013	(r253145)
@@ -57,6 +57,8 @@ typedef unsigned char *dw_eh_ptr_t;
 /// DWARF data encoding types.  
 enum dwarf_data_encoding
 {
+	/// Absolute pointer value
+	DW_EH_PE_absptr   = 0x00,
 	/// Unsigned, little-endian, base 128-encoded (variable length).
 	DW_EH_PE_uleb128 = 0x01,
 	/// Unsigned 16-bit integer.
@@ -95,8 +97,6 @@ enum dwarf_data_relative
 {
 	/// Value is omitted
 	DW_EH_PE_omit     = 0xff,
-	/// Absolute pointer value
-	DW_EH_PE_absptr   = 0x00,
 	/// Value relative to program counter
 	DW_EH_PE_pcrel    = 0x10,
 	/// Value relative to the text segment

Modified: vendor/libcxxrt/dist/exception.cc
==============================================================================
--- vendor/libcxxrt/dist/exception.cc	Wed Jul 10 10:40:52 2013	(r253144)
+++ vendor/libcxxrt/dist/exception.cc	Wed Jul 10 10:48:22 2013	(r253145)
@@ -39,6 +39,24 @@
 #pragma weak pthread_setspecific
 #pragma weak pthread_getspecific
 #pragma weak pthread_once
+#ifdef LIBCXXRT_WEAK_LOCKS
+#pragma weak pthread_mutex_lock
+#define pthread_mutex_lock(mtx) do {\
+	if (pthread_mutex_lock) pthread_mutex_lock(mtx);\
+	} while(0)
+#pragma weak pthread_mutex_unlock
+#define pthread_mutex_unlock(mtx) do {\
+	if (pthread_mutex_unlock) pthread_mutex_unlock(mtx);\
+	} while(0)
+#pragma weak pthread_cond_signal
+#define pthread_cond_signal(cv) do {\
+	if (pthread_cond_signal) pthread_cond_signal(cv);\
+	} while(0)
+#pragma weak pthread_cond_wait
+#define pthread_cond_wait(cv, mtx) do {\
+	if (pthread_cond_wait) pthread_cond_wait(cv, mtx);\
+	} while(0)
+#endif
 
 using namespace ABI_NAMESPACE;
 
@@ -214,8 +232,6 @@ namespace std
 
 }
 
-extern "C" std::type_info *__cxa_current_exception_type();
-
 /**
  * Class of exceptions to distinguish between this and other exception types.
  *

Modified: vendor/libcxxrt/dist/guard.cc
==============================================================================
--- vendor/libcxxrt/dist/guard.cc	Wed Jul 10 10:40:52 2013	(r253144)
+++ vendor/libcxxrt/dist/guard.cc	Wed Jul 10 10:48:22 2013	(r253145)
@@ -41,124 +41,112 @@
  * initialised.  
  */
 #include 
+#include 
+#include 
 #include 
 #include 
+#include "atomic.h"
 
-#ifdef __arm__
-// ARM ABI - 32-bit guards.
+// Older GCC doesn't define __LITTLE_ENDIAN__
+#ifndef __LITTLE_ENDIAN__
+	// If __BYTE_ORDER__ is defined, use that instead
+#	ifdef __BYTE_ORDER__
+#		if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#			define __LITTLE_ENDIAN__
+#		endif
+	// x86 and ARM are the most common little-endian CPUs, so let's have a
+	// special case for them (ARM is already special cased).  Assume everything
+	// else is big endian.
+#	elif defined(__x86_64) || defined(__i386)
+#		define __LITTLE_ENDIAN__
+#	endif
+#endif
 
-/**
- * Acquires a lock on a guard, returning 0 if the object has already been
- * initialised, and 1 if it has not.  If the object is already constructed then
- * this function just needs to read a byte from memory and return.
- */
-extern "C" int __cxa_guard_acquire(volatile int32_t *guard_object)
-{
-	if ((1<<31) == *guard_object) { return 0; }
-	// If we can atomically move the value from 0 -> 1, then this is
-	// uninitialised.
-	if (__sync_bool_compare_and_swap(guard_object, 0, 1))
-	{
-		return 1;
-	}
-	// If the value is not 0, some other thread was initialising this.  Spin
-	// until it's finished.
-	while (__sync_bool_compare_and_swap(guard_object, (1<<31), (1<<31)))
-	{
-		// If the other thread aborted, then we grab the lock
-		if (__sync_bool_compare_and_swap(guard_object, 0, 1))
-		{
-			return 1;
-		}
-		sched_yield();
-	}
-	return 0;
-}
 
-/**
- * Releases the lock without marking the object as initialised.  This function
- * is called if initialising a static causes an exception to be thrown.
+/*
+ * The least significant bit of the guard variable indicates that the object
+ * has been initialised, the most significant bit is used for a spinlock.
  */
-extern "C" void __cxa_guard_abort(int32_t *guard_object)
-{
-	assert(__sync_bool_compare_and_swap(guard_object, 1, 0));
-}
-/**
- * Releases the guard and marks the object as initialised.  This function is
- * called after successful initialisation of a static.
- */
-extern "C" void __cxa_guard_release(int32_t *guard_object)
-{
-	assert(__sync_bool_compare_and_swap(guard_object, 1, (1<<31)));
-}
-
-
+#ifdef __arm__
+// ARM ABI - 32-bit guards.
+typedef uint32_t guard_t;
+static const uint32_t LOCKED = ((guard_t)1) << 31;
+static const uint32_t INITIALISED = 1;
 #else
-// Itanium ABI: 64-bit guards
-
-/**
- * Returns a pointer to the low 32 bits in a 64-bit value, respecting the
- * platform's byte order.
- */
-static int32_t *low_32_bits(volatile int64_t *ptr)
-{
-	int32_t *low= (int32_t*)ptr;
-	// Test if the machine is big endian - constant propagation at compile time
-	// should eliminate this completely.
-	int one = 1;
-	if (*(char*)&one != 1)
-	{
-		low++;
-	}
-	return low;
-}
+typedef uint64_t guard_t;
+#	if defined(__LITTLE_ENDIAN__)
+static const guard_t LOCKED = ((guard_t)1) << 63;
+static const guard_t INITIALISED = 1;
+#	else
+static const guard_t LOCKED = 1;
+static const guard_t INITIALISED = ((guard_t)1) << 56;
+#	endif
+#endif
 
 /**
  * Acquires a lock on a guard, returning 0 if the object has already been
  * initialised, and 1 if it has not.  If the object is already constructed then
  * this function just needs to read a byte from memory and return.
  */
-extern "C" int __cxa_guard_acquire(volatile int64_t *guard_object)
+extern "C" int __cxa_guard_acquire(volatile guard_t *guard_object)
 {
-	char first_byte = (*guard_object) >> 56;
-	if (1 == first_byte) { return 0; }
-	int32_t *lock = low_32_bits(guard_object);
-	// Simple spin lock using the low 32 bits.  We assume that concurrent
-	// attempts to initialize statics are very rare, so we don't need to
-	// optimise for the case where we have lots of threads trying to acquire
-	// the lock at the same time.
-	while (!__sync_bool_compare_and_swap_4(lock, 0, 1))
+	// Not an atomic read, doesn't establish a happens-before relationship, but
+	// if one is already established and we end up seeing an initialised state
+	// then it's a fast path, otherwise we'll do something more expensive than
+	// this test anyway...
+	if ((INITIALISED == *guard_object)) { return 0; }
+	// Spin trying to do the initialisation
+	while (1)
 	{
-		if (1 == ((*guard_object) >> 56))
+		// Loop trying to move the value of the guard from 0 (not
+		// locked, not initialised) to the locked-uninitialised
+		// position.
+		switch (__sync_val_compare_and_swap(guard_object, 0, LOCKED))
 		{
-			break;
+			// If the old value was 0, we succeeded, so continue
+			// initialising
+			case 0:
+				return 1;
+			// If this was already initialised, return and let the caller skip
+			// initialising it again.
+			case INITIALISED:
+				return 0;
+			// If it is locked by another thread, relinquish the CPU and try
+			// again later.
+			case LOCKED:
+			case LOCKED | INITIALISED:
+				sched_yield();
+				break;
+			// If it is some other value, then something has gone badly wrong.
+			// Give up.
+			default:
+				fprintf(stderr, "Invalid state detected attempting to lock static initialiser.\n");
+				abort();
 		}
-		sched_yield();
 	}
-	// We have to test the guard again, in case another thread has performed
-	// the initialisation while we were trying to acquire the lock.
-	first_byte = (*guard_object) >> 56;
-	return (1 != first_byte);
+	//__builtin_unreachable();
+	return 0;
 }
 
 /**
  * Releases the lock without marking the object as initialised.  This function
  * is called if initialising a static causes an exception to be thrown.
  */
-extern "C" void __cxa_guard_abort(int64_t *guard_object)
+extern "C" void __cxa_guard_abort(volatile guard_t *guard_object)
 {
-	int32_t *lock = low_32_bits(guard_object);
-	*lock = 0;
+	__attribute__((unused))
+	bool reset = __sync_bool_compare_and_swap(guard_object, LOCKED, 0);
+	assert(reset);
 }
 /**
  * Releases the guard and marks the object as initialised.  This function is
  * called after successful initialisation of a static.
  */
-extern "C" void __cxa_guard_release(int64_t *guard_object)
+extern "C" void __cxa_guard_release(volatile guard_t *guard_object)
 {
-	// Set the first byte to 1
-	*guard_object |= ((int64_t)1) << 56;
-	__cxa_guard_abort(guard_object);
+	__attribute__((unused))
+	bool reset = __sync_bool_compare_and_swap(guard_object, LOCKED, INITIALISED);
+	assert(reset);
 }
 
-#endif
+

Modified: vendor/libcxxrt/dist/memory.cc
==============================================================================
--- vendor/libcxxrt/dist/memory.cc	Wed Jul 10 10:40:52 2013	(r253144)
+++ vendor/libcxxrt/dist/memory.cc	Wed Jul 10 10:48:22 2013	(r253145)
@@ -99,40 +99,21 @@ void* operator new(size_t size)
 __attribute__((weak))
 void* operator new(size_t size, const std::nothrow_t &) throw()
 {
-	if (0 == size)
-	{
-		size = 1;
+	try {
+		return :: operator new(size);
+	} catch (...) {
+		// nothrow operator new should return NULL in case of
+		// std::bad_alloc exception in new handler
+		return NULL;
 	}
-	void *mem = malloc(size);
-	while (0 == mem)
-	{
-		new_handler h = std::get_new_handler();
-		if (0 != h)
-		{
-			try
-			{
-				h();
-			}
-			catch (...)
-			{
-				// nothrow operator new should return NULL in case of
-				// std::bad_alloc exception in new handler
-				return NULL;
-			}
-		}
-		else
-		{
-			return NULL;
-		}
-		mem = malloc(size);
-	}
-
-	return mem;
 }
 
 
 __attribute__((weak))
 void operator delete(void * ptr)
+#if __cplusplus < 201000L
+throw()
+#endif
 {
 	free(ptr);
 }
@@ -140,13 +121,32 @@ void operator delete(void * ptr)
 
 __attribute__((weak))
 void * operator new[](size_t size)
+#if __cplusplus < 201000L
+throw(std::bad_alloc)
+#endif
 {
 	return ::operator new(size);
 }
 
 
 __attribute__((weak))
-void operator delete[](void * ptr) throw()
+void * operator new[](size_t size, const std::nothrow_t &) throw()
+{
+	try {
+		return ::operator new[](size);
+	} catch (...) {
+		// nothrow operator new should return NULL in case of
+		// std::bad_alloc exception in new handler
+		return NULL;
+	}
+}
+
+
+__attribute__((weak))
+void operator delete[](void * ptr)
+#if __cplusplus < 201000L
+throw()
+#endif
 {
 	::operator delete(ptr);
 }

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 10:49:33 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 0FEA4E6B;
 Wed, 10 Jul 2013 10:49:33 +0000 (UTC)
 (envelope-from theraven@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 01AEA12E1;
 Wed, 10 Jul 2013 10:49:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AAnWw9095245;
 Wed, 10 Jul 2013 10:49:32 GMT
 (envelope-from theraven@svn.freebsd.org)
Received: (from theraven@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AAnVGe095231;
 Wed, 10 Jul 2013 10:49:31 GMT
 (envelope-from theraven@svn.freebsd.org)
Message-Id: <201307101049.r6AAnVGe095231@svn.freebsd.org>
From: David Chisnall 
Date: Wed, 10 Jul 2013 10:49:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r253146 - in vendor/libc++/dist: include src
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 10:49:33 -0000

Author: theraven
Date: Wed Jul 10 10:49:31 2013
New Revision: 253146
URL: http://svnweb.freebsd.org/changeset/base/253146

Log:
  Pull new libc++ into vendor branch.

Modified:
  vendor/libc++/dist/include/__bit_reference
  vendor/libc++/dist/include/__config
  vendor/libc++/dist/include/__functional_base
  vendor/libc++/dist/include/__hash_table
  vendor/libc++/dist/include/__locale
  vendor/libc++/dist/include/__split_buffer
  vendor/libc++/dist/include/__std_stream
  vendor/libc++/dist/include/__tree
  vendor/libc++/dist/include/algorithm
  vendor/libc++/dist/include/atomic
  vendor/libc++/dist/include/chrono
  vendor/libc++/dist/include/deque
  vendor/libc++/dist/include/forward_list
  vendor/libc++/dist/include/functional
  vendor/libc++/dist/include/future
  vendor/libc++/dist/include/istream
  vendor/libc++/dist/include/iterator
  vendor/libc++/dist/include/list
  vendor/libc++/dist/include/locale
  vendor/libc++/dist/include/map
  vendor/libc++/dist/include/memory
  vendor/libc++/dist/include/random
  vendor/libc++/dist/include/regex
  vendor/libc++/dist/include/string
  vendor/libc++/dist/include/type_traits
  vendor/libc++/dist/include/unordered_map
  vendor/libc++/dist/include/utility
  vendor/libc++/dist/include/vector
  vendor/libc++/dist/src/debug.cpp
  vendor/libc++/dist/src/hash.cpp
  vendor/libc++/dist/src/iostream.cpp
  vendor/libc++/dist/src/locale.cpp
  vendor/libc++/dist/src/stdexcept.cpp
  vendor/libc++/dist/src/string.cpp
  vendor/libc++/dist/src/thread.cpp

Modified: vendor/libc++/dist/include/__bit_reference
==============================================================================
--- vendor/libc++/dist/include/__bit_reference	Wed Jul 10 10:48:22 2013	(r253145)
+++ vendor/libc++/dist/include/__bit_reference	Wed Jul 10 10:49:31 2013	(r253146)
@@ -333,7 +333,7 @@ __fill_n_false(__bit_iterator<_Cp, false
     }
     // do middle whole words
     __storage_type __nw = __n / __bits_per_word;
-    _VSTD::memset(__first.__seg_, 0, __nw * sizeof(__storage_type));
+    _VSTD::memset(_VSTD::__to_raw_pointer(__first.__seg_), 0, __nw * sizeof(__storage_type));
     __n -= __nw * __bits_per_word;
     // do last partial word
     if (__n > 0)
@@ -363,7 +363,7 @@ __fill_n_true(__bit_iterator<_Cp, false>
     }
     // do middle whole words
     __storage_type __nw = __n / __bits_per_word;
-    _VSTD::memset(__first.__seg_, -1, __nw * sizeof(__storage_type));
+    _VSTD::memset(_VSTD::__to_raw_pointer(__first.__seg_), -1, __nw * sizeof(__storage_type));
     __n -= __nw * __bits_per_word;
     // do last partial word
     if (__n > 0)
@@ -430,7 +430,9 @@ __copy_aligned(__bit_iterator<_Cp, _IsCo
         // __first.__ctz_ == 0;
         // do middle words
         __storage_type __nw = __n / __bits_per_word;
-        _VSTD::memmove(__result.__seg_, __first.__seg_, __nw * sizeof(__storage_type));
+        _VSTD::memmove(_VSTD::__to_raw_pointer(__result.__seg_),
+                       _VSTD::__to_raw_pointer(__first.__seg_),
+                       __nw * sizeof(__storage_type));
         __n -= __nw * __bits_per_word;
         __result.__seg_ += __nw;
         // do last word
@@ -569,7 +571,9 @@ __copy_backward_aligned(__bit_iterator<_
         __storage_type __nw = __n / __bits_per_word;
         __result.__seg_ -= __nw;
         __last.__seg_ -= __nw;
-        _VSTD::memmove(__result.__seg_, __last.__seg_, __nw * sizeof(__storage_type));
+        _VSTD::memmove(_VSTD::__to_raw_pointer(__result.__seg_),
+                       _VSTD::__to_raw_pointer(__last.__seg_),
+                       __nw * sizeof(__storage_type));
         __n -= __nw * __bits_per_word;
         // do last word
         if (__n > 0)
@@ -870,6 +874,7 @@ struct __bit_array
 {
     typedef typename _Cp::difference_type difference_type;
     typedef typename _Cp::__storage_type  __storage_type;
+    typedef typename _Cp::__storage_pointer __storage_pointer;
     typedef typename _Cp::iterator        iterator;
     static const unsigned __bits_per_word = _Cp::__bits_per_word;
     static const unsigned _Np = 4;
@@ -880,9 +885,15 @@ struct __bit_array
     _LIBCPP_INLINE_VISIBILITY static difference_type capacity()
         {return static_cast(_Np * __bits_per_word);}
     _LIBCPP_INLINE_VISIBILITY explicit __bit_array(difference_type __s) : __size_(__s) {}
-    _LIBCPP_INLINE_VISIBILITY iterator begin() {return iterator(__word_, 0);}
-    _LIBCPP_INLINE_VISIBILITY iterator end()   {return iterator(__word_ + __size_ / __bits_per_word,
-                                                  static_cast(__size_ % __bits_per_word));}
+    _LIBCPP_INLINE_VISIBILITY iterator begin()
+    {
+        return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]), 0);
+    }
+    _LIBCPP_INLINE_VISIBILITY iterator end()
+    {
+        return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]) + __size_ / __bits_per_word,
+                                                  static_cast(__size_ % __bits_per_word));
+    }
 };
 
 template 

Modified: vendor/libc++/dist/include/__config
==============================================================================
--- vendor/libc++/dist/include/__config	Wed Jul 10 10:48:22 2013	(r253145)
+++ vendor/libc++/dist/include/__config	Wed Jul 10 10:49:31 2013	(r253146)
@@ -56,6 +56,18 @@
 # endif  // __LONG_LONG_SUPPORTED
 #endif  // __FreeBSD__
 
+#ifdef __NetBSD__
+# include 
+#  if _BYTE_ORDER == _LITTLE_ENDIAN
+#   define _LIBCPP_LITTLE_ENDIAN 1
+#   define _LIBCPP_BIG_ENDIAN    0
+# else  // _BYTE_ORDER == _LITTLE_ENDIAN
+#   define _LIBCPP_LITTLE_ENDIAN 0
+#   define _LIBCPP_BIG_ENDIAN    1
+# endif  // _BYTE_ORDER == _LITTLE_ENDIAN
+# define _LIBCPP_HAS_QUICK_EXIT
+#endif  // __NetBSD__
+
 #ifdef _WIN32
 #  define _LIBCPP_LITTLE_ENDIAN 1
 #  define _LIBCPP_BIG_ENDIAN    0
@@ -135,6 +147,10 @@
 
 #endif // _WIN32
 
+#ifndef __has_attribute
+#define __has_attribute(__x) 0
+#endif
+
 #ifndef _LIBCPP_HIDDEN
 #define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
 #endif
@@ -212,7 +228,9 @@ typedef __char32_t char32_t;
 #  define _LIBCPP_NORETURN __attribute__ ((noreturn))
 #endif
 
+#if !(__has_feature(cxx_defaulted_functions))
 #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#endif  // !(__has_feature(cxx_defaulted_functions))
 
 #if !(__has_feature(cxx_deleted_functions))
 #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
@@ -272,10 +290,20 @@ typedef __char32_t char32_t;
 #define _LIBCPP_HAS_NO_CONSTEXPR
 #endif
 
-#if defined(__FreeBSD__) && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L)
+#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
+#if defined(__FreeBSD__)
+#define _LIBCPP_HAS_QUICK_EXIT
+#define _LIBCPP_HAS_C11_FEATURES
+#elif defined(__linux__)
+#include 
+#if __GLIBC_PREREQ(2, 15)
 #define _LIBCPP_HAS_QUICK_EXIT
+#endif
+#if __GLIBC_PREREQ(2, 17)
 #define _LIBCPP_HAS_C11_FEATURES
 #endif
+#endif
+#endif
 
 #if (__has_feature(cxx_noexcept))
 #  define _NOEXCEPT noexcept
@@ -418,8 +446,14 @@ template  struct __static_asse
 #define _LIBCPP_CONSTEXPR constexpr
 #endif
 
+#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#define _LIBCPP_DEFAULT {}
+#else
+#define _LIBCPP_DEFAULT = default;
+#endif
+
 #ifdef __GNUC__
-#define _NOALIAS __attribute__((malloc))
+#define _NOALIAS __attribute__((__malloc__))
 #else
 #define _NOALIAS
 #endif
@@ -451,7 +485,7 @@ template  struct __static_asse
 #define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
 #endif
 
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__)
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__) || defined(__NetBSD__)
 #define _LIBCPP_LOCALE__L_EXTENSIONS 1
 #endif
 #ifdef __FreeBSD__
@@ -476,6 +510,14 @@ template  struct __static_asse
 #   endif
 #endif
 
+#ifndef _LIBCPP_STD_VER
+#  if  __cplusplus <= 201103L
+#    define _LIBCPP_STD_VER 11
+#  else
+#    define _LIBCPP_STD_VER 13  // current year, or date of c++14 ratification
+#  endif
+#endif  // _LIBCPP_STD_VER
+
 #ifdef _LIBCPP_DEBUG2
 #   include <__debug>
 #else

Modified: vendor/libc++/dist/include/__functional_base
==============================================================================
--- vendor/libc++/dist/include/__functional_base	Wed Jul 10 10:48:22 2013	(r253145)
+++ vendor/libc++/dist/include/__functional_base	Wed Jul 10 10:49:31 2013	(r253146)
@@ -292,7 +292,8 @@ struct __weak_result_type<_Rp (_Cp::*)(_
 
 // bullets 1 and 2
 
-template 
+template 
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
@@ -301,7 +302,8 @@ __invoke(_Fp&& __f, _A0&& __a0, _Args&& 
     return (_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...);
 }
 
-template 
+template 
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
@@ -312,7 +314,8 @@ __invoke(_Fp&& __f, _A0&& __a0, _Args&& 
 
 // bullets 3 and 4
 
-template 
+template 
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_Fp&& __f, _A0&& __a0)
@@ -321,7 +324,8 @@ __invoke(_Fp&& __f, _A0&& __a0)
     return _VSTD::forward<_A0>(__a0).*__f;
 }
 
-template 
+template 
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_Fp&& __f, _A0&& __a0)

Modified: vendor/libc++/dist/include/__hash_table
==============================================================================
--- vendor/libc++/dist/include/__hash_table	Wed Jul 10 10:48:22 2013	(r253145)
+++ vendor/libc++/dist/include/__hash_table	Wed Jul 10 10:49:31 2013	(r253146)
@@ -33,7 +33,6 @@ template 
 struct __hash_node_base
 {
     typedef __hash_node_base __first_node;
- //   typedef _NodePtr pointer;
 
     _NodePtr    __next_;
 
@@ -111,7 +110,7 @@ public:
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return _VSTD::addressof(__node_->__value_);}
+        pointer operator->() const {return pointer_traits::pointer_to(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_iterator& operator++()
@@ -189,7 +188,7 @@ public:
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return _VSTD::addressof(__node_->__value_);}
+        pointer operator->() const {return pointer_traits::pointer_to(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_const_iterator& operator++()
@@ -255,7 +254,7 @@ public:
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return &__node_->__value_;}
+        pointer operator->() const {return pointer_traits::pointer_to(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_local_iterator& operator++()
@@ -345,7 +344,7 @@ public:
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return &__node_->__value_;}
+        pointer operator->() const {return pointer_traits::pointer_to(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_const_local_iterator& operator++()
@@ -505,8 +504,15 @@ public:
                                                      __node_allocator;
     typedef allocator_traits<__node_allocator>       __node_traits;
     typedef typename __node_traits::pointer          __node_pointer;
-    typedef typename __node_traits::const_pointer    __node_const_pointer;
+    typedef typename __node_traits::pointer          __node_const_pointer;
     typedef __hash_node_base<__node_pointer>         __first_node;
+    typedef typename pointer_traits<__node_pointer>::template
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+            rebind<__first_node>
+#else
+            rebind<__first_node>::other
+#endif
+                                                     __node_base_pointer;
 
 private:
 
@@ -558,9 +564,9 @@ public:
 
 public:
     typedef __hash_iterator<__node_pointer>                   iterator;
-    typedef __hash_const_iterator<__node_const_pointer>       const_iterator;
+    typedef __hash_const_iterator<__node_pointer>             const_iterator;
     typedef __hash_local_iterator<__node_pointer>             local_iterator;
-    typedef __hash_const_local_iterator<__node_const_pointer> const_local_iterator;
+    typedef __hash_const_local_iterator<__node_pointer>       const_local_iterator;
 
     __hash_table()
         _NOEXCEPT_(
@@ -706,7 +712,7 @@ public:
 
     _LIBCPP_INLINE_VISIBILITY
     size_type max_bucket_count() const _NOEXCEPT
-        {return __bucket_list_.get_deleter().__alloc().max_size();}
+        {return __pointer_alloc_traits::max_size(__bucket_list_.get_deleter().__alloc());}
     size_type bucket_size(size_type __n) const;
     _LIBCPP_INLINE_VISIBILITY float load_factor() const _NOEXCEPT
     {
@@ -807,6 +813,9 @@ private:
 
     void __deallocate(__node_pointer __np) _NOEXCEPT;
     __node_pointer __detach() _NOEXCEPT;
+
+    template  friend class _LIBCPP_TYPE_VIS unordered_map;
+    template  friend class _LIBCPP_TYPE_VIS unordered_multimap;
 };
 
 template 
@@ -893,7 +902,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     if (size() > 0)
     {
         __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
-            static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
         __u.__p1_.first().__next_ = nullptr;
         __u.size() = 0;
     }
@@ -917,7 +926,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
             __p1_.first().__next_ = __u.__p1_.first().__next_;
             __u.__p1_.first().__next_ = nullptr;
             __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
-                static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+                static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
             size() = __u.size();
             __u.size() = 0;
         }
@@ -1014,7 +1023,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     if (size() > 0)
     {
         __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
-            static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
         __u.__p1_.first().__next_ = nullptr;
         __u.size() = 0;
     }
@@ -1236,7 +1245,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
         __node_pointer __pn = __bucket_list_[__chash];
         if (__pn == nullptr)
         {
-            __pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
             __nd->__next_ = __pn->__next_;
             __pn->__next_ = __nd;
             // fix up __bucket_list_
@@ -1274,7 +1283,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     __node_pointer __pn = __bucket_list_[__chash];
     if (__pn == nullptr)
     {
-        __pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+        __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
         __cp->__next_ = __pn->__next_;
         __pn->__next_ = __cp;
         // fix up __bucket_list_
@@ -1322,7 +1331,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
 {
     if (__p != end() && key_eq()(*__p, __cp->__value_))
     {
-        __node_pointer __np = const_cast<__node_pointer>(__p.__node_);
+        __node_pointer __np = __p.__node_;
         __cp->__hash_ = __np->__hash_;
         size_type __bc = bucket_count();
         if (size()+1 > __bc * max_load_factor() || __bc == 0)
@@ -1380,7 +1389,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
         __node_pointer __pn = __bucket_list_[__chash];
         if (__pn == nullptr)
         {
-            __pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
             __h->__next_ = __pn->__next_;
             __pn->__next_ = __h.get();
             // fix up __bucket_list_
@@ -1542,7 +1551,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     {
         for (size_type __i = 0; __i < __nbc; ++__i)
             __bucket_list_[__i] = nullptr;
-        __node_pointer __pp(static_cast<__node_pointer>(_VSTD::addressof(__p1_.first())));
+        __node_pointer __pp(static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first())));
         __node_pointer __cp = __pp->__next_;
         if (__cp != nullptr)
         {
@@ -1700,7 +1709,7 @@ template ::iterator
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p)
 {
-    __node_pointer __np = const_cast<__node_pointer>(__p.__node_);
+    __node_pointer __np = __p.__node_;
     iterator __r(__np);
     ++__r;
     remove(__p);
@@ -1717,7 +1726,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
         ++__first;
         erase(__p);
     }
-    __node_pointer __np = const_cast<__node_pointer>(__last.__node_);
+    __node_pointer __np = __last.__node_;
     return iterator (__np);
 }
 
@@ -1757,7 +1766,7 @@ typename __hash_table<_Tp, _Hash, _Equal
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
 {
     // current node
-    __node_pointer __cn = const_cast<__node_pointer>(__p.__node_);
+    __node_pointer __cn = __p.__node_;
     size_type __bc = bucket_count();
     size_t __chash = __constrain_hash(__cn->__hash_, __bc);
     // find previous node
@@ -1767,7 +1776,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     // Fix up __bucket_list_
         // if __pn is not in same bucket (before begin is not in same bucket) &&
         //    if __cn->__next_ is not in same bucket (nullptr is not in same bucket)
-    if (__pn == _VSTD::addressof(__p1_.first()) || __constrain_hash(__pn->__hash_, __bc) != __chash)
+    if (__pn == static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()))
+                            || __constrain_hash(__pn->__hash_, __bc) != __chash)
     {
         if (__cn->__next_ == nullptr || __constrain_hash(__cn->__next_->__hash_, __bc) != __chash)
             __bucket_list_[__chash] = nullptr;
@@ -1907,10 +1917,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     __p3_.swap(__u.__p3_);
     if (size() > 0)
         __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
-            static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
     if (__u.size() > 0)
         __u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash_, __u.bucket_count())] =
-            static_cast<__node_pointer>(_VSTD::addressof(__u.__p1_.first()));
+            static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__u.__p1_.first()));
 }
 
 template 

Modified: vendor/libc++/dist/include/__locale
==============================================================================
--- vendor/libc++/dist/include/__locale	Wed Jul 10 10:48:22 2013	(r253145)
+++ vendor/libc++/dist/include/__locale	Wed Jul 10 10:49:31 2013	(r253146)
@@ -339,12 +339,12 @@ public:
     static const mask punct  = _PUNCT;
     static const mask xdigit = _HEX;
     static const mask blank  = _BLANK;
-#elif (defined(__APPLE__) || defined(__FreeBSD__)) || defined(EMSCRIPTEN)
+#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(EMSCRIPTEN) || defined(__NetBSD__)
 #ifdef __APPLE__
     typedef __uint32_t mask;
 #elif defined(__FreeBSD__)
     typedef unsigned long mask;
-#elif defined(EMSCRIPTEN)
+#elif defined(EMSCRIPTEN) ||  defined(__NetBSD__)
     typedef unsigned short mask;
 #endif
     static const mask space  = _CTYPE_S;
@@ -356,7 +356,11 @@ public:
     static const mask digit  = _CTYPE_D;
     static const mask punct  = _CTYPE_P;
     static const mask xdigit = _CTYPE_X;
+# if defined(__NetBSD__)
+    static const mask blank  = _CTYPE_BL;
+# else
     static const mask blank  = _CTYPE_B;
+# endif
 #elif defined(__sun__)
     typedef unsigned int mask;
     static const mask space  = _ISSPACE;
@@ -596,6 +600,10 @@ public:
     static const int* __classic_upper_table() _NOEXCEPT;
     static const int* __classic_lower_table() _NOEXCEPT;
 #endif
+#if defined(__NetBSD__)
+    static const short* __classic_upper_table() _NOEXCEPT;
+    static const short* __classic_lower_table() _NOEXCEPT;
+#endif
 
 protected:
     ~ctype();

Modified: vendor/libc++/dist/include/__split_buffer
==============================================================================
--- vendor/libc++/dist/include/__split_buffer	Wed Jul 10 10:48:22 2013	(r253145)
+++ vendor/libc++/dist/include/__split_buffer	Wed Jul 10 10:49:31 2013	(r253146)
@@ -290,7 +290,7 @@ void
 __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type)
 {
     while (__begin_ != __new_begin)
-        __alloc_traits::destroy(__alloc(), __begin_++);
+        __alloc_traits::destroy(__alloc(), __to_raw_pointer(__begin_++));
 }
 
 template 
@@ -307,7 +307,7 @@ void
 __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT
 {
     while (__new_last != __end_)
-        __alloc_traits::destroy(__alloc(), --__end_);
+        __alloc_traits::destroy(__alloc(), __to_raw_pointer(--__end_));
 }
 
 template 
@@ -320,7 +320,7 @@ __split_buffer<_Tp, _Allocator>::__destr
 
 template 
 __split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a)
-    : __end_cap_(0, __a)
+    : __end_cap_(nullptr, __a)
 {
     __first_ = __cap != 0 ? __alloc_traits::allocate(__alloc(), __cap) : nullptr;
     __begin_ = __end_ = __first_ + __start;
@@ -331,21 +331,21 @@ template 
 _LIBCPP_INLINE_VISIBILITY inline
 __split_buffer<_Tp, _Allocator>::__split_buffer()
     _NOEXCEPT_(is_nothrow_default_constructible::value)
-    : __first_(0), __begin_(0), __end_(0), __end_cap_(0)
+    : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr)
 {
 }
 
 template 
 _LIBCPP_INLINE_VISIBILITY inline
 __split_buffer<_Tp, _Allocator>::__split_buffer(__alloc_rr& __a)
-    : __first_(0), __begin_(0), __end_(0), __end_cap_(0, __a)
+    : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
 {
 }
 
 template 
 _LIBCPP_INLINE_VISIBILITY inline
 __split_buffer<_Tp, _Allocator>::__split_buffer(const __alloc_rr& __a)
-    : __first_(0), __begin_(0), __end_(0), __end_cap_(0, __a)
+    : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
 {
 }
 

Modified: vendor/libc++/dist/include/__std_stream
==============================================================================
--- vendor/libc++/dist/include/__std_stream	Wed Jul 10 10:48:22 2013	(r253145)
+++ vendor/libc++/dist/include/__std_stream	Wed Jul 10 10:49:31 2013	(r253146)
@@ -55,6 +55,8 @@ private:
     const codecvt* __cv_;
     state_type* __st_;
     int __encoding_;
+    int_type __last_consumed_;
+    bool __last_consumed_is_next_;
     bool __always_noconv_;
 
     __stdinbuf(const __stdinbuf&);
@@ -66,7 +68,9 @@ private:
 template 
 __stdinbuf<_CharT>::__stdinbuf(FILE* __fp, state_type* __st)
     : __file_(__fp),
-      __st_(__st)
+      __st_(__st),
+      __last_consumed_(traits_type::eof()),
+      __last_consumed_is_next_(false)
 {
     imbue(this->getloc());
 }
@@ -100,6 +104,16 @@ template 
 typename __stdinbuf<_CharT>::int_type
 __stdinbuf<_CharT>::__getchar(bool __consume)
 {
+    if (__last_consumed_is_next_)
+    {
+        int_type __result = __last_consumed_;
+        if (__consume)
+        {
+            __last_consumed_ = traits_type::eof();
+            __last_consumed_is_next_ = false;
+        }
+        return __result;
+    }
     char __extbuf[__limit];
     int __nread = _VSTD::max(1, __encoding_);
     for (int __i = 0; __i < __nread; ++__i)
@@ -154,6 +168,8 @@ __stdinbuf<_CharT>::__getchar(bool __con
                 return traits_type::eof();
         }
     }
+    else
+        __last_consumed_ = traits_type::to_int_type(__1buf);
     return traits_type::to_int_type(__1buf);
 }
 
@@ -162,28 +178,41 @@ typename __stdinbuf<_CharT>::int_type
 __stdinbuf<_CharT>::pbackfail(int_type __c)
 {
     if (traits_type::eq_int_type(__c, traits_type::eof()))
-        return __c;
-    char __extbuf[__limit];
-    char* __enxt;
-    const char_type __ci = traits_type::to_char_type(__c);
-    const char_type* __inxt;
-    switch (__cv_->out(*__st_, &__ci, &__ci + 1, __inxt,
-                              __extbuf, __extbuf + sizeof(__extbuf), __enxt))
     {
-    case _VSTD::codecvt_base::ok:
-        break;
-    case _VSTD::codecvt_base::noconv:
-        __extbuf[0] = static_cast(__c);
-        __enxt = __extbuf + 1;
-        break;
-    case codecvt_base::partial:
-    case codecvt_base::error:
-        return traits_type::eof();
+        if (!__last_consumed_is_next_)
+        {
+            __c = __last_consumed_;
+            __last_consumed_is_next_ = !traits_type::eq_int_type(__last_consumed_,
+                                                                 traits_type::eof());
+        }
+        return __c;
     }
-    while (__enxt > __extbuf)
-        if (ungetc(*--__enxt, __file_) == EOF)
+    if (__last_consumed_is_next_)
+    {
+        char __extbuf[__limit];
+        char* __enxt;
+        const char_type __ci = traits_type::to_char_type(__last_consumed_);
+        const char_type* __inxt;
+        switch (__cv_->out(*__st_, &__ci, &__ci + 1, __inxt,
+                                  __extbuf, __extbuf + sizeof(__extbuf), __enxt))
+        {
+        case _VSTD::codecvt_base::ok:
+            break;
+        case _VSTD::codecvt_base::noconv:
+            __extbuf[0] = static_cast(__last_consumed_);
+            __enxt = __extbuf + 1;
+            break;
+        case codecvt_base::partial:
+        case codecvt_base::error:
             return traits_type::eof();
- return traits_type::not_eof(__c);
+        }
+        while (__enxt > __extbuf)
+            if (ungetc(*--__enxt, __file_) == EOF)
+                return traits_type::eof();
+    }
+    __last_consumed_ = __c;
+    __last_consumed_is_next_ = true;
+    return __c;
 }
 
 // __stdoutbuf
@@ -234,30 +263,31 @@ __stdoutbuf<_CharT>::overflow(int_type _
     char_type __1buf;
     if (!traits_type::eq_int_type(__c, traits_type::eof()))
     {
-        this->setp(&__1buf, &__1buf+1);
-        *this->pptr() = traits_type::to_char_type(__c);
-        this->pbump(1);
+        __1buf = traits_type::to_char_type(__c);
         if (__always_noconv_)
         {
-            if (fwrite(this->pbase(), sizeof(char_type), 1, __file_) != 1)
+            if (fwrite(&__1buf, sizeof(char_type), 1, __file_) != 1)
                 return traits_type::eof();
         }
         else
         {
             char* __extbe = __extbuf;
             codecvt_base::result __r;
+            char_type* pbase = &__1buf;
+            char_type* pptr = pbase + 1;
+            char_type* epptr = pptr;
             do
             {
                 const char_type* __e;
-                __r = __cv_->out(*__st_, this->pbase(), this->pptr(), __e,
+                __r = __cv_->out(*__st_, pbase, pptr, __e,
                                         __extbuf,
                                         __extbuf + sizeof(__extbuf),
                                         __extbe);
-                if (__e == this->pbase())
+                if (__e == pbase)
                     return traits_type::eof();
                 if (__r == codecvt_base::noconv)
                 {
-                    if (fwrite(this->pbase(), 1, 1, __file_) != 1)
+                    if (fwrite(pbase, 1, 1, __file_) != 1)
                         return traits_type::eof();
                 }
                 else if (__r == codecvt_base::ok || __r == codecvt_base::partial)
@@ -267,15 +297,13 @@ __stdoutbuf<_CharT>::overflow(int_type _
                         return traits_type::eof();
                     if (__r == codecvt_base::partial)
                     {
-                        this->setp((char_type*)__e, this->pptr());
-                        this->pbump(static_cast(this->epptr() - this->pbase()));
+                        pbase = (char_type*)__e;
                     }
                 }
                 else
                     return traits_type::eof();
             } while (__r == codecvt_base::partial);
         }
-        this->setp(0, 0);
     }
     return traits_type::not_eof(__c);
 }

Modified: vendor/libc++/dist/include/__tree
==============================================================================
--- vendor/libc++/dist/include/__tree	Wed Jul 10 10:48:22 2013	(r253145)
+++ vendor/libc++/dist/include/__tree	Wed Jul 10 10:49:31 2013	(r253146)
@@ -644,7 +644,8 @@ public:
     _LIBCPP_INLINE_VISIBILITY __tree_iterator() _NOEXCEPT {}
 
     _LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;}
-    _LIBCPP_INLINE_VISIBILITY pointer operator->() const {return &__ptr_->__value_;}
+    _LIBCPP_INLINE_VISIBILITY pointer operator->() const
+        {return pointer_traits::pointer_to(__ptr_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __tree_iterator& operator++()
@@ -686,7 +687,7 @@ class _LIBCPP_TYPE_VIS __tree_const_iter
 {
     typedef _ConstNodePtr                                         __node_pointer;
     typedef typename pointer_traits<__node_pointer>::element_type __node;
-    typedef const typename __node::base                           __node_base;
+    typedef typename __node::base                                 __node_base;
     typedef typename pointer_traits<__node_pointer>::template
 #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
             rebind<__node_base>
@@ -729,7 +730,8 @@ public:
         : __ptr_(__p.__ptr_) {}
 
     _LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;}
-    _LIBCPP_INLINE_VISIBILITY pointer operator->() const {return &__ptr_->__value_;}
+    _LIBCPP_INLINE_VISIBILITY pointer operator->() const
+        {return pointer_traits::pointer_to(__ptr_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __tree_const_iterator& operator++()
@@ -779,8 +781,10 @@ public:
     typedef typename __alloc_traits::size_type       size_type;
     typedef typename __alloc_traits::difference_type difference_type;
 
-    typedef __tree_node __node;
-    typedef __tree_node_base __node_base;
+    typedef typename __alloc_traits::void_pointer  __void_pointer;
+
+    typedef __tree_node __node;
+    typedef __tree_node_base<__void_pointer>        __node_base;
     typedef typename __alloc_traits::template
 #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
             rebind_alloc<__node>
@@ -790,9 +794,9 @@ public:
                                                      __node_allocator;
     typedef allocator_traits<__node_allocator>       __node_traits;
     typedef typename __node_traits::pointer          __node_pointer;
-    typedef typename __node_traits::const_pointer    __node_const_pointer;
+    typedef typename __node_traits::pointer          __node_const_pointer;
     typedef typename __node_base::pointer            __node_base_pointer;
-    typedef typename __node_base::const_pointer      __node_base_const_pointer;
+    typedef typename __node_base::pointer            __node_base_const_pointer;
 private:
     typedef typename __node_base::base __end_node_t;
     typedef typename pointer_traits<__node_pointer>::template
@@ -804,9 +808,9 @@ private:
                                                      __end_node_ptr;
     typedef typename pointer_traits<__node_pointer>::template
 #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-            rebind
+            rebind<__end_node_t>
 #else
-            rebind::other
+            rebind<__end_node_t>::other
 #endif
                                                      __end_node_const_ptr;
 
@@ -828,7 +832,7 @@ public:
     {
         return static_cast<__node_const_pointer>
                (
-                   pointer_traits<__end_node_const_ptr>::pointer_to(__pair1_.first())
+                   pointer_traits<__end_node_const_ptr>::pointer_to(const_cast<__end_node_t&>(__pair1_.first()))
                );
     }
     _LIBCPP_INLINE_VISIBILITY
@@ -865,7 +869,7 @@ public:
         {return static_cast<__node_const_pointer>(__end_node()->__left_);}
 
     typedef __tree_iterator             iterator;
-    typedef __tree_const_iterator const_iterator;
+    typedef __tree_const_iterator const_iterator;
 
     explicit __tree(const value_compare& __comp)
         _NOEXCEPT_(
@@ -1102,6 +1106,9 @@ private:
 
     __node_pointer __detach();
     static __node_pointer __detach(__node_pointer);
+
+    template  friend class _LIBCPP_TYPE_VIS map;
+    template  friend class _LIBCPP_TYPE_VIS multimap;
 };
 
 template 
@@ -1161,7 +1168,7 @@ __tree<_Tp, _Compare, _Allocator>::__det
 {
     if (__cache->__parent_ == nullptr)
         return nullptr;
-    if (__tree_is_left_child(__cache))
+    if (__tree_is_left_child(static_cast<__node_base_pointer>(__cache)))
     {
         __cache->__parent_->__left_ = nullptr;
         __cache = static_cast<__node_pointer>(__cache->__parent_);
@@ -1294,7 +1301,7 @@ __tree<_Tp, _Compare, _Allocator>::__tre
         __begin_node() = __end_node();
     else
     {
-        __end_node()->__left_->__parent_ = __end_node();
+        __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
         __t.__begin_node() = __t.__end_node();
         __t.__end_node()->__left_ = nullptr;
         __t.size() = 0;
@@ -1314,7 +1321,7 @@ __tree<_Tp, _Compare, _Allocator>::__tre
         {
             __begin_node() = __t.__begin_node();
             __end_node()->__left_ = __t.__end_node()->__left_;
-            __end_node()->__left_->__parent_ = __end_node();
+            __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
             size() = __t.size();
             __t.__begin_node() = __t.__end_node();
             __t.__end_node()->__left_ = nullptr;
@@ -1342,7 +1349,7 @@ __tree<_Tp, _Compare, _Allocator>::__mov
         __begin_node() = __end_node();
     else
     {
-        __end_node()->__left_->__parent_ = __end_node();
+        __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
         __t.__begin_node() = __t.__end_node();
         __t.__end_node()->__left_ = nullptr;
         __t.size() = 0;
@@ -1447,11 +1454,11 @@ __tree<_Tp, _Compare, _Allocator>::swap(
     if (size() == 0)
         __begin_node() = __end_node();
     else
-        __end_node()->__left_->__parent_ = __end_node();
+        __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
     if (__t.size() == 0)
         __t.__begin_node() = __t.__end_node();
     else
-        __t.__end_node()->__left_->__parent_ = __t.__end_node();
+        __t.__end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__t.__end_node());
 }
 
 template 
@@ -1483,7 +1490,7 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__right_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__right_;
                 }
             }
@@ -1493,13 +1500,13 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__left_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__left_;
                 }
             }
         }
     }
-    __parent = __end_node();
+    __parent = static_cast<__node_base_pointer>(__end_node());
     return __parent->__left_;
 }
 
@@ -1522,7 +1529,7 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__left_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__left_;
                 }
             }
@@ -1532,13 +1539,13 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__right_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__right_;
                 }
             }
         }
     }
-    __parent = __end_node();
+    __parent = static_cast<__node_base_pointer>(__end_node());
     return __parent->__left_;
 }
 
@@ -1563,12 +1570,12 @@ __tree<_Tp, _Compare, _Allocator>::__fin
             // *prev(__hint) <= __v <= *__hint
             if (__hint.__ptr_->__left_ == nullptr)
             {
-                __parent = const_cast<__node_pointer&>(__hint.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
                 return __parent->__left_;
             }
             else
             {
-                __parent = const_cast<__node_pointer&>(__prior.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__prior.__ptr_);
                 return __parent->__right_;
             }
         }
@@ -1600,7 +1607,7 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__left_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__left_;
                 }
             }
@@ -1610,18 +1617,18 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__right_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__right_;
                 }
             }
             else
             {
-                __parent = __nd;
+                __parent = static_cast<__node_base_pointer>(__nd);
                 return __parent;
             }
         }
     }
-    __parent = __end_node();
+    __parent = static_cast<__node_base_pointer>(__end_node());
     return __parent->__left_;
 }
 
@@ -1648,12 +1655,12 @@ __tree<_Tp, _Compare, _Allocator>::__fin
             // *prev(__hint) < __v < *__hint
             if (__hint.__ptr_->__left_ == nullptr)
             {
-                __parent = const_cast<__node_pointer&>(__hint.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
                 return __parent->__left_;
             }
             else
             {
-                __parent = const_cast<__node_pointer&>(__prior.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__prior.__ptr_);
                 return __parent->__right_;
             }
         }
@@ -1669,12 +1676,12 @@ __tree<_Tp, _Compare, _Allocator>::__fin
             // *__hint < __v < *_VSTD::next(__hint)
             if (__hint.__ptr_->__right_ == nullptr)
             {
-                __parent = const_cast<__node_pointer&>(__hint.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
                 return __parent->__right_;
             }
             else
             {
-                __parent = const_cast<__node_pointer&>(__next.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__next.__ptr_);
                 return __parent->__left_;
             }
         }
@@ -1682,7 +1689,7 @@ __tree<_Tp, _Compare, _Allocator>::__fin
         return __find_equal(__parent, __v);
     }
     // else __v == *__hint
-    __parent = const_cast<__node_pointer&>(__hint.__ptr_);
+    __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
     return __parent;
 }
 
@@ -1729,7 +1736,7 @@ __tree<_Tp, _Compare, _Allocator>::__emp
     bool __inserted = false;
     if (__child == nullptr)
     {
-        __insert_node_at(__parent, __child, __h.get());
+        __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
         __r = __h.release();
         __inserted = true;
     }
@@ -1747,7 +1754,7 @@ __tree<_Tp, _Compare, _Allocator>::__emp
     __node_pointer __r = static_cast<__node_pointer>(__child);
     if (__child == nullptr)
     {
-        __insert_node_at(__parent, __child, __h.get());
+        __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
         __r = __h.release();
     }
     return iterator(__r);
@@ -1761,7 +1768,7 @@ __tree<_Tp, _Compare, _Allocator>::__emp
     __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
     __node_base_pointer __parent;
     __node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_);
-    __insert_node_at(__parent, __child, __h.get());
+    __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
     return iterator(static_cast<__node_pointer>(__h.release()));
 }
 
@@ -1774,7 +1781,7 @@ __tree<_Tp, _Compare, _Allocator>::__emp
     __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);

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

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 10:50:35 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 2E01BFAE;
 Wed, 10 Jul 2013 10:50:35 +0000 (UTC)
 (envelope-from theraven@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 081F012F2;
 Wed, 10 Jul 2013 10:50:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AAoYwa095457;
 Wed, 10 Jul 2013 10:50:34 GMT
 (envelope-from theraven@svn.freebsd.org)
Received: (from theraven@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AAoY70095456;
 Wed, 10 Jul 2013 10:50:34 GMT
 (envelope-from theraven@svn.freebsd.org)
Message-Id: <201307101050.r6AAoY70095456@svn.freebsd.org>
From: David Chisnall 
Date: Wed, 10 Jul 2013 10:50:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r253147 - vendor/libc++/r185801
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 10:50:35 -0000

Author: theraven
Date: Wed Jul 10 10:50:34 2013
New Revision: 253147
URL: http://svnweb.freebsd.org/changeset/base/253147

Log:
  Tag vendor import.

Added:
  vendor/libc++/r185801/
     - copied from r253146, vendor/libc++/dist/

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 10:51:12 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id B53B917A;
 Wed, 10 Jul 2013 10:51:12 +0000 (UTC)
 (envelope-from theraven@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8DC571304;
 Wed, 10 Jul 2013 10:51:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AApC6f097126;
 Wed, 10 Jul 2013 10:51:12 GMT
 (envelope-from theraven@svn.freebsd.org)
Received: (from theraven@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AApCYR097125;
 Wed, 10 Jul 2013 10:51:12 GMT
 (envelope-from theraven@svn.freebsd.org)
Message-Id: <201307101051.r6AApCYR097125@svn.freebsd.org>
From: David Chisnall 
Date: Wed, 10 Jul 2013 10:51:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-vendor@freebsd.org
Subject: svn commit: r253148 -
 vendor/libcxxrt/2013-07-08-c61efa043b14378efbd69c9a2686d44ed46ae179
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 10:51:12 -0000

Author: theraven
Date: Wed Jul 10 10:51:12 2013
New Revision: 253148
URL: http://svnweb.freebsd.org/changeset/base/253148

Log:
  Tag vendor import.

Added:
  vendor/libcxxrt/2013-07-08-c61efa043b14378efbd69c9a2686d44ed46ae179/
     - copied from r253147, vendor/libcxxrt/dist/

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 10:57:09 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id BD747593;
 Wed, 10 Jul 2013 10:57:09 +0000 (UTC)
 (envelope-from theraven@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id AFFD7136B;
 Wed, 10 Jul 2013 10:57:09 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AAv970097967;
 Wed, 10 Jul 2013 10:57:09 GMT
 (envelope-from theraven@svn.freebsd.org)
Received: (from theraven@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AAv97Q097966;
 Wed, 10 Jul 2013 10:57:09 GMT
 (envelope-from theraven@svn.freebsd.org)
Message-Id: <201307101057.r6AAv97Q097966@svn.freebsd.org>
From: David Chisnall 
Date: Wed, 10 Jul 2013 10:57:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253149 - head/usr.bin/dtc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 10:57:09 -0000

Author: theraven
Date: Wed Jul 10 10:57:09 2013
New Revision: 253149
URL: http://svnweb.freebsd.org/changeset/base/253149

Log:
  Report error for out-of-range numerical inputs.  Requested by brooks.

Modified:
  head/usr.bin/dtc/fdt.cc

Modified: head/usr.bin/dtc/fdt.cc
==============================================================================
--- head/usr.bin/dtc/fdt.cc	Wed Jul 10 10:51:12 2013	(r253148)
+++ head/usr.bin/dtc/fdt.cc	Wed Jul 10 10:57:09 2013	(r253149)
@@ -30,6 +30,8 @@
  * $FreeBSD$
  */
 
+#define __STDC_LIMIT_MACROS 1
+
 #include "fdt.hh"
 
 #include 
@@ -281,6 +283,12 @@ property::parse_cells(input_buffer &inpu
 				valid = false;
 				return;
 			}
+			if ((val < 0) || (val > UINT32_MAX))
+			{
+				input.parse_error("Value out of range");
+				valid = false;
+				return;
+			}
 			push_big_endian(v.byte_data, (uint32_t)val);
 			input.next_token();
 		}

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 12:06:02 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 44D6BDF3;
 Wed, 10 Jul 2013 12:06:02 +0000 (UTC)
 (envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 361A7195A;
 Wed, 10 Jul 2013 12:06:02 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AC62u3021177;
 Wed, 10 Jul 2013 12:06:02 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AC61qo021175;
 Wed, 10 Jul 2013 12:06:01 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201307101206.r6AC61qo021175@svn.freebsd.org>
From: Andre Oppermann 
Date: Wed, 10 Jul 2013 12:06:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253150 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 12:06:02 -0000

Author: andre
Date: Wed Jul 10 12:06:01 2013
New Revision: 253150
URL: http://svnweb.freebsd.org/changeset/base/253150

Log:
  Extend debug logging of TCP timestamp related specification
  violations.
  
  Update related comments and style.

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_syncache.c

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Wed Jul 10 10:57:09 2013	(r253149)
+++ head/sys/netinet/tcp_input.c	Wed Jul 10 12:06:01 2013	(r253150)
@@ -1446,6 +1446,8 @@ tcp_do_segment(struct mbuf *m, struct tc
 	int thflags, acked, ourfinisacked, needoutput = 0;
 	int rstreason, todrop, win;
 	u_long tiwin;
+	char *s;
+	struct in_conninfo *inc;
 	struct tcpopt to;
 
 #ifdef TCPDEBUG
@@ -1458,6 +1460,7 @@ tcp_do_segment(struct mbuf *m, struct tc
 	short ostate = 0;
 #endif
 	thflags = th->th_flags;
+	inc = &tp->t_inpcb->inp_inc;
 	tp->sackhint.last_sack_ack = 0;
 
 	/*
@@ -1546,6 +1549,24 @@ tcp_do_segment(struct mbuf *m, struct tc
 		if (TSTMP_GT(to.to_tsecr, tcp_ts_getticks()))
 			to.to_tsecr = 0;
 	}
+	/*
+	 * If timestamps were negotiated during SYN/ACK they should
+	 * appear on every segment during this session and vice versa.
+	 */
+	if ((tp->t_flags & TF_RCVD_TSTMP) && !(to.to_flags & TOF_TS)) {
+		if ((s = tcp_log_addrs(inc, th, NULL, NULL))) {
+			log(LOG_DEBUG, "%s; %s: Timestamp missing, "
+			    "no action\n", s, __func__);
+			free(s, M_TCPLOG);
+		}
+	}
+	if (!(tp->t_flags & TF_RCVD_TSTMP) && (to.to_flags & TOF_TS)) {
+		if ((s = tcp_log_addrs(inc, th, NULL, NULL))) {
+			log(LOG_DEBUG, "%s; %s: Timestamp not expected, "
+			    "no action\n", s, __func__);
+			free(s, M_TCPLOG);
+		}
+	}
 
 	/*
 	 * Process options only when we get SYN/ACK back. The SYN case
@@ -2213,15 +2234,14 @@ tcp_do_segment(struct mbuf *m, struct tc
 	 */
 	if ((so->so_state & SS_NOFDREF) &&
 	    tp->t_state > TCPS_CLOSE_WAIT && tlen) {
-		char *s;
-
 		KASSERT(ti_locked == TI_WLOCKED, ("%s: SS_NOFDEREF && "
 		    "CLOSE_WAIT && tlen ti_locked %d", __func__, ti_locked));
 		INP_INFO_WLOCK_ASSERT(&V_tcbinfo);
 
-		if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) {
-			log(LOG_DEBUG, "%s; %s: %s: Received %d bytes of data after socket "
-			    "was closed, sending RST and removing tcpcb\n",
+		if ((s = tcp_log_addrs(inc, th, NULL, NULL))) {
+			log(LOG_DEBUG, "%s; %s: %s: Received %d bytes of data "
+			    "after socket was closed, "
+			    "sending RST and removing tcpcb\n",
 			    s, __func__, tcpstates[tp->t_state], tlen);
 			free(s, M_TCPLOG);
 		}

Modified: head/sys/netinet/tcp_syncache.c
==============================================================================
--- head/sys/netinet/tcp_syncache.c	Wed Jul 10 10:57:09 2013	(r253149)
+++ head/sys/netinet/tcp_syncache.c	Wed Jul 10 12:06:01 2013	(r253150)
@@ -992,12 +992,29 @@ syncache_expand(struct in_conninfo *inc,
 		goto failed;
 	}
 
+	/*
+	 * If timestamps were not negotiated during SYN/ACK they
+	 * must not appear on any segment during this session.
+	 */
 	if (!(sc->sc_flags & SCF_TIMESTAMP) && (to->to_flags & TOF_TS)) {
 		if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
 			log(LOG_DEBUG, "%s; %s: Timestamp not expected, "
 			    "segment rejected\n", s, __func__);
 		goto failed;
 	}
+
+	/*
+	 * If timestamps were negotiated during SYN/ACK they should
+	 * appear on every segment during this session.
+	 * XXXAO: This is only informal as there have been unverified
+	 * reports of non-compliants stacks.
+	 */
+	if ((sc->sc_flags & SCF_TIMESTAMP) && !(to->to_flags & TOF_TS)) {
+		if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
+			log(LOG_DEBUG, "%s; %s: Timestamp missing, "
+			    "no action\n", s, __func__);
+	}
+
 	/*
 	 * If timestamps were negotiated the reflected timestamp
 	 * must be equal to what we actually sent in the SYN|ACK.

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 14:06:35 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id E474DEA2;
 Wed, 10 Jul 2013 14:06:35 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id D62171FF6;
 Wed, 10 Jul 2013 14:06:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AE6Z9H058230;
 Wed, 10 Jul 2013 14:06:35 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AE6Zog058229;
 Wed, 10 Jul 2013 14:06:35 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201307101406.r6AE6Zog058229@svn.freebsd.org>
From: Dag-Erling Smørgrav 
Date: Wed, 10 Jul 2013 14:06:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253152 - stable/9/lib/libfetch
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 14:06:36 -0000

Author: des
Date: Wed Jul 10 14:06:35 2013
New Revision: 253152
URL: http://svnweb.freebsd.org/changeset/base/253152

Log:
  MFH (r252375): remove useless side effect which triggers a clang bug.

Modified:
  stable/9/lib/libfetch/fetch.c
Directory Properties:
  stable/9/lib/libfetch/   (props changed)

Modified: stable/9/lib/libfetch/fetch.c
==============================================================================
--- stable/9/lib/libfetch/fetch.c	Wed Jul 10 12:51:30 2013	(r253151)
+++ stable/9/lib/libfetch/fetch.c	Wed Jul 10 14:06:35 2013	(r253152)
@@ -376,7 +376,7 @@ fetchParseURL(const char *URL)
 
 		/* password */
 		if (*q == ':')
-			q = fetch_pctdecode(u->pwd, ++q, URL_PWDLEN);
+			q = fetch_pctdecode(u->pwd, q + 1, URL_PWDLEN);
 
 		p++;
 	} else {

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 14:11:14 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 69203E2;
 Wed, 10 Jul 2013 14:11:14 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 5A5901048;
 Wed, 10 Jul 2013 14:11:14 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AEBEb1060693;
 Wed, 10 Jul 2013 14:11:14 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AEBEXc060692;
 Wed, 10 Jul 2013 14:11:14 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201307101411.r6AEBEXc060692@svn.freebsd.org>
From: Dag-Erling Smørgrav 
Date: Wed, 10 Jul 2013 14:11:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253153 - stable/9/contrib/openpam/lib
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 14:11:14 -0000

Author: des
Date: Wed Jul 10 14:11:13 2013
New Revision: 253153
URL: http://svnweb.freebsd.org/changeset/base/253153

Log:
  MFH (r249479): OPENPAM_DEBUG enables debugging but does not turn it on

Modified:
  stable/9/contrib/openpam/lib/openpam_log.c
Directory Properties:
  stable/9/contrib/openpam/   (props changed)

Modified: stable/9/contrib/openpam/lib/openpam_log.c
==============================================================================
--- stable/9/contrib/openpam/lib/openpam_log.c	Wed Jul 10 14:06:35 2013	(r253152)
+++ stable/9/contrib/openpam/lib/openpam_log.c	Wed Jul 10 14:11:13 2013	(r253153)
@@ -49,11 +49,7 @@
 
 #include "openpam_impl.h"
 
-#ifdef OPENPAM_DEBUG
-int openpam_debug = 1;
-#else
 int openpam_debug = 0;
-#endif
 
 #if !defined(openpam_log)
 

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 14:11:51 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id C6B2E1D0;
 Wed, 10 Jul 2013 14:11:51 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id B930B1052;
 Wed, 10 Jul 2013 14:11:51 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AEBpqb060822;
 Wed, 10 Jul 2013 14:11:51 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AEBpXS060821;
 Wed, 10 Jul 2013 14:11:51 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201307101411.r6AEBpXS060821@svn.freebsd.org>
From: Dag-Erling Smørgrav 
Date: Wed, 10 Jul 2013 14:11:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253154 - stable/9/lib/libpam
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 14:11:51 -0000

Author: des
Date: Wed Jul 10 14:11:51 2013
New Revision: 253154
URL: http://svnweb.freebsd.org/changeset/base/253154

Log:
  MFH (r249479): OPENPAM_DEBUG enables debugging but does not turn it on

Modified:
  stable/9/lib/libpam/Makefile.inc
Directory Properties:
  stable/9/lib/libpam/   (props changed)

Modified: stable/9/lib/libpam/Makefile.inc
==============================================================================
--- stable/9/lib/libpam/Makefile.inc	Wed Jul 10 14:11:13 2013	(r253153)
+++ stable/9/lib/libpam/Makefile.inc	Wed Jul 10 14:11:51 2013	(r253154)
@@ -24,9 +24,7 @@
 #
 # $FreeBSD$
 
-.ifdef PAM_DEBUG
-DEBUG_FLAGS+=	-DDEBUG
-.endif
+CFLAGS+=	-DOPENPAM_DEBUG
 
 SHLIB_MAJOR=	5
 PAM_MOD_DIR=	${LIBDIR}

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 14:13:39 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 2EC11385;
 Wed, 10 Jul 2013 14:13:39 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 10C1F1074;
 Wed, 10 Jul 2013 14:13:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AEDc9o061145;
 Wed, 10 Jul 2013 14:13:38 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AEDccN061139;
 Wed, 10 Jul 2013 14:13:38 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201307101413.r6AEDccN061139@svn.freebsd.org>
From: Dag-Erling Smørgrav 
Date: Wed, 10 Jul 2013 14:13:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253155 - stable/9/sbin/fsck_ffs
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 14:13:39 -0000

Author: des
Date: Wed Jul 10 14:13:37 2013
New Revision: 253155
URL: http://svnweb.freebsd.org/changeset/base/253155

Log:
  MFH (r250056,r250057): add -Z option to zero unused blocks.

Modified:
  stable/9/sbin/fsck_ffs/fsck.h
  stable/9/sbin/fsck_ffs/fsck_ffs.8
  stable/9/sbin/fsck_ffs/fsutil.c
  stable/9/sbin/fsck_ffs/main.c
  stable/9/sbin/fsck_ffs/pass5.c
Directory Properties:
  stable/9/sbin/fsck_ffs/   (props changed)

Modified: stable/9/sbin/fsck_ffs/fsck.h
==============================================================================
--- stable/9/sbin/fsck_ffs/fsck.h	Wed Jul 10 14:11:51 2013	(r253154)
+++ stable/9/sbin/fsck_ffs/fsck.h	Wed Jul 10 14:13:37 2013	(r253155)
@@ -74,6 +74,7 @@
 #define	MINBUFS		10	/* minimum number of buffers required */
 #define	MAXBUFS		40	/* maximum space to allocate to buffers */
 #define	INOBUFSIZE	64*1024	/* size of buffer to read inodes in pass1 */
+#define	ZEROBUFSIZE	(dev_bsize * 128) /* size of zero buffer used by -Z */
 
 union dinode {
 	struct ufs1_dinode dp1;
@@ -306,7 +307,8 @@ char	yflag;			/* assume a yes response *
 int	bkgrdflag;		/* use a snapshot to run on an active system */
 int	bflag;			/* location of alternate super block */
 int	debug;			/* output debugging info */
-int	Eflag;			/* zero out empty data blocks */
+int	Eflag;			/* delete empty data blocks */
+int	Zflag;			/* zero empty data blocks */
 int	inoopt;			/* trim out unused inodes */
 char	ckclean;		/* only do work if not cleanly unmounted */
 int	cvtlevel;		/* convert to newer file system format */
@@ -402,6 +404,7 @@ int		blread(int fd, char *buf, ufs2_dadd
 void		bufinit(void);
 void		blwrite(int fd, char *buf, ufs2_daddr_t blk, long size);
 void		blerase(int fd, ufs2_daddr_t blk, long size);
+void		blzero(int fd, ufs2_daddr_t blk, long size);
 void		cacheino(union dinode *dp, ino_t inumber);
 void		catch(int);
 void		catchquit(int);

Modified: stable/9/sbin/fsck_ffs/fsck_ffs.8
==============================================================================
--- stable/9/sbin/fsck_ffs/fsck_ffs.8	Wed Jul 10 14:11:51 2013	(r253154)
+++ stable/9/sbin/fsck_ffs/fsck_ffs.8	Wed Jul 10 14:13:37 2013	(r253155)
@@ -38,7 +38,7 @@
 .Nd file system consistency check and interactive repair
 .Sh SYNOPSIS
 .Nm
-.Op Fl BEFfnpry
+.Op Fl BEFfnpryZ
 .Op Fl b Ar block
 .Op Fl c Ar level
 .Op Fl m Ar mode
@@ -275,6 +275,15 @@ Assume a yes response to all questions a
 .Nm ;
 this should be used with great caution as this is a free license
 to continue after essentially unlimited trouble has been encountered.
+.It Fl Z
+Similar to
+.Fl E ,
+but overwrites unused blocks with zeroes.
+If both
+.Fl E
+and
+.Fl Z
+are specified, blocks are first zeroed and then erased.
 .El
 .Pp
 Inconsistencies checked are as follows:

Modified: stable/9/sbin/fsck_ffs/fsutil.c
==============================================================================
--- stable/9/sbin/fsck_ffs/fsutil.c	Wed Jul 10 14:11:51 2013	(r253154)
+++ stable/9/sbin/fsck_ffs/fsutil.c	Wed Jul 10 14:13:37 2013	(r253155)
@@ -617,6 +617,35 @@ blerase(int fd, ufs2_daddr_t blk, long s
 	return;
 }
 
+void
+blzero(int fd, ufs2_daddr_t blk, long size)
+{
+	static char *zero;
+	off_t offset, len;
+
+	if (fd < 0)
+		return;
+	len = ZEROBUFSIZE;
+	if (zero == NULL) {
+		zero = calloc(len, 1);
+		if (zero == NULL)
+			errx(EEXIT, "cannot allocate buffer pool");
+	}
+	offset = blk * dev_bsize;
+	if (lseek(fd, offset, 0) < 0)
+		rwerror("SEEK BLK", blk);
+	while (size > 0) {
+		if (size > len)
+			size = len;
+		else
+			len = size;
+		if (write(fd, zero, len) != len)
+			rwerror("WRITE BLK", blk);
+		blk += len / dev_bsize;
+		size -= len;
+	}
+}
+
 /*
  * Verify cylinder group's magic number and other parameters.  If the
  * test fails, offer an option to rebuild the whole cylinder group.

Modified: stable/9/sbin/fsck_ffs/main.c
==============================================================================
--- stable/9/sbin/fsck_ffs/main.c	Wed Jul 10 14:11:51 2013	(r253154)
+++ stable/9/sbin/fsck_ffs/main.c	Wed Jul 10 14:13:37 2013	(r253155)
@@ -82,7 +82,7 @@ main(int argc, char *argv[])
 	sync();
 	skipclean = 1;
 	inoopt = 0;
-	while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npry")) != -1) {
+	while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npryZ")) != -1) {
 		switch (ch) {
 		case 'b':
 			skipclean = 0;
@@ -147,6 +147,10 @@ main(int argc, char *argv[])
 			nflag = 0;
 			break;
 
+		case 'Z':
+			Zflag++;
+			break;
+
 		default:
 			usage();
 		}

Modified: stable/9/sbin/fsck_ffs/pass5.c
==============================================================================
--- stable/9/sbin/fsck_ffs/pass5.c	Wed Jul 10 14:11:51 2013	(r253154)
+++ stable/9/sbin/fsck_ffs/pass5.c	Wed Jul 10 14:13:37 2013	(r253155)
@@ -252,7 +252,7 @@ pass5(void)
 			frags = 0;
 			for (j = 0; j < fs->fs_frag; j++) {
 				if (testbmap(d + j)) {
-					if (Eflag && start != -1) {
+					if ((Eflag || Zflag) && start != -1) {
 						clear_blocks(start, d + j - 1);
 						start = -1;
 					}
@@ -274,7 +274,7 @@ pass5(void)
 				ffs_fragacct(fs, blk, newcg->cg_frsum, 1);
 			}
 		}
-		if (Eflag && start != -1)
+		if ((Eflag || Zflag) && start != -1)
 			clear_blocks(start, d - 1);
 		if (fs->fs_contigsumsize > 0) {
 			int32_t *sump = cg_clustersum(newcg);
@@ -581,11 +581,16 @@ check_maps(
 	}
 }
 
-static void clear_blocks(ufs2_daddr_t start, ufs2_daddr_t end)
+static void
+clear_blocks(ufs2_daddr_t start, ufs2_daddr_t end)
 {
 
 	if (debug)
 		printf("Zero frags %jd to %jd\n", start, end);
-	blerase(fswritefd, fsbtodb(&sblock, start),
-	    lfragtosize(&sblock, end - start + 1));
+	if (Zflag)
+		blzero(fswritefd, fsbtodb(&sblock, start),
+		    lfragtosize(&sblock, end - start + 1));
+	if (Eflag)
+		blerase(fswritefd, fsbtodb(&sblock, start),
+		    lfragtosize(&sblock, end - start + 1));
 }

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 14:14:49 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 0211B4D8;
 Wed, 10 Jul 2013 14:14:49 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id E6D9A1089;
 Wed, 10 Jul 2013 14:14:48 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AEEmlf061365;
 Wed, 10 Jul 2013 14:14:48 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AEEmGx061361;
 Wed, 10 Jul 2013 14:14:48 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201307101414.r6AEEmGx061361@svn.freebsd.org>
From: Dag-Erling Smørgrav 
Date: Wed, 10 Jul 2013 14:14:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253156 - stable/9/usr.sbin/jls
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 14:14:49 -0000

Author: des
Date: Wed Jul 10 14:14:48 2013
New Revision: 253156
URL: http://svnweb.freebsd.org/changeset/base/253156

Log:
  MFH (r250736): add -N option to list jail name instead of number

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

Modified: stable/9/usr.sbin/jls/jls.8
==============================================================================
--- stable/9/usr.sbin/jls/jls.8	Wed Jul 10 14:13:37 2013	(r253155)
+++ stable/9/usr.sbin/jls/jls.8	Wed Jul 10 14:14:48 2013	(r253156)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 8, 2009
+.Dd July 20, 2012
 .Dt JLS 8
 .Os
 .Sh NAME
@@ -33,7 +33,7 @@
 .Nd "list jails"
 .Sh SYNOPSIS
 .Nm
-.Op Fl dhnqsv
+.Op Fl dhNnqsv
 .Op Fl j Ar jail
 .Op Ar parameter ...
 .Sh DESCRIPTION
@@ -71,6 +71,10 @@ Print a header line containing the param
 If no parameters are given on the command line,
 .Va all
 is assumed.
+.It Fl N
+In the standard display mode, print each jail's name instead of its
+numeric ID.
+If the jail does not have a name, the numeric ID is printed instead.
 .It Fl n
 Print parameters in
 .Dq name=value

Modified: stable/9/usr.sbin/jls/jls.c
==============================================================================
--- stable/9/usr.sbin/jls/jls.c	Wed Jul 10 14:13:37 2013	(r253155)
+++ stable/9/usr.sbin/jls/jls.c	Wed Jul 10 14:14:48 2013	(r253156)
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
 #define	PRINT_QUOTED	0x08
 #define	PRINT_SKIP	0x10
 #define	PRINT_VERBOSE	0x20
+#define	PRINT_JAIL_NAME	0x40
 
 static struct jailparam *params;
 static int *param_parent;
@@ -82,7 +83,7 @@ main(int argc, char **argv)
 
 	jname = NULL;
 	pflags = jflags = jid = 0;
-	while ((c = getopt(argc, argv, "adj:hnqsv")) >= 0)
+	while ((c = getopt(argc, argv, "adj:hNnqsv")) >= 0)
 		switch (c) {
 		case 'a':
 		case 'd':
@@ -99,6 +100,9 @@ main(int argc, char **argv)
 			pflags = (pflags & ~(PRINT_SKIP | PRINT_VERBOSE)) |
 			    PRINT_HEADER;
 			break;
+		case 'N':
+			pflags |= PRINT_JAIL_NAME;
+			break;
 		case 'n':
 			pflags = (pflags & ~PRINT_VERBOSE) | PRINT_NAMEVAL;
 			break;
@@ -115,7 +119,7 @@ main(int argc, char **argv)
 			    PRINT_VERBOSE;
 			break;
 		default:
-			errx(1, "usage: jls [-dhnqv] [-j jail] [param ...]");
+			errx(1, "usage: jls [-dhNnqv] [-j jail] [param ...]");
 		}
 
 #ifdef INET6
@@ -149,7 +153,10 @@ main(int argc, char **argv)
 #endif
 		} else {
 			pflags |= PRINT_DEFAULT;
-			add_param("jid", NULL, (size_t)0, NULL, JP_USER);
+			if (pflags & PRINT_JAIL_NAME)
+				add_param("name", NULL, (size_t)0, NULL, JP_USER);
+			else
+				add_param("jid", NULL, (size_t)0, NULL, JP_USER);
 #ifdef INET
 			if (ip4_ok)
 				add_param("ip4.addr", NULL, (size_t)0, NULL,
@@ -192,8 +199,12 @@ main(int argc, char **argv)
 		       "        CPUSetID\n"
 		       "        IP Address(es)\n");
 	else if (pflags & PRINT_DEFAULT)
-		printf("   JID  IP Address      "
-		       "Hostname                      Path\n");
+		if (pflags & PRINT_JAIL_NAME)
+			printf(" JID             IP Address      "
+			    "Hostname                      Path\n");
+		else
+			printf("   JID  IP Address      "
+			    "Hostname                      Path\n");
 	else if (pflags & PRINT_HEADER) {
 		for (i = spc = 0; i < nparams; i++)
 			if (params[i].jp_flags & JP_USER) {
@@ -397,9 +408,12 @@ print_jail(int pflags, int jflags)
 			n++;
 		}
 #endif
-	} else if (pflags & PRINT_DEFAULT)
-		printf("%6d  %-15.15s %-29.29s %.74s\n",
-		    *(int *)params[0].jp_value,
+	} else if (pflags & PRINT_DEFAULT) {
+		if (pflags & PRINT_JAIL_NAME)
+			printf(" %-15s ", (char *)params[0].jp_value);
+		else
+			printf("%6d  ", *(int *)params[0].jp_value);
+		printf("%-15.15s %-29.29s %.74s\n",
 #ifdef INET
 		    (!ip4_ok || params[1].jp_valuelen == 0) ? "-"
 		    : inet_ntoa(*(struct in_addr *)params[1].jp_value),
@@ -410,7 +424,7 @@ print_jail(int pflags, int jflags)
 		    (char *)params[1].jp_value,
 		    (char *)params[2].jp_value);
 #endif
-	else {
+	} else {
 		param_values = alloca(nparams * sizeof(*param_values));
 		for (i = 0; i < nparams; i++) {
 			if (!(params[i].jp_flags & JP_USER))

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 14:16:40 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 40117639;
 Wed, 10 Jul 2013 14:16:40 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 31F3610A2;
 Wed, 10 Jul 2013 14:16:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AEGeta061662;
 Wed, 10 Jul 2013 14:16:40 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AEGeW6061661;
 Wed, 10 Jul 2013 14:16:40 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201307101416.r6AEGeW6061661@svn.freebsd.org>
From: Dag-Erling Smørgrav 
Date: Wed, 10 Jul 2013 14:16:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253157 - stable/9/usr.sbin/pw
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 14:16:40 -0000

Author: des
Date: Wed Jul 10 14:16:39 2013
New Revision: 253157
URL: http://svnweb.freebsd.org/changeset/base/253157

Log:
  MFH (r252556): allow setting expiry to current date / time
  MFH (r252688): fall back to sha512 if passwd_format is not set

Modified:
  stable/9/usr.sbin/pw/pw_user.c
Directory Properties:
  stable/9/usr.sbin/pw/   (props changed)

Modified: stable/9/usr.sbin/pw/pw_user.c
==============================================================================
--- stable/9/usr.sbin/pw/pw_user.c	Wed Jul 10 14:14:48 2013	(r253156)
+++ stable/9/usr.sbin/pw/pw_user.c	Wed Jul 10 14:16:39 2013	(r253157)
@@ -494,8 +494,6 @@ pw_user(struct userconf * cnf, int mode,
 				time_t          now = time(NULL);
 				time_t          expire = parse_date(now, arg->val);
 
-				if (now == expire)
-					errx(EX_DATAERR, "invalid password change date `%s'", arg->val);
 				if (pwd->pw_change != expire) {
 					pwd->pw_change = expire;
 					edited = 1;
@@ -514,8 +512,6 @@ pw_user(struct userconf * cnf, int mode,
 				time_t          now = time(NULL);
 				time_t          expire = parse_date(now, arg->val);
 
-				if (now == expire)
-					errx(EX_DATAERR, "invalid account expiry date `%s'", arg->val);
 				if (pwd->pw_expire != expire) {
 					pwd->pw_expire = expire;
 					edited = 1;
@@ -558,7 +554,7 @@ pw_user(struct userconf * cnf, int mode,
 
 			lc = login_getpwclass(pwd);
 			if (lc == NULL ||
-			    login_setcryptfmt(lc, "md5", NULL) == NULL)
+			    login_setcryptfmt(lc, "sha512", NULL) == NULL)
 				warn("setting crypt(3) format");
 			login_close(lc);
 			pwd->pw_passwd = pw_password(cnf, args, pwd->pw_name);

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 14:49:22 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id AC9B5DB;
 Wed, 10 Jul 2013 14:49:22 +0000 (UTC) (envelope-from alc@rice.edu)
Received: from pp1.rice.edu (proofpoint1.mail.rice.edu [128.42.201.100])
 by mx1.freebsd.org (Postfix) with ESMTP id 7E88012A3;
 Wed, 10 Jul 2013 14:49:21 +0000 (UTC)
Received: from pps.filterd (pp1.rice.edu [127.0.0.1])
 by pp1.rice.edu (8.14.5/8.14.5) with SMTP id r6A9xaeB028775;
 Wed, 10 Jul 2013 09:49:21 -0500
Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30])
 by pp1.rice.edu with ESMTP id 1ddpxdsyvw-1;
 Wed, 10 Jul 2013 09:49:20 -0500
X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel
Received: from [192.168.5.238] (unknown [12.107.116.132])
 (using TLSv1 with cipher RC4-MD5 (128/128 bits))
 (No client certificate requested) (Authenticated sender: alc)
 by mh11.mail.rice.edu (Postfix) with ESMTPSA id 162C04C0A0A;
 Wed, 10 Jul 2013 09:49:19 -0500 (CDT)
Subject: Re: svn commit: r253140 - head/sys/amd64/amd64
Mime-Version: 1.0 (Apple Message framework v1085)
Content-Type: text/plain; charset=us-ascii
From: Alan Cox 
In-Reply-To: <201307100924.r6A9O3Br070468@svn.freebsd.org>
Date: Wed, 10 Jul 2013 07:49:18 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201307100924.r6A9O3Br070468@svn.freebsd.org>
To: Konstantin Belousov 
X-Mailer: Apple Mail (2.1085)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 14:49:22 -0000

On Jul 10, 2013, at 2:24 AM, Konstantin Belousov wrote:

> Author: kib
> Date: Wed Jul 10 09:24:03 2013
> New Revision: 253140
> URL: http://svnweb.freebsd.org/changeset/base/253140
>=20
> Log:
>  Clear m->object for the page taken from the delayed free list for
>  reuse as the pv chink page in reclaim_pv_chunk().  Having non-NULL
>  m->object is wrong for page not owned by an object and confuses both
>  vm_page_free_toq() and vm_page_remove() when the page is freed later.
>=20
>  Reported and tested by:	pho
>  Sponsored by:	The FreeBSD Foundation
>  MFC after:	3 days
>=20


This problem only exists in HEAD.  Older branches don't abuse the object =
field for this purpose.  They use one of the splay tree pointers that =
were eliminated from HEAD with the introduction of the radix tree.  On =
the other hand, the same problem must exist in HEAD's i386 pmap.  As an =
aside, I think it's better to abuse the page's pageq field rather its =
object field.


> Modified:
>  head/sys/amd64/amd64/pmap.c
>=20
> Modified: head/sys/amd64/amd64/pmap.c
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/sys/amd64/amd64/pmap.c	Wed Jul 10 08:21:09 2013	=
(r253139)
> +++ head/sys/amd64/amd64/pmap.c	Wed Jul 10 09:24:03 2013	=
(r253140)
> @@ -2234,6 +2234,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, str
> 	if (m_pc =3D=3D NULL && free !=3D NULL) {
> 		m_pc =3D free;
> 		free =3D (void *)m_pc->object;
> +		m_pc->object =3D NULL;
> 		/* Recycle a freed page table page. */
> 		m_pc->wire_count =3D 1;
> 		atomic_add_int(&cnt.v_wire_count, 1);
>=20


From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 15:19:36 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id D4613D51;
 Wed, 10 Jul 2013 15:19:36 +0000 (UTC)
 (envelope-from rpaulo@FreeBSD.org)
Received: from felyko.com (felyko.com [174.136.100.2])
 by mx1.freebsd.org (Postfix) with ESMTP id C17FB1685;
 Wed, 10 Jul 2013 15:19:36 +0000 (UTC)
Received: from [IPv6:2601:9:4d00:119:4d7e:a08:33f5:87dc] (unknown
 [IPv6:2601:9:4d00:119:4d7e:a08:33f5:87dc])
 (using TLSv1 with cipher AES128-SHA (128/128 bits))
 (No client certificate requested)
 by felyko.com (Postfix) with ESMTPSA id CAAC43982B;
 Wed, 10 Jul 2013 08:19:35 -0700 (PDT)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\))
Subject: Re: svn commit: r253139 - in head: share/doc/legal
 share/doc/legal/realtek sys/conf sys/contrib/dev/urtwn sys/dev/usb/wlan
 sys/modules/usb/urtwnfw sys/modules/usb/urtwnfw/urtwnrtl8192cT
 sys/modules/usb...
From: Rui Paulo 
In-Reply-To: <201307100821.r6A8LADo052432@svn.freebsd.org>
Date: Wed, 10 Jul 2013 08:19:35 -0700
Content-Transfer-Encoding: 7bit
Message-Id: 
References: <201307100821.r6A8LADo052432@svn.freebsd.org>
To: Hiren Panchasara 
X-Mailer: Apple Mail (2.1508)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 15:19:36 -0000

On 10 Jul 2013, at 01:21, Hiren Panchasara  wrote:

> Author: hiren
> Date: Wed Jul 10 08:21:09 2013
> New Revision: 253139
> URL: http://svnweb.freebsd.org/changeset/base/253139
> 
> Log:
>  Adding urtwn(4) firmware and related changes.
> 
>  Reviewed by:	rpaulo
>  Approved by:	sbruno (mentor)


Approved by: core

--
Rui Paulo


From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 15:35:26 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 0B2E0595;
 Wed, 10 Jul 2013 15:35:26 +0000 (UTC)
 (envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id E217E17C6;
 Wed, 10 Jul 2013 15:35:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AFZPCM085209;
 Wed, 10 Jul 2013 15:35:25 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AFZPY2085207;
 Wed, 10 Jul 2013 15:35:25 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201307101535.r6AFZPY2085207@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 10 Jul 2013 15:35:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253158 - in head/sys: kern sys
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 15:35:26 -0000

Author: marcel
Date: Wed Jul 10 15:35:25 2013
New Revision: 253158
URL: http://svnweb.freebsd.org/changeset/base/253158

Log:
  Add vfs_mounted and vfs_unmounted events so that components can be informed
  about mount and unmount events. This is used by Juniper to implement a more
  optimal implementation of NetBSD's veriexec.
  
  This change differs from r253224 in the following way:
  o   The vfs_mounted handler is called before mountcheckdirs() and with
      newdp locked. vp is unlocked.
  o   The event handlers are declared in  and not in
      . The  header is used in user land code
      that pretends to be kernel code and as such creates a very convoluted
      environment. It's hard to untangle.
  
  Submitted by:	stevek@juniper.net
  Discussed with:	pjd@
  Obtained from:	Juniper Networks, Inc.

Modified:
  head/sys/kern/vfs_mount.c
  head/sys/sys/eventhandler.h

Modified: head/sys/kern/vfs_mount.c
==============================================================================
--- head/sys/kern/vfs_mount.c	Wed Jul 10 14:16:39 2013	(r253157)
+++ head/sys/kern/vfs_mount.c	Wed Jul 10 15:35:25 2013	(r253158)
@@ -861,8 +861,9 @@ vfs_domount_first(
 	vfs_event_signal(NULL, VQ_MOUNT, 0);
 	if (VFS_ROOT(mp, LK_EXCLUSIVE, &newdp))
 		panic("mount: lost mount");
-	VOP_UNLOCK(newdp, 0);
 	VOP_UNLOCK(vp, 0);
+	EVENTHANDLER_INVOKE(vfs_mounted, mp, newdp, td);
+	VOP_UNLOCK(newdp, 0);
 	mountcheckdirs(vp, newdp);
 	vrele(newdp);
 	if ((mp->mnt_flag & MNT_RDONLY) == 0)
@@ -1355,6 +1356,7 @@ dounmount(mp, flags, td)
 	mtx_lock(&mountlist_mtx);
 	TAILQ_REMOVE(&mountlist, mp, mnt_list);
 	mtx_unlock(&mountlist_mtx);
+	EVENTHANDLER_INVOKE(vfs_unmounted, mp, td);
 	if (coveredvp != NULL) {
 		coveredvp->v_mountedhere = NULL;
 		vput(coveredvp);

Modified: head/sys/sys/eventhandler.h
==============================================================================
--- head/sys/sys/eventhandler.h	Wed Jul 10 14:16:39 2013	(r253157)
+++ head/sys/sys/eventhandler.h	Wed Jul 10 15:35:25 2013	(r253158)
@@ -192,6 +192,17 @@ EVENTHANDLER_DECLARE(vm_lowmem, vm_lowme
 typedef void (*mountroot_handler_t)(void *);
 EVENTHANDLER_DECLARE(mountroot, mountroot_handler_t);
 
+/* File system mount events */
+struct mount;
+struct vnode;
+struct thread;
+typedef void (*vfs_mounted_notify_fn)(void *, struct mount *, struct vnode *,
+    struct thread *);
+typedef void (*vfs_unmounted_notify_fn)(void *, struct mount *,
+    struct thread *);
+EVENTHANDLER_DECLARE(vfs_mounted, vfs_mounted_notify_fn);
+EVENTHANDLER_DECLARE(vfs_unmounted, vfs_unmounted_notify_fn);
+
 /* VLAN state change events */
 struct ifnet;
 typedef void (*vlan_config_fn)(void *, struct ifnet *, uint16_t);
@@ -231,7 +242,6 @@ EVENTHANDLER_DECLARE(process_exec, execl
 /*
  * application dump event
  */
-struct thread;
 typedef void (*app_coredump_start_fn)(void *, struct thread *, char *name);
 typedef void (*app_coredump_progress_fn)(void *, struct thread *td, int byte_count);
 typedef void (*app_coredump_finish_fn)(void *, struct thread *td);

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 15:51:14 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 1F966D31;
 Wed, 10 Jul 2013 15:51:14 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 by mx1.freebsd.org (Postfix) with ESMTP id F09E3198C;
 Wed, 10 Jul 2013 15:51:13 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 722A8B988;
 Wed, 10 Jul 2013 11:51:12 -0400 (EDT)
From: John Baldwin 
To: David Chisnall 
Subject: Re: svn commit: r253149 - head/usr.bin/dtc
Date: Wed, 10 Jul 2013 11:40:12 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; )
References: <201307101057.r6AAv97Q097966@svn.freebsd.org>
In-Reply-To: <201307101057.r6AAv97Q097966@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201307101140.12438.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Wed, 10 Jul 2013 11:51:12 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 15:51:14 -0000

On Wednesday, July 10, 2013 6:57:09 am David Chisnall wrote:
> Author: theraven
> Date: Wed Jul 10 10:57:09 2013
> New Revision: 253149
> URL: http://svnweb.freebsd.org/changeset/base/253149
> 
> Log:
>   Report error for out-of-range numerical inputs.  Requested by brooks.
> 
> Modified:
>   head/usr.bin/dtc/fdt.cc
> 
> Modified: head/usr.bin/dtc/fdt.cc
> 
==============================================================================
> --- head/usr.bin/dtc/fdt.cc	Wed Jul 10 10:51:12 2013	(r253148)
> +++ head/usr.bin/dtc/fdt.cc	Wed Jul 10 10:57:09 2013	(r253149)
> @@ -30,6 +30,8 @@
>   * $FreeBSD$
>   */
>  
> +#define __STDC_LIMIT_MACROS 1
> +

Hmm, would it be better to use a newer -std= instead?

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 16:28:26 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 3A86CC25;
 Wed, 10 Jul 2013 16:28:26 +0000 (UTC)
 (envelope-from theraven@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 2C2EB1C0F;
 Wed, 10 Jul 2013 16:28:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AGSQw5000483;
 Wed, 10 Jul 2013 16:28:26 GMT
 (envelope-from theraven@svn.freebsd.org)
Received: (from theraven@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AGSO8r000471;
 Wed, 10 Jul 2013 16:28:24 GMT
 (envelope-from theraven@svn.freebsd.org)
Message-Id: <201307101628.r6AGSO8r000471@svn.freebsd.org>
From: David Chisnall 
Date: Wed, 10 Jul 2013 16:28:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253159 - in head/contrib: libc++/include libc++/src
 libcxxrt
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 16:28:26 -0000

Author: theraven
Date: Wed Jul 10 16:28:24 2013
New Revision: 253159
URL: http://svnweb.freebsd.org/changeset/base/253159

Log:
  Import new libcxxrt / libc++.  This brings some bug fixes, including a potential race condition for static initialisers.

Modified:
  head/contrib/libc++/include/__bit_reference
  head/contrib/libc++/include/__config
  head/contrib/libc++/include/__functional_base
  head/contrib/libc++/include/__hash_table
  head/contrib/libc++/include/__locale
  head/contrib/libc++/include/__split_buffer
  head/contrib/libc++/include/__std_stream
  head/contrib/libc++/include/__tree
  head/contrib/libc++/include/algorithm
  head/contrib/libc++/include/atomic
  head/contrib/libc++/include/deque
  head/contrib/libc++/include/forward_list
  head/contrib/libc++/include/functional
  head/contrib/libc++/include/future
  head/contrib/libc++/include/istream
  head/contrib/libc++/include/iterator
  head/contrib/libc++/include/list
  head/contrib/libc++/include/locale
  head/contrib/libc++/include/map
  head/contrib/libc++/include/memory
  head/contrib/libc++/include/random
  head/contrib/libc++/include/regex
  head/contrib/libc++/include/string
  head/contrib/libc++/include/type_traits
  head/contrib/libc++/include/unordered_map
  head/contrib/libc++/include/utility
  head/contrib/libc++/include/vector
  head/contrib/libc++/src/debug.cpp
  head/contrib/libc++/src/hash.cpp
  head/contrib/libc++/src/iostream.cpp
  head/contrib/libc++/src/locale.cpp
  head/contrib/libc++/src/stdexcept.cpp
  head/contrib/libc++/src/string.cpp
  head/contrib/libc++/src/thread.cpp
  head/contrib/libcxxrt/atomic.h
  head/contrib/libcxxrt/auxhelper.cc
  head/contrib/libcxxrt/cxxabi.h
  head/contrib/libcxxrt/dwarf_eh.h
  head/contrib/libcxxrt/exception.cc
  head/contrib/libcxxrt/guard.cc
  head/contrib/libcxxrt/memory.cc
Directory Properties:
  head/contrib/libc++/   (props changed)
  head/contrib/libcxxrt/   (props changed)

Modified: head/contrib/libc++/include/__bit_reference
==============================================================================
--- head/contrib/libc++/include/__bit_reference	Wed Jul 10 15:35:25 2013	(r253158)
+++ head/contrib/libc++/include/__bit_reference	Wed Jul 10 16:28:24 2013	(r253159)
@@ -333,7 +333,7 @@ __fill_n_false(__bit_iterator<_Cp, false
     }
     // do middle whole words
     __storage_type __nw = __n / __bits_per_word;
-    _VSTD::memset(__first.__seg_, 0, __nw * sizeof(__storage_type));
+    _VSTD::memset(_VSTD::__to_raw_pointer(__first.__seg_), 0, __nw * sizeof(__storage_type));
     __n -= __nw * __bits_per_word;
     // do last partial word
     if (__n > 0)
@@ -363,7 +363,7 @@ __fill_n_true(__bit_iterator<_Cp, false>
     }
     // do middle whole words
     __storage_type __nw = __n / __bits_per_word;
-    _VSTD::memset(__first.__seg_, -1, __nw * sizeof(__storage_type));
+    _VSTD::memset(_VSTD::__to_raw_pointer(__first.__seg_), -1, __nw * sizeof(__storage_type));
     __n -= __nw * __bits_per_word;
     // do last partial word
     if (__n > 0)
@@ -430,7 +430,9 @@ __copy_aligned(__bit_iterator<_Cp, _IsCo
         // __first.__ctz_ == 0;
         // do middle words
         __storage_type __nw = __n / __bits_per_word;
-        _VSTD::memmove(__result.__seg_, __first.__seg_, __nw * sizeof(__storage_type));
+        _VSTD::memmove(_VSTD::__to_raw_pointer(__result.__seg_),
+                       _VSTD::__to_raw_pointer(__first.__seg_),
+                       __nw * sizeof(__storage_type));
         __n -= __nw * __bits_per_word;
         __result.__seg_ += __nw;
         // do last word
@@ -569,7 +571,9 @@ __copy_backward_aligned(__bit_iterator<_
         __storage_type __nw = __n / __bits_per_word;
         __result.__seg_ -= __nw;
         __last.__seg_ -= __nw;
-        _VSTD::memmove(__result.__seg_, __last.__seg_, __nw * sizeof(__storage_type));
+        _VSTD::memmove(_VSTD::__to_raw_pointer(__result.__seg_),
+                       _VSTD::__to_raw_pointer(__last.__seg_),
+                       __nw * sizeof(__storage_type));
         __n -= __nw * __bits_per_word;
         // do last word
         if (__n > 0)
@@ -870,6 +874,7 @@ struct __bit_array
 {
     typedef typename _Cp::difference_type difference_type;
     typedef typename _Cp::__storage_type  __storage_type;
+    typedef typename _Cp::__storage_pointer __storage_pointer;
     typedef typename _Cp::iterator        iterator;
     static const unsigned __bits_per_word = _Cp::__bits_per_word;
     static const unsigned _Np = 4;
@@ -880,9 +885,15 @@ struct __bit_array
     _LIBCPP_INLINE_VISIBILITY static difference_type capacity()
         {return static_cast(_Np * __bits_per_word);}
     _LIBCPP_INLINE_VISIBILITY explicit __bit_array(difference_type __s) : __size_(__s) {}
-    _LIBCPP_INLINE_VISIBILITY iterator begin() {return iterator(__word_, 0);}
-    _LIBCPP_INLINE_VISIBILITY iterator end()   {return iterator(__word_ + __size_ / __bits_per_word,
-                                                  static_cast(__size_ % __bits_per_word));}
+    _LIBCPP_INLINE_VISIBILITY iterator begin()
+    {
+        return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]), 0);
+    }
+    _LIBCPP_INLINE_VISIBILITY iterator end()
+    {
+        return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]) + __size_ / __bits_per_word,
+                                                  static_cast(__size_ % __bits_per_word));
+    }
 };
 
 template 

Modified: head/contrib/libc++/include/__config
==============================================================================
--- head/contrib/libc++/include/__config	Wed Jul 10 15:35:25 2013	(r253158)
+++ head/contrib/libc++/include/__config	Wed Jul 10 16:28:24 2013	(r253159)
@@ -56,6 +56,18 @@
 # endif  // __LONG_LONG_SUPPORTED
 #endif  // __FreeBSD__
 
+#ifdef __NetBSD__
+# include 
+#  if _BYTE_ORDER == _LITTLE_ENDIAN
+#   define _LIBCPP_LITTLE_ENDIAN 1
+#   define _LIBCPP_BIG_ENDIAN    0
+# else  // _BYTE_ORDER == _LITTLE_ENDIAN
+#   define _LIBCPP_LITTLE_ENDIAN 0
+#   define _LIBCPP_BIG_ENDIAN    1
+# endif  // _BYTE_ORDER == _LITTLE_ENDIAN
+# define _LIBCPP_HAS_QUICK_EXIT
+#endif  // __NetBSD__
+
 #ifdef _WIN32
 #  define _LIBCPP_LITTLE_ENDIAN 1
 #  define _LIBCPP_BIG_ENDIAN    0
@@ -135,6 +147,10 @@
 
 #endif // _WIN32
 
+#ifndef __has_attribute
+#define __has_attribute(__x) 0
+#endif
+
 #ifndef _LIBCPP_HIDDEN
 #define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
 #endif
@@ -212,7 +228,9 @@ typedef __char32_t char32_t;
 #  define _LIBCPP_NORETURN __attribute__ ((noreturn))
 #endif
 
+#if !(__has_feature(cxx_defaulted_functions))
 #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#endif  // !(__has_feature(cxx_defaulted_functions))
 
 #if !(__has_feature(cxx_deleted_functions))
 #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
@@ -272,10 +290,20 @@ typedef __char32_t char32_t;
 #define _LIBCPP_HAS_NO_CONSTEXPR
 #endif
 
-#if defined(__FreeBSD__) && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L)
+#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
+#if defined(__FreeBSD__)
+#define _LIBCPP_HAS_QUICK_EXIT
+#define _LIBCPP_HAS_C11_FEATURES
+#elif defined(__linux__)
+#include 
+#if __GLIBC_PREREQ(2, 15)
 #define _LIBCPP_HAS_QUICK_EXIT
+#endif
+#if __GLIBC_PREREQ(2, 17)
 #define _LIBCPP_HAS_C11_FEATURES
 #endif
+#endif
+#endif
 
 #if (__has_feature(cxx_noexcept))
 #  define _NOEXCEPT noexcept
@@ -418,8 +446,14 @@ template  struct __static_asse
 #define _LIBCPP_CONSTEXPR constexpr
 #endif
 
+#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#define _LIBCPP_DEFAULT {}
+#else
+#define _LIBCPP_DEFAULT = default;
+#endif
+
 #ifdef __GNUC__
-#define _NOALIAS __attribute__((malloc))
+#define _NOALIAS __attribute__((__malloc__))
 #else
 #define _NOALIAS
 #endif
@@ -451,7 +485,7 @@ template  struct __static_asse
 #define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
 #endif
 
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__)
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__) || defined(__NetBSD__)
 #define _LIBCPP_LOCALE__L_EXTENSIONS 1
 #endif
 #ifdef __FreeBSD__
@@ -476,6 +510,14 @@ template  struct __static_asse
 #   endif
 #endif
 
+#ifndef _LIBCPP_STD_VER
+#  if  __cplusplus <= 201103L
+#    define _LIBCPP_STD_VER 11
+#  else
+#    define _LIBCPP_STD_VER 13  // current year, or date of c++14 ratification
+#  endif
+#endif  // _LIBCPP_STD_VER
+
 #ifdef _LIBCPP_DEBUG2
 #   include <__debug>
 #else

Modified: head/contrib/libc++/include/__functional_base
==============================================================================
--- head/contrib/libc++/include/__functional_base	Wed Jul 10 15:35:25 2013	(r253158)
+++ head/contrib/libc++/include/__functional_base	Wed Jul 10 16:28:24 2013	(r253159)
@@ -292,7 +292,8 @@ struct __weak_result_type<_Rp (_Cp::*)(_
 
 // bullets 1 and 2
 
-template 
+template 
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
@@ -301,7 +302,8 @@ __invoke(_Fp&& __f, _A0&& __a0, _Args&& 
     return (_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...);
 }
 
-template 
+template 
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
@@ -312,7 +314,8 @@ __invoke(_Fp&& __f, _A0&& __a0, _Args&& 
 
 // bullets 3 and 4
 
-template 
+template 
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_Fp&& __f, _A0&& __a0)
@@ -321,7 +324,8 @@ __invoke(_Fp&& __f, _A0&& __a0)
     return _VSTD::forward<_A0>(__a0).*__f;
 }
 
-template 
+template 
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_Fp&& __f, _A0&& __a0)

Modified: head/contrib/libc++/include/__hash_table
==============================================================================
--- head/contrib/libc++/include/__hash_table	Wed Jul 10 15:35:25 2013	(r253158)
+++ head/contrib/libc++/include/__hash_table	Wed Jul 10 16:28:24 2013	(r253159)
@@ -33,7 +33,6 @@ template 
 struct __hash_node_base
 {
     typedef __hash_node_base __first_node;
- //   typedef _NodePtr pointer;
 
     _NodePtr    __next_;
 
@@ -111,7 +110,7 @@ public:
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return _VSTD::addressof(__node_->__value_);}
+        pointer operator->() const {return pointer_traits::pointer_to(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_iterator& operator++()
@@ -189,7 +188,7 @@ public:
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return _VSTD::addressof(__node_->__value_);}
+        pointer operator->() const {return pointer_traits::pointer_to(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_const_iterator& operator++()
@@ -255,7 +254,7 @@ public:
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return &__node_->__value_;}
+        pointer operator->() const {return pointer_traits::pointer_to(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_local_iterator& operator++()
@@ -345,7 +344,7 @@ public:
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return &__node_->__value_;}
+        pointer operator->() const {return pointer_traits::pointer_to(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_const_local_iterator& operator++()
@@ -505,8 +504,15 @@ public:
                                                      __node_allocator;
     typedef allocator_traits<__node_allocator>       __node_traits;
     typedef typename __node_traits::pointer          __node_pointer;
-    typedef typename __node_traits::const_pointer    __node_const_pointer;
+    typedef typename __node_traits::pointer          __node_const_pointer;
     typedef __hash_node_base<__node_pointer>         __first_node;
+    typedef typename pointer_traits<__node_pointer>::template
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+            rebind<__first_node>
+#else
+            rebind<__first_node>::other
+#endif
+                                                     __node_base_pointer;
 
 private:
 
@@ -558,9 +564,9 @@ public:
 
 public:
     typedef __hash_iterator<__node_pointer>                   iterator;
-    typedef __hash_const_iterator<__node_const_pointer>       const_iterator;
+    typedef __hash_const_iterator<__node_pointer>             const_iterator;
     typedef __hash_local_iterator<__node_pointer>             local_iterator;
-    typedef __hash_const_local_iterator<__node_const_pointer> const_local_iterator;
+    typedef __hash_const_local_iterator<__node_pointer>       const_local_iterator;
 
     __hash_table()
         _NOEXCEPT_(
@@ -706,7 +712,7 @@ public:
 
     _LIBCPP_INLINE_VISIBILITY
     size_type max_bucket_count() const _NOEXCEPT
-        {return __bucket_list_.get_deleter().__alloc().max_size();}
+        {return __pointer_alloc_traits::max_size(__bucket_list_.get_deleter().__alloc());}
     size_type bucket_size(size_type __n) const;
     _LIBCPP_INLINE_VISIBILITY float load_factor() const _NOEXCEPT
     {
@@ -807,6 +813,9 @@ private:
 
     void __deallocate(__node_pointer __np) _NOEXCEPT;
     __node_pointer __detach() _NOEXCEPT;
+
+    template  friend class _LIBCPP_TYPE_VIS unordered_map;
+    template  friend class _LIBCPP_TYPE_VIS unordered_multimap;
 };
 
 template 
@@ -893,7 +902,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     if (size() > 0)
     {
         __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
-            static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
         __u.__p1_.first().__next_ = nullptr;
         __u.size() = 0;
     }
@@ -917,7 +926,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
             __p1_.first().__next_ = __u.__p1_.first().__next_;
             __u.__p1_.first().__next_ = nullptr;
             __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
-                static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+                static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
             size() = __u.size();
             __u.size() = 0;
         }
@@ -1014,7 +1023,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     if (size() > 0)
     {
         __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
-            static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
         __u.__p1_.first().__next_ = nullptr;
         __u.size() = 0;
     }
@@ -1236,7 +1245,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
         __node_pointer __pn = __bucket_list_[__chash];
         if (__pn == nullptr)
         {
-            __pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
             __nd->__next_ = __pn->__next_;
             __pn->__next_ = __nd;
             // fix up __bucket_list_
@@ -1274,7 +1283,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     __node_pointer __pn = __bucket_list_[__chash];
     if (__pn == nullptr)
     {
-        __pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+        __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
         __cp->__next_ = __pn->__next_;
         __pn->__next_ = __cp;
         // fix up __bucket_list_
@@ -1322,7 +1331,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
 {
     if (__p != end() && key_eq()(*__p, __cp->__value_))
     {
-        __node_pointer __np = const_cast<__node_pointer>(__p.__node_);
+        __node_pointer __np = __p.__node_;
         __cp->__hash_ = __np->__hash_;
         size_type __bc = bucket_count();
         if (size()+1 > __bc * max_load_factor() || __bc == 0)
@@ -1380,7 +1389,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
         __node_pointer __pn = __bucket_list_[__chash];
         if (__pn == nullptr)
         {
-            __pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
             __h->__next_ = __pn->__next_;
             __pn->__next_ = __h.get();
             // fix up __bucket_list_
@@ -1542,7 +1551,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     {
         for (size_type __i = 0; __i < __nbc; ++__i)
             __bucket_list_[__i] = nullptr;
-        __node_pointer __pp(static_cast<__node_pointer>(_VSTD::addressof(__p1_.first())));
+        __node_pointer __pp(static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first())));
         __node_pointer __cp = __pp->__next_;
         if (__cp != nullptr)
         {
@@ -1700,7 +1709,7 @@ template ::iterator
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p)
 {
-    __node_pointer __np = const_cast<__node_pointer>(__p.__node_);
+    __node_pointer __np = __p.__node_;
     iterator __r(__np);
     ++__r;
     remove(__p);
@@ -1717,7 +1726,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
         ++__first;
         erase(__p);
     }
-    __node_pointer __np = const_cast<__node_pointer>(__last.__node_);
+    __node_pointer __np = __last.__node_;
     return iterator (__np);
 }
 
@@ -1757,7 +1766,7 @@ typename __hash_table<_Tp, _Hash, _Equal
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
 {
     // current node
-    __node_pointer __cn = const_cast<__node_pointer>(__p.__node_);
+    __node_pointer __cn = __p.__node_;
     size_type __bc = bucket_count();
     size_t __chash = __constrain_hash(__cn->__hash_, __bc);
     // find previous node
@@ -1767,7 +1776,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     // Fix up __bucket_list_
         // if __pn is not in same bucket (before begin is not in same bucket) &&
         //    if __cn->__next_ is not in same bucket (nullptr is not in same bucket)
-    if (__pn == _VSTD::addressof(__p1_.first()) || __constrain_hash(__pn->__hash_, __bc) != __chash)
+    if (__pn == static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()))
+                            || __constrain_hash(__pn->__hash_, __bc) != __chash)
     {
         if (__cn->__next_ == nullptr || __constrain_hash(__cn->__next_->__hash_, __bc) != __chash)
             __bucket_list_[__chash] = nullptr;
@@ -1907,10 +1917,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     __p3_.swap(__u.__p3_);
     if (size() > 0)
         __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
-            static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
     if (__u.size() > 0)
         __u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash_, __u.bucket_count())] =
-            static_cast<__node_pointer>(_VSTD::addressof(__u.__p1_.first()));
+            static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__u.__p1_.first()));
 }
 
 template 

Modified: head/contrib/libc++/include/__locale
==============================================================================
--- head/contrib/libc++/include/__locale	Wed Jul 10 15:35:25 2013	(r253158)
+++ head/contrib/libc++/include/__locale	Wed Jul 10 16:28:24 2013	(r253159)
@@ -339,12 +339,12 @@ public:
     static const mask punct  = _PUNCT;
     static const mask xdigit = _HEX;
     static const mask blank  = _BLANK;
-#elif (defined(__APPLE__) || defined(__FreeBSD__)) || defined(EMSCRIPTEN)
+#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(EMSCRIPTEN) || defined(__NetBSD__)
 #ifdef __APPLE__
     typedef __uint32_t mask;
 #elif defined(__FreeBSD__)
     typedef unsigned long mask;
-#elif defined(EMSCRIPTEN)
+#elif defined(EMSCRIPTEN) ||  defined(__NetBSD__)
     typedef unsigned short mask;
 #endif
     static const mask space  = _CTYPE_S;
@@ -356,7 +356,11 @@ public:
     static const mask digit  = _CTYPE_D;
     static const mask punct  = _CTYPE_P;
     static const mask xdigit = _CTYPE_X;
+# if defined(__NetBSD__)
+    static const mask blank  = _CTYPE_BL;
+# else
     static const mask blank  = _CTYPE_B;
+# endif
 #elif defined(__sun__)
     typedef unsigned int mask;
     static const mask space  = _ISSPACE;
@@ -596,6 +600,10 @@ public:
     static const int* __classic_upper_table() _NOEXCEPT;
     static const int* __classic_lower_table() _NOEXCEPT;
 #endif
+#if defined(__NetBSD__)
+    static const short* __classic_upper_table() _NOEXCEPT;
+    static const short* __classic_lower_table() _NOEXCEPT;
+#endif
 
 protected:
     ~ctype();

Modified: head/contrib/libc++/include/__split_buffer
==============================================================================
--- head/contrib/libc++/include/__split_buffer	Wed Jul 10 15:35:25 2013	(r253158)
+++ head/contrib/libc++/include/__split_buffer	Wed Jul 10 16:28:24 2013	(r253159)
@@ -290,7 +290,7 @@ void
 __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type)
 {
     while (__begin_ != __new_begin)
-        __alloc_traits::destroy(__alloc(), __begin_++);
+        __alloc_traits::destroy(__alloc(), __to_raw_pointer(__begin_++));
 }
 
 template 
@@ -307,7 +307,7 @@ void
 __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT
 {
     while (__new_last != __end_)
-        __alloc_traits::destroy(__alloc(), --__end_);
+        __alloc_traits::destroy(__alloc(), __to_raw_pointer(--__end_));
 }
 
 template 
@@ -320,7 +320,7 @@ __split_buffer<_Tp, _Allocator>::__destr
 
 template 
 __split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a)
-    : __end_cap_(0, __a)
+    : __end_cap_(nullptr, __a)
 {
     __first_ = __cap != 0 ? __alloc_traits::allocate(__alloc(), __cap) : nullptr;
     __begin_ = __end_ = __first_ + __start;
@@ -331,21 +331,21 @@ template 
 _LIBCPP_INLINE_VISIBILITY inline
 __split_buffer<_Tp, _Allocator>::__split_buffer()
     _NOEXCEPT_(is_nothrow_default_constructible::value)
-    : __first_(0), __begin_(0), __end_(0), __end_cap_(0)
+    : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr)
 {
 }
 
 template 
 _LIBCPP_INLINE_VISIBILITY inline
 __split_buffer<_Tp, _Allocator>::__split_buffer(__alloc_rr& __a)
-    : __first_(0), __begin_(0), __end_(0), __end_cap_(0, __a)
+    : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
 {
 }
 
 template 
 _LIBCPP_INLINE_VISIBILITY inline
 __split_buffer<_Tp, _Allocator>::__split_buffer(const __alloc_rr& __a)
-    : __first_(0), __begin_(0), __end_(0), __end_cap_(0, __a)
+    : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
 {
 }
 

Modified: head/contrib/libc++/include/__std_stream
==============================================================================
--- head/contrib/libc++/include/__std_stream	Wed Jul 10 15:35:25 2013	(r253158)
+++ head/contrib/libc++/include/__std_stream	Wed Jul 10 16:28:24 2013	(r253159)
@@ -55,6 +55,8 @@ private:
     const codecvt* __cv_;
     state_type* __st_;
     int __encoding_;
+    int_type __last_consumed_;
+    bool __last_consumed_is_next_;
     bool __always_noconv_;
 
     __stdinbuf(const __stdinbuf&);
@@ -66,7 +68,9 @@ private:
 template 
 __stdinbuf<_CharT>::__stdinbuf(FILE* __fp, state_type* __st)
     : __file_(__fp),
-      __st_(__st)
+      __st_(__st),
+      __last_consumed_(traits_type::eof()),
+      __last_consumed_is_next_(false)
 {
     imbue(this->getloc());
 }
@@ -100,6 +104,16 @@ template 
 typename __stdinbuf<_CharT>::int_type
 __stdinbuf<_CharT>::__getchar(bool __consume)
 {
+    if (__last_consumed_is_next_)
+    {
+        int_type __result = __last_consumed_;
+        if (__consume)
+        {
+            __last_consumed_ = traits_type::eof();
+            __last_consumed_is_next_ = false;
+        }
+        return __result;
+    }
     char __extbuf[__limit];
     int __nread = _VSTD::max(1, __encoding_);
     for (int __i = 0; __i < __nread; ++__i)
@@ -154,6 +168,8 @@ __stdinbuf<_CharT>::__getchar(bool __con
                 return traits_type::eof();
         }
     }
+    else
+        __last_consumed_ = traits_type::to_int_type(__1buf);
     return traits_type::to_int_type(__1buf);
 }
 
@@ -162,28 +178,41 @@ typename __stdinbuf<_CharT>::int_type
 __stdinbuf<_CharT>::pbackfail(int_type __c)
 {
     if (traits_type::eq_int_type(__c, traits_type::eof()))
-        return __c;
-    char __extbuf[__limit];
-    char* __enxt;
-    const char_type __ci = traits_type::to_char_type(__c);
-    const char_type* __inxt;
-    switch (__cv_->out(*__st_, &__ci, &__ci + 1, __inxt,
-                              __extbuf, __extbuf + sizeof(__extbuf), __enxt))
     {
-    case _VSTD::codecvt_base::ok:
-        break;
-    case _VSTD::codecvt_base::noconv:
-        __extbuf[0] = static_cast(__c);
-        __enxt = __extbuf + 1;
-        break;
-    case codecvt_base::partial:
-    case codecvt_base::error:
-        return traits_type::eof();
+        if (!__last_consumed_is_next_)
+        {
+            __c = __last_consumed_;
+            __last_consumed_is_next_ = !traits_type::eq_int_type(__last_consumed_,
+                                                                 traits_type::eof());
+        }
+        return __c;
     }
-    while (__enxt > __extbuf)
-        if (ungetc(*--__enxt, __file_) == EOF)
+    if (__last_consumed_is_next_)
+    {
+        char __extbuf[__limit];
+        char* __enxt;
+        const char_type __ci = traits_type::to_char_type(__last_consumed_);
+        const char_type* __inxt;
+        switch (__cv_->out(*__st_, &__ci, &__ci + 1, __inxt,
+                                  __extbuf, __extbuf + sizeof(__extbuf), __enxt))
+        {
+        case _VSTD::codecvt_base::ok:
+            break;
+        case _VSTD::codecvt_base::noconv:
+            __extbuf[0] = static_cast(__last_consumed_);
+            __enxt = __extbuf + 1;
+            break;
+        case codecvt_base::partial:
+        case codecvt_base::error:
             return traits_type::eof();
- return traits_type::not_eof(__c);
+        }
+        while (__enxt > __extbuf)
+            if (ungetc(*--__enxt, __file_) == EOF)
+                return traits_type::eof();
+    }
+    __last_consumed_ = __c;
+    __last_consumed_is_next_ = true;
+    return __c;
 }
 
 // __stdoutbuf
@@ -234,30 +263,31 @@ __stdoutbuf<_CharT>::overflow(int_type _
     char_type __1buf;
     if (!traits_type::eq_int_type(__c, traits_type::eof()))
     {
-        this->setp(&__1buf, &__1buf+1);
-        *this->pptr() = traits_type::to_char_type(__c);
-        this->pbump(1);
+        __1buf = traits_type::to_char_type(__c);
         if (__always_noconv_)
         {
-            if (fwrite(this->pbase(), sizeof(char_type), 1, __file_) != 1)
+            if (fwrite(&__1buf, sizeof(char_type), 1, __file_) != 1)
                 return traits_type::eof();
         }
         else
         {
             char* __extbe = __extbuf;
             codecvt_base::result __r;
+            char_type* pbase = &__1buf;
+            char_type* pptr = pbase + 1;
+            char_type* epptr = pptr;
             do
             {
                 const char_type* __e;
-                __r = __cv_->out(*__st_, this->pbase(), this->pptr(), __e,
+                __r = __cv_->out(*__st_, pbase, pptr, __e,
                                         __extbuf,
                                         __extbuf + sizeof(__extbuf),
                                         __extbe);
-                if (__e == this->pbase())
+                if (__e == pbase)
                     return traits_type::eof();
                 if (__r == codecvt_base::noconv)
                 {
-                    if (fwrite(this->pbase(), 1, 1, __file_) != 1)
+                    if (fwrite(pbase, 1, 1, __file_) != 1)
                         return traits_type::eof();
                 }
                 else if (__r == codecvt_base::ok || __r == codecvt_base::partial)
@@ -267,15 +297,13 @@ __stdoutbuf<_CharT>::overflow(int_type _
                         return traits_type::eof();
                     if (__r == codecvt_base::partial)
                     {
-                        this->setp((char_type*)__e, this->pptr());
-                        this->pbump(static_cast(this->epptr() - this->pbase()));
+                        pbase = (char_type*)__e;
                     }
                 }
                 else
                     return traits_type::eof();
             } while (__r == codecvt_base::partial);
         }
-        this->setp(0, 0);
     }
     return traits_type::not_eof(__c);
 }

Modified: head/contrib/libc++/include/__tree
==============================================================================
--- head/contrib/libc++/include/__tree	Wed Jul 10 15:35:25 2013	(r253158)
+++ head/contrib/libc++/include/__tree	Wed Jul 10 16:28:24 2013	(r253159)
@@ -644,7 +644,8 @@ public:
     _LIBCPP_INLINE_VISIBILITY __tree_iterator() _NOEXCEPT {}
 
     _LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;}
-    _LIBCPP_INLINE_VISIBILITY pointer operator->() const {return &__ptr_->__value_;}
+    _LIBCPP_INLINE_VISIBILITY pointer operator->() const
+        {return pointer_traits::pointer_to(__ptr_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __tree_iterator& operator++()
@@ -686,7 +687,7 @@ class _LIBCPP_TYPE_VIS __tree_const_iter
 {
     typedef _ConstNodePtr                                         __node_pointer;
     typedef typename pointer_traits<__node_pointer>::element_type __node;
-    typedef const typename __node::base                           __node_base;
+    typedef typename __node::base                                 __node_base;
     typedef typename pointer_traits<__node_pointer>::template
 #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
             rebind<__node_base>
@@ -729,7 +730,8 @@ public:
         : __ptr_(__p.__ptr_) {}
 
     _LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;}
-    _LIBCPP_INLINE_VISIBILITY pointer operator->() const {return &__ptr_->__value_;}
+    _LIBCPP_INLINE_VISIBILITY pointer operator->() const
+        {return pointer_traits::pointer_to(__ptr_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __tree_const_iterator& operator++()
@@ -779,8 +781,10 @@ public:
     typedef typename __alloc_traits::size_type       size_type;
     typedef typename __alloc_traits::difference_type difference_type;
 
-    typedef __tree_node __node;
-    typedef __tree_node_base __node_base;
+    typedef typename __alloc_traits::void_pointer  __void_pointer;
+
+    typedef __tree_node __node;
+    typedef __tree_node_base<__void_pointer>        __node_base;
     typedef typename __alloc_traits::template
 #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
             rebind_alloc<__node>
@@ -790,9 +794,9 @@ public:
                                                      __node_allocator;
     typedef allocator_traits<__node_allocator>       __node_traits;
     typedef typename __node_traits::pointer          __node_pointer;
-    typedef typename __node_traits::const_pointer    __node_const_pointer;
+    typedef typename __node_traits::pointer          __node_const_pointer;
     typedef typename __node_base::pointer            __node_base_pointer;
-    typedef typename __node_base::const_pointer      __node_base_const_pointer;
+    typedef typename __node_base::pointer            __node_base_const_pointer;
 private:
     typedef typename __node_base::base __end_node_t;
     typedef typename pointer_traits<__node_pointer>::template
@@ -804,9 +808,9 @@ private:
                                                      __end_node_ptr;
     typedef typename pointer_traits<__node_pointer>::template
 #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-            rebind
+            rebind<__end_node_t>
 #else
-            rebind::other
+            rebind<__end_node_t>::other
 #endif
                                                      __end_node_const_ptr;
 
@@ -828,7 +832,7 @@ public:
     {
         return static_cast<__node_const_pointer>
                (
-                   pointer_traits<__end_node_const_ptr>::pointer_to(__pair1_.first())
+                   pointer_traits<__end_node_const_ptr>::pointer_to(const_cast<__end_node_t&>(__pair1_.first()))
                );
     }
     _LIBCPP_INLINE_VISIBILITY
@@ -865,7 +869,7 @@ public:
         {return static_cast<__node_const_pointer>(__end_node()->__left_);}
 
     typedef __tree_iterator             iterator;
-    typedef __tree_const_iterator const_iterator;
+    typedef __tree_const_iterator const_iterator;
 
     explicit __tree(const value_compare& __comp)
         _NOEXCEPT_(
@@ -1102,6 +1106,9 @@ private:
 
     __node_pointer __detach();
     static __node_pointer __detach(__node_pointer);
+
+    template  friend class _LIBCPP_TYPE_VIS map;
+    template  friend class _LIBCPP_TYPE_VIS multimap;
 };
 
 template 
@@ -1161,7 +1168,7 @@ __tree<_Tp, _Compare, _Allocator>::__det
 {
     if (__cache->__parent_ == nullptr)
         return nullptr;
-    if (__tree_is_left_child(__cache))
+    if (__tree_is_left_child(static_cast<__node_base_pointer>(__cache)))
     {
         __cache->__parent_->__left_ = nullptr;
         __cache = static_cast<__node_pointer>(__cache->__parent_);
@@ -1294,7 +1301,7 @@ __tree<_Tp, _Compare, _Allocator>::__tre
         __begin_node() = __end_node();
     else
     {
-        __end_node()->__left_->__parent_ = __end_node();
+        __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
         __t.__begin_node() = __t.__end_node();
         __t.__end_node()->__left_ = nullptr;
         __t.size() = 0;
@@ -1314,7 +1321,7 @@ __tree<_Tp, _Compare, _Allocator>::__tre
         {
             __begin_node() = __t.__begin_node();
             __end_node()->__left_ = __t.__end_node()->__left_;
-            __end_node()->__left_->__parent_ = __end_node();
+            __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
             size() = __t.size();
             __t.__begin_node() = __t.__end_node();
             __t.__end_node()->__left_ = nullptr;
@@ -1342,7 +1349,7 @@ __tree<_Tp, _Compare, _Allocator>::__mov
         __begin_node() = __end_node();
     else
     {
-        __end_node()->__left_->__parent_ = __end_node();
+        __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
         __t.__begin_node() = __t.__end_node();
         __t.__end_node()->__left_ = nullptr;
         __t.size() = 0;
@@ -1447,11 +1454,11 @@ __tree<_Tp, _Compare, _Allocator>::swap(
     if (size() == 0)
         __begin_node() = __end_node();
     else
-        __end_node()->__left_->__parent_ = __end_node();
+        __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
     if (__t.size() == 0)
         __t.__begin_node() = __t.__end_node();
     else
-        __t.__end_node()->__left_->__parent_ = __t.__end_node();
+        __t.__end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__t.__end_node());
 }
 
 template 
@@ -1483,7 +1490,7 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__right_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__right_;
                 }
             }
@@ -1493,13 +1500,13 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__left_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__left_;
                 }
             }
         }
     }
-    __parent = __end_node();
+    __parent = static_cast<__node_base_pointer>(__end_node());
     return __parent->__left_;
 }
 
@@ -1522,7 +1529,7 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__left_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__left_;
                 }
             }
@@ -1532,13 +1539,13 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__right_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__right_;
                 }
             }
         }
     }
-    __parent = __end_node();
+    __parent = static_cast<__node_base_pointer>(__end_node());
     return __parent->__left_;
 }
 
@@ -1563,12 +1570,12 @@ __tree<_Tp, _Compare, _Allocator>::__fin
             // *prev(__hint) <= __v <= *__hint
             if (__hint.__ptr_->__left_ == nullptr)
             {
-                __parent = const_cast<__node_pointer&>(__hint.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
                 return __parent->__left_;
             }
             else
             {
-                __parent = const_cast<__node_pointer&>(__prior.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__prior.__ptr_);
                 return __parent->__right_;
             }
         }
@@ -1600,7 +1607,7 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__left_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__left_;
                 }
             }
@@ -1610,18 +1617,18 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__right_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__right_;
                 }
             }
             else
             {
-                __parent = __nd;
+                __parent = static_cast<__node_base_pointer>(__nd);
                 return __parent;
             }
         }
     }
-    __parent = __end_node();
+    __parent = static_cast<__node_base_pointer>(__end_node());
     return __parent->__left_;
 }
 
@@ -1648,12 +1655,12 @@ __tree<_Tp, _Compare, _Allocator>::__fin
             // *prev(__hint) < __v < *__hint
             if (__hint.__ptr_->__left_ == nullptr)
             {
-                __parent = const_cast<__node_pointer&>(__hint.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
                 return __parent->__left_;
             }
             else
             {
-                __parent = const_cast<__node_pointer&>(__prior.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__prior.__ptr_);
                 return __parent->__right_;
             }
         }
@@ -1669,12 +1676,12 @@ __tree<_Tp, _Compare, _Allocator>::__fin
             // *__hint < __v < *_VSTD::next(__hint)
             if (__hint.__ptr_->__right_ == nullptr)
             {
-                __parent = const_cast<__node_pointer&>(__hint.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
                 return __parent->__right_;
             }
             else
             {
-                __parent = const_cast<__node_pointer&>(__next.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__next.__ptr_);
                 return __parent->__left_;
             }
         }
@@ -1682,7 +1689,7 @@ __tree<_Tp, _Compare, _Allocator>::__fin
         return __find_equal(__parent, __v);
     }
     // else __v == *__hint
-    __parent = const_cast<__node_pointer&>(__hint.__ptr_);
+    __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
     return __parent;
 }
 
@@ -1729,7 +1736,7 @@ __tree<_Tp, _Compare, _Allocator>::__emp
     bool __inserted = false;
     if (__child == nullptr)
     {
-        __insert_node_at(__parent, __child, __h.get());
+        __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
         __r = __h.release();
         __inserted = true;
     }
@@ -1747,7 +1754,7 @@ __tree<_Tp, _Compare, _Allocator>::__emp
     __node_pointer __r = static_cast<__node_pointer>(__child);
     if (__child == nullptr)
     {
-        __insert_node_at(__parent, __child, __h.get());
+        __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
         __r = __h.release();
     }
     return iterator(__r);
@@ -1761,7 +1768,7 @@ __tree<_Tp, _Compare, _Allocator>::__emp
     __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
     __node_base_pointer __parent;
     __node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_);
-    __insert_node_at(__parent, __child, __h.get());
+    __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
     return iterator(static_cast<__node_pointer>(__h.release()));
 }
 
@@ -1774,7 +1781,7 @@ __tree<_Tp, _Compare, _Allocator>::__emp
     __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);

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

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 17:16:11 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 97E0E4DC;
 Wed, 10 Jul 2013 17:16:11 +0000 (UTC)
 (envelope-from sbruno@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 6F6321EB2;
 Wed, 10 Jul 2013 17:16:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AHGBEb015627;
 Wed, 10 Jul 2013 17:16:11 GMT (envelope-from sbruno@svn.freebsd.org)
Received: (from sbruno@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AHGBK6015626;
 Wed, 10 Jul 2013 17:16:11 GMT (envelope-from sbruno@svn.freebsd.org)
Message-Id: <201307101716.r6AHGBK6015626@svn.freebsd.org>
From: Sean Bruno 
Date: Wed, 10 Jul 2013 17:16:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253160 - stable/9/sys/dev/ciss
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 17:16:11 -0000

Author: sbruno
Date: Wed Jul 10 17:16:10 2013
New Revision: 253160
URL: http://svnweb.freebsd.org/changeset/base/253160

Log:
  Jump on the 9.2r MFC bonanza and update ciss(4)
  
  r250031
   - zero a data structure for notifications
  
  r250022 r249977 r249947 r249908
   - handle cases of controllers advertising an sg_list of less than
     CISS_MAX_SG_ELEMENTS.  Fixes ciss(4) ZMR cases.

Modified:
  stable/9/sys/dev/ciss/ciss.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/ciss/ciss.c
==============================================================================
--- stable/9/sys/dev/ciss/ciss.c	Wed Jul 10 16:28:24 2013	(r253159)
+++ stable/9/sys/dev/ciss/ciss.c	Wed Jul 10 17:16:10 2013	(r253160)
@@ -2487,6 +2487,7 @@ ciss_preen_command(struct ciss_request *
     cc->header.sg_total = 0;
     cc->header.host_tag = cr->cr_tag << 2;
     cc->header.host_tag_zeroes = 0;
+    bzero(&(cc->sg[0]), CISS_COMMAND_ALLOC_SIZE - sizeof(struct ciss_command));
     cmdphys = cr->cr_ccphys;
     cc->error_info.error_info_address = cmdphys + sizeof(struct ciss_command);
     cc->error_info.error_info_length = CISS_COMMAND_ALLOC_SIZE - sizeof(struct ciss_command);
@@ -2985,6 +2986,7 @@ ciss_cam_action(struct cam_sim *sim, uni
     case XPT_PATH_INQ:
     {
 	struct ccb_pathinq	*cpi = &ccb->cpi;
+	int			sg_length;
 
 	debug(1, "XPT_PATH_INQ %d:%d:%d", cam_sim_bus(sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun);
 
@@ -3005,7 +3007,22 @@ ciss_cam_action(struct cam_sim *sim, uni
 	cpi->transport_version = 2;
 	cpi->protocol = PROTO_SCSI;
 	cpi->protocol_version = SCSI_REV_2;
-	cpi->maxio = (CISS_MAX_SG_ELEMENTS - 1) * PAGE_SIZE;
+	if (sc->ciss_cfg->max_sg_length == 0) {
+		sg_length = 17;
+	} else {
+	/* XXX Fix for ZMR cards that advertise max_sg_length == 32
+	 * Confusing bit here. max_sg_length is usually a power of 2. We always
+	 * need to subtract 1 to account for partial pages. Then we need to 
+	 * align on a valid PAGE_SIZE so we round down to the nearest power of 2. 
+	 * Add 1 so we can then subtract it out in the assignment to maxio.
+	 * The reason for all these shenanigans is to create a maxio value that
+	 * creates IO operations to volumes that yield consistent operations
+	 * with good performance.
+	 */
+		sg_length = sc->ciss_cfg->max_sg_length - 1;
+		sg_length = (1 << (fls(sg_length) - 1)) + 1;
+	}
+	cpi->maxio = (min(CISS_MAX_SG_ELEMENTS, sg_length) - 1) * PAGE_SIZE;
 	ccb->ccb_h.status = CAM_REQ_CMP;
 	break;
     }

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 17:42:21 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 0F9052B1;
 Wed, 10 Jul 2013 17:42:21 +0000 (UTC)
 (envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id E59F91054;
 Wed, 10 Jul 2013 17:42:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AHgKmm024114;
 Wed, 10 Jul 2013 17:42:20 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AHgKOm024113;
 Wed, 10 Jul 2013 17:42:20 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201307101742.r6AHgKOm024113@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 10 Jul 2013 17:42:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253161 - head/sys/dev/uart
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 17:42:21 -0000

Author: marcel
Date: Wed Jul 10 17:42:20 2013
New Revision: 253161
URL: http://svnweb.freebsd.org/changeset/base/253161

Log:
  Protect against broken hardware. In this particular case, protect against
  H/W not de-asserting the interrupt at all. On x86, and because of the
  following conditions, this results in a hard hang with interrupts disabled:
  1.  The uart(4) driver uses a spin lock to protect against concurrent
      access to the H/W. Spin locks disable and restore interrupts.
  2.  Restoring the interrupt on x86 always writes the flags register. Even
      if we're restoring the interrupt from disabled to disabled.
  3.  The x86 CPU has a short window in which interrupts are enabled when the
      flags register is written.
  4.  The uart(4) driver registers a fast interrupt by default.
  
  To catch this case, we first try to clear any pending H/W interrupts and in
  particular, before setting up the interrupt. This makes sure the interrupt
  is masked on the PIC. The interrupt handler now has a limit set on the
  number of iterations it'll go through to clear interrupt conditions. If the
  limit is hit, the handler will return FILTER_SCHEDULE_THREAD. The attach
  function will check for this return code and avoid setting up the interrupt
  and foce polling in that case.
  
  Obtained from:	Juniper Networks, Inc.

Modified:
  head/sys/dev/uart/uart_core.c

Modified: head/sys/dev/uart/uart_core.c
==============================================================================
--- head/sys/dev/uart/uart_core.c	Wed Jul 10 17:16:10 2013	(r253160)
+++ head/sys/dev/uart/uart_core.c	Wed Jul 10 17:42:20 2013	(r253161)
@@ -248,10 +248,14 @@ static int
 uart_intr(void *arg)
 {
 	struct uart_softc *sc = arg;
-	int flag = 0, ipend;
+	int cnt, ipend;
 
-	while (!sc->sc_leaving && (ipend = UART_IPEND(sc)) != 0) {
-		flag = 1;
+	if (sc->sc_leaving)
+		return (FILTER_STRAY);
+
+	cnt = 0;
+	while (cnt < 20 && (ipend = UART_IPEND(sc)) != 0) {
+		cnt++;
 		if (ipend & SER_INT_OVERRUN)
 			uart_intr_overrun(sc);
 		if (ipend & SER_INT_BREAK)
@@ -269,7 +273,8 @@ uart_intr(void *arg)
 		    (timeout_t *)uart_intr, sc);
 	}
 
-	return((flag)?FILTER_HANDLED:FILTER_STRAY);
+	return ((cnt == 0) ? FILTER_STRAY :
+	    ((cnt == 20) ? FILTER_SCHEDULE_THREAD : FILTER_HANDLED));
 }
 
 serdev_intr_t *
@@ -390,7 +395,7 @@ uart_bus_attach(device_t dev)
 {
 	struct uart_softc *sc, *sc0;
 	const char *sep;
-	int error;
+	int error, filt;
 
 	/*
 	 * The sc_class field defines the type of UART we're going to work
@@ -430,33 +435,6 @@ uart_bus_attach(device_t dev)
 	sc->sc_bas.bsh = rman_get_bushandle(sc->sc_rres);
 	sc->sc_bas.bst = rman_get_bustag(sc->sc_rres);
 
-	sc->sc_irid = 0;
-	sc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irid,
-	    RF_ACTIVE | RF_SHAREABLE);
-	if (sc->sc_ires != NULL) {
-		error = bus_setup_intr(dev,
-		    sc->sc_ires, INTR_TYPE_TTY, 
-		    uart_intr, NULL, sc, &sc->sc_icookie);		    
-		if (error)
-			error = bus_setup_intr(dev,
-			    sc->sc_ires, INTR_TYPE_TTY | INTR_MPSAFE,
-			    NULL, (driver_intr_t *)uart_intr, sc, &sc->sc_icookie);
-		else
-			sc->sc_fastintr = 1;
-
-		if (error) {
-			device_printf(dev, "could not activate interrupt\n");
-			bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irid,
-			    sc->sc_ires);
-			sc->sc_ires = NULL;
-		}
-	}
-	if (sc->sc_ires == NULL) {
-		/* No interrupt resource. Force polled mode. */
-		sc->sc_polled = 1;
-		callout_init(&sc->sc_timer, 1);
-	}
-
 	/*
 	 * Ensure there is room for at least three full FIFOs of data in the
 	 * receive buffer (handles the case of low-level drivers with huge
@@ -487,20 +465,6 @@ uart_bus_attach(device_t dev)
 		printf("\n");
 	}
 
-	if (bootverbose && (sc->sc_fastintr || sc->sc_polled)) {
-		sep = "";
-		device_print_prettyname(dev);
-		if (sc->sc_fastintr) {
-			printf("%sfast interrupt", sep);
-			sep = ", ";
-		}
-		if (sc->sc_polled) {
-			printf("%spolled mode", sep);
-			sep = ", ";
-		}
-		printf("\n");
-	}
-
 	if (sc->sc_sysdev != NULL) {
 		if (sc->sc_sysdev->baudrate == 0) {
 			if (UART_IOCTL(sc, UART_IOCTL_BAUD,
@@ -529,6 +493,56 @@ uart_bus_attach(device_t dev)
 	sc->sc_pps.ppscap = PPS_CAPTUREBOTH;
 	pps_init(&sc->sc_pps);
 
+	sc->sc_leaving = 0;
+	filt = uart_intr(sc);
+
+	/*
+	 * Don't use interrupts if we couldn't clear any pending interrupt
+	 * conditions. We may have broken H/W and polling is probably the
+	 * safest thing to do.
+	 */
+	if (filt != FILTER_SCHEDULE_THREAD) {
+		sc->sc_irid = 0;
+		sc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ,
+		    &sc->sc_irid, RF_ACTIVE | RF_SHAREABLE);
+	}
+	if (sc->sc_ires != NULL) {
+		error = bus_setup_intr(dev, sc->sc_ires, INTR_TYPE_TTY,
+		    uart_intr, NULL, sc, &sc->sc_icookie);
+		sc->sc_fastintr = (error == 0) ? 1 : 0;
+
+		if (!sc->sc_fastintr)
+			error = bus_setup_intr(dev, sc->sc_ires,
+			    INTR_TYPE_TTY | INTR_MPSAFE, NULL,
+			    (driver_intr_t *)uart_intr, sc, &sc->sc_icookie);
+
+		if (error) {
+			device_printf(dev, "could not activate interrupt\n");
+			bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irid,
+			    sc->sc_ires);
+			sc->sc_ires = NULL;
+		}
+	}
+	if (sc->sc_ires == NULL) {
+		/* No interrupt resource. Force polled mode. */
+		sc->sc_polled = 1;
+		callout_init(&sc->sc_timer, 1);
+	}
+
+	if (bootverbose && (sc->sc_fastintr || sc->sc_polled)) {
+		sep = "";
+		device_print_prettyname(dev);
+		if (sc->sc_fastintr) {
+			printf("%sfast interrupt", sep);
+			sep = ", ";
+		}
+		if (sc->sc_polled) {
+			printf("%spolled mode", sep);
+			sep = ", ";
+		}
+		printf("\n");
+	}
+
 	error = (sc->sc_sysdev != NULL && sc->sc_sysdev->attach != NULL)
 	    ? (*sc->sc_sysdev->attach)(sc) : uart_tty_attach(sc);
 	if (error)
@@ -537,8 +551,6 @@ uart_bus_attach(device_t dev)
 	if (sc->sc_sysdev != NULL)
 		sc->sc_sysdev->hwmtx = sc->sc_hwmtx;
 
-	sc->sc_leaving = 0;
-	uart_intr(sc);
 	return (0);
 
  fail:

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 18:05:48 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 54A98C11;
 Wed, 10 Jul 2013 18:05:48 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 by mx1.freebsd.org (Postfix) with ESMTP id 2FFDC117A;
 Wed, 10 Jul 2013 18:05:48 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3288DB948;
 Wed, 10 Jul 2013 14:05:45 -0400 (EDT)
From: John Baldwin 
To: Marcel Moolenaar 
Subject: Re: svn commit: r253161 - head/sys/dev/uart
Date: Wed, 10 Jul 2013 14:05:43 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; )
References: <201307101742.r6AHgKOm024113@svn.freebsd.org>
In-Reply-To: <201307101742.r6AHgKOm024113@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201307101405.44158.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Wed, 10 Jul 2013 14:05:45 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 18:05:48 -0000

On Wednesday, July 10, 2013 1:42:20 pm Marcel Moolenaar wrote:
> Author: marcel
> Date: Wed Jul 10 17:42:20 2013
> New Revision: 253161
> URL: http://svnweb.freebsd.org/changeset/base/253161
> 
> Log:
>   Protect against broken hardware. In this particular case, protect against
>   H/W not de-asserting the interrupt at all. On x86, and because of the
>   following conditions, this results in a hard hang with interrupts disabled:
>   1.  The uart(4) driver uses a spin lock to protect against concurrent
>       access to the H/W. Spin locks disable and restore interrupts.
>   2.  Restoring the interrupt on x86 always writes the flags register. Even
>       if we're restoring the interrupt from disabled to disabled.
>   3.  The x86 CPU has a short window in which interrupts are enabled when the
>       flags register is written.

Do you have proof of this?  I have never seen anything like this documented.
It would be fundamentally broken if true.  In fact, if anything the evidence
I have seen is the exact opposite: that Intel is very careful to prevent races
of this sort.  Specifically, Intel CPUs have long had a feature of disabling
interrupts for the instruction following POP SS to permit atomic loads of
SS:ESP (for code that doesn't use LSS).  I highly doubt your claim is true.

In fact, I think you might be confused by the VME bits (VIP and VIF). The
POPF instruction is documented to clear VIP and VIF, but those flags only
matter when operating in virtual 86 mode.  They are not relevant to our
kernel.  I think you need to find a real explanation for the hang you are
seeing.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 18:07:02 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 711ABEB2;
 Wed, 10 Jul 2013 18:07:02 +0000 (UTC)
 (envelope-from rdivacky@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 62EF91199;
 Wed, 10 Jul 2013 18:07:02 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AI72Xb031230;
 Wed, 10 Jul 2013 18:07:02 GMT
 (envelope-from rdivacky@svn.freebsd.org)
Received: (from rdivacky@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AI72AF031229;
 Wed, 10 Jul 2013 18:07:02 GMT
 (envelope-from rdivacky@svn.freebsd.org)
Message-Id: <201307101807.r6AI72AF031229@svn.freebsd.org>
From: Roman Divacky 
Date: Wed, 10 Jul 2013 18:07:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253162 - head/usr.sbin/nvram
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 18:07:02 -0000

Author: rdivacky
Date: Wed Jul 10 18:07:01 2013
New Revision: 253162
URL: http://svnweb.freebsd.org/changeset/base/253162

Log:
  Fix -Wmissing-variable-declarations compiler warning.

Modified:
  head/usr.sbin/nvram/nvram.c

Modified: head/usr.sbin/nvram/nvram.c
==============================================================================
--- head/usr.sbin/nvram/nvram.c	Wed Jul 10 17:42:20 2013	(r253161)
+++ head/usr.sbin/nvram/nvram.c	Wed Jul 10 18:07:01 2013	(r253162)
@@ -51,7 +51,7 @@ struct deletelist {
 	struct deletelist *last;
 };
 
-union {
+static union {
 	uint8_t buf[sizeof(struct chrp_header)];
 	struct chrp_header header;
 } conv;

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 18:09:47 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 468E9145;
 Wed, 10 Jul 2013 18:09:47 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 by mx1.freebsd.org (Postfix) with ESMTP id 23FFE11C4;
 Wed, 10 Jul 2013 18:09:47 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8D89FB97F;
 Wed, 10 Jul 2013 14:09:46 -0400 (EDT)
From: John Baldwin 
To: Marcel Moolenaar 
Subject: Re: svn commit: r253161 - head/sys/dev/uart
Date: Wed, 10 Jul 2013 14:09:42 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; )
References: <201307101742.r6AHgKOm024113@svn.freebsd.org>
 <201307101405.44158.jhb@freebsd.org>
In-Reply-To: <201307101405.44158.jhb@freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201307101409.42228.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Wed, 10 Jul 2013 14:09:46 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 18:09:47 -0000

On Wednesday, July 10, 2013 2:05:43 pm John Baldwin wrote:
> On Wednesday, July 10, 2013 1:42:20 pm Marcel Moolenaar wrote:
> > Author: marcel
> > Date: Wed Jul 10 17:42:20 2013
> > New Revision: 253161
> > URL: http://svnweb.freebsd.org/changeset/base/253161
> > 
> > Log:
> >   Protect against broken hardware. In this particular case, protect against
> >   H/W not de-asserting the interrupt at all. On x86, and because of the
> >   following conditions, this results in a hard hang with interrupts disabled:
> >   1.  The uart(4) driver uses a spin lock to protect against concurrent
> >       access to the H/W. Spin locks disable and restore interrupts.
> >   2.  Restoring the interrupt on x86 always writes the flags register. Even
> >       if we're restoring the interrupt from disabled to disabled.
> >   3.  The x86 CPU has a short window in which interrupts are enabled when the
> >       flags register is written.
> 
> Do you have proof of this?  I have never seen anything like this documented.
> It would be fundamentally broken if true.  In fact, if anything the evidence
> I have seen is the exact opposite: that Intel is very careful to prevent races
> of this sort.  Specifically, Intel CPUs have long had a feature of disabling
> interrupts for the instruction following POP SS to permit atomic loads of
> SS:ESP (for code that doesn't use LSS).  I highly doubt your claim is true.
> 
> In fact, I think you might be confused by the VME bits (VIP and VIF). The
> POPF instruction is documented to clear VIP and VIF, but those flags only
> matter when operating in virtual 86 mode.  They are not relevant to our
> kernel.  I think you need to find a real explanation for the hang you are
> seeing.

Also, to be clear, if CPUs behave the way you described, our x86 ports would
have been horribly unstable since at least 5.0.  We depend on nested unlocks
not transparently enabling interrupts to prevent nested interrupt frames
(which can quickly exhaust the kernel stack and lead to a double fault, back
when doing early ithread work these were not hard to provoke).

I have not see a single report of a double fault due to this type of
recursion since 5.0 was released 

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 18:19:48 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id D9B904EB;
 Wed, 10 Jul 2013 18:19:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id CBCE01253;
 Wed, 10 Jul 2013 18:19:48 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AIJmcu034695;
 Wed, 10 Jul 2013 18:19:48 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AIJmH8034694;
 Wed, 10 Jul 2013 18:19:48 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201307101819.r6AIJmH8034694@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Wed, 10 Jul 2013 18:19:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253163 - head/sys/ufs/ufs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 18:19:48 -0000

Author: pfg
Date: Wed Jul 10 18:19:48 2013
New Revision: 253163
URL: http://svnweb.freebsd.org/changeset/base/253163

Log:
  Change i_gen in UFS to an unsigned type.
  
  Missing type change from r252435.
  
  This fixes a "Stale NFS file handle" error.
  
  Reported by:	Claude Bisson
  Tested by:	Claude Bisson
  Pointed hat:	pfg

Modified:
  head/sys/ufs/ufs/inode.h

Modified: head/sys/ufs/ufs/inode.h
==============================================================================
--- head/sys/ufs/ufs/inode.h	Wed Jul 10 18:07:01 2013	(r253162)
+++ head/sys/ufs/ufs/inode.h	Wed Jul 10 18:19:48 2013	(r253163)
@@ -180,7 +180,7 @@ struct ufid {
 	u_int16_t ufid_len;	/* Length of structure. */
 	u_int16_t ufid_pad;	/* Force 32-bit alignment. */
 	uint32_t  ufid_ino;	/* File number (ino). */
-	int32_t	  ufid_gen;	/* Generation number. */
+	uint32_t  ufid_gen;	/* Generation number. */
 };
 #endif /* _KERNEL */
 

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 18:27:15 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 7E01F6E4;
 Wed, 10 Jul 2013 18:27:15 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 6EDC312AE;
 Wed, 10 Jul 2013 18:27:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AIRFuY037246;
 Wed, 10 Jul 2013 18:27:15 GMT (envelope-from brooks@svn.freebsd.org)
Received: (from brooks@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AIRFCX037245;
 Wed, 10 Jul 2013 18:27:15 GMT (envelope-from brooks@svn.freebsd.org)
Message-Id: <201307101827.r6AIRFCX037245@svn.freebsd.org>
From: Brooks Davis 
Date: Wed, 10 Jul 2013 18:27:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253164 - stable/9
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 18:27:15 -0000

Author: brooks
Date: Wed Jul 10 18:27:14 2013
New Revision: 253164
URL: http://svnweb.freebsd.org/changeset/base/253164

Log:
  MFC r251765:
  
  Simplify the hierarchy target's logic.[0]
  
  Run hierarchy with WORLDTMP in the path so it works when it is invoked
  directly.  Such use is nearly alwasy wrong but appears to be common.[1]
  
  PR:		conf/178209 [0], conf/178547 [1]
  Submitted by:	Garrett Cooper  [0]

Modified:
  stable/9/Makefile.inc1   (contents, props changed)

Modified: stable/9/Makefile.inc1
==============================================================================
--- stable/9/Makefile.inc1	Wed Jul 10 18:19:48 2013	(r253163)
+++ stable/9/Makefile.inc1	Wed Jul 10 18:27:14 2013	(r253164)
@@ -268,6 +268,13 @@ WMAKEENV=	${CROSSENV} \
 		VERSION="${VERSION}" \
 		INSTALL="sh ${.CURDIR}/tools/install.sh" \
 		PATH=${TMPPATH}
+
+# make hierarchy
+HMAKE=		PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE}
+.if defined(NO_ROOT)
+HMAKE+=		PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT
+.endif
+
 .if ${MK_CDDL} == "no"
 WMAKEENV+=	NO_CTF=1
 .endif
@@ -1288,12 +1295,7 @@ cross-tools:
 # hierarchy - ensure that all the needed directories are present
 #
 hierarchy hier:
-.if defined(NO_ROOT)
-	cd ${.CURDIR}/etc; ${MAKE} LOCAL_MTREE=${LOCAL_MTREE} \
-	    -DNO_ROOT METALOG=${METALOG} distrib-dirs
-.else
-	cd ${.CURDIR}/etc; ${MAKE} LOCAL_MTREE=${LOCAL_MTREE} distrib-dirs
-.endif
+	cd ${.CURDIR}/etc && ${HMAKE} distrib-dirs
 
 #
 # libraries - build all libraries, and install them under ${DESTDIR}.

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 18:58:43 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 56E3C10E;
 Wed, 10 Jul 2013 18:58:43 +0000 (UTC)
 (envelope-from Andre.Albsmeier@siemens.com)
Received: from goliath.siemens.de (goliath.siemens.de [192.35.17.28])
 by mx1.freebsd.org (Postfix) with ESMTP id BF2EB1489;
 Wed, 10 Jul 2013 18:58:42 +0000 (UTC)
Received: from mail1.siemens.de (localhost [127.0.0.1])
 by goliath.siemens.de (8.13.6/8.13.6) with ESMTP id r6AIwY1h012066;
 Wed, 10 Jul 2013 20:58:34 +0200
Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130])
 by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id r6AIwY9L028997;
 Wed, 10 Jul 2013 20:58:34 +0200
Received: (from localhost)
 by curry.mchp.siemens.de (8.14.7/8.14.7) id r6AIwYcr044910;
Date: Wed, 10 Jul 2013 20:58:33 +0200
From: Andre Albsmeier 
To: "Kenneth D. Merry" 
Subject: Re: svn commit: r252214 - in stable/9: bin/chio sys/cam/scsi sys/sys
Message-ID: <20130710185833.GA83135@bali>
References: <201306252143.r5PLhoM0064338@svn.freebsd.org>
 <20130702055333.GA2729@bali>
 <20130703052236.GA65730@nargothrond.kdm.org>
 <20130703054349.GA13656@bali>
 <20130710184915.GA28790@nargothrond.kdm.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20130710184915.GA28790@nargothrond.kdm.org>
X-Echelon: 
X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses!
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "src-committers@freebsd.org" ,
 "asomers@freebsd.org" , "Albsmeier,
 Andre" ,
 "svn-src-stable@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "svn-src-stable-9@freebsd.org" ,
 "gibbs@freebsd.org" 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 18:58:43 -0000

On Wed, 10-Jul-2013 at 20:49:15 +0200, Kenneth D. Merry wrote:
> On Wed, Jul 03, 2013 at 07:43:49 +0200, Andre Albsmeier wrote:
> > On Wed, 03-Jul-2013 at 07:22:36 +0200, Kenneth D. Merry wrote:
> > > On Tue, Jul 02, 2013 at 07:53:33 +0200, Andre Albsmeier wrote:
> > > > On Tue, 25-Jun-2013 at 23:43:50 +0200, Kenneth D. Merry wrote:
> > > > > Author: ken
> > > > > Date: Tue Jun 25 21:43:49 2013
> > > > > New Revision: 252214
> > > > > URL: http://svnweb.freebsd.org/changeset/base/252214
> > > > 
> > > > Hi Ken,
> > > > 
> > > > > Log:
> > > > >   MFC: 249658, 249701
> > > > > 
> > > > >   Update chio(1) and ch(4) to support reporting element designators.
> > > > > 
> > > > >   This allows mapping a tape drive in a changer (as reported by
> > > > >   'chio status') to a sa(4) driver instance by comparing the
> > > > >   serial numbers.
> > > > > 
> > > > >   The designators can be ASCII (which is printed out directly), binary
> > > > >   (which is printed in hex format) or UTF-8, which is printed in either
> > > > >   native UTF-8 format if the terminal can support it, or in %XX notation
> > > > >   for non-ASCII characters.  Thanks to Hiroki Sato  for the
> > > > >   explanation and example UTF-8 printing code.
> > > > > 
> > > > >   chio.h:               Modify the changer_element_status structure to add new
> > > > >                 fields and definitions from the SMC3r16 spec.
> > > > > 
> > > > >                 Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and
> > > > >                 define a new CHIOGSTATUS ioctl.
> > > > > 
> > > > >                 Clean up some tab/space issues.
> > > > > 
> > > > >   chio.c:       For the 'status' subcommand, print the designator field
> > > > >                 if it is supplied by a device.
> > > > > 
> > > > >   scsi_ch.h:    Add new flags for DVCID and CURDATA to the READ
> > > > >                 ELEMENT STATUS command structure.
> > > > > 
> > > > >                 Add a read_element_status_device_id structure
> > > > >                 for the data fields in the new standard. Add new
> > > > >                 unions, dt_or_obsolete and voltage_devid, to hold
> > > > >                 and address data from either SCSI-2 or newer devices.
> > > > > 
> > > > >   scsi_ch.c:    Implement support for fetching device IDs with READ
> > > > >                 ELEMENT STATUS data.
> > > > > 
> > > > >                 Add new arguments to scsi_read_element_status() to
> > > > >                 allow the user to request the DVCID and CURDATA bits.
> > > > 
> > > > This broke "chio status" when talking to my QUALSTAR TLS-8211 library:
> > > > 
> > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): READ ELEMENT STATUS. CDB: b8 10 fd e8 00 01 03 00 04 00 00 00
> > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): CAM status: SCSI Status Error
> > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): SCSI status: Check Condition
> > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
> > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): Command byte 6 is invalid
> > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): Error 22, Unretryable error
> > > > 
> > > > scsi_cmd->flags (Byte 6) must be zero for this library so I had to use
> > > > this workaround to make it work again until a better solution is available:
> > > > 
> > > > --- sys/cam/scsi/scsi_ch.c.ORI	2013-06-26 13:38:54.000000000 +0200
> > > > +++ sys/cam/scsi/scsi_ch.c	2013-07-02 07:42:24.000000000 +0200
> > > > @@ -1245,8 +1245,8 @@
> > > >  				 /* tag_action */ MSG_SIMPLE_Q_TAG,
> > > >  				 /* voltag */ want_voltags,
> > > >  				 /* sea */ softc->sc_firsts[chet],
> > > > -				 /* dvcid */ 1,
> > > > -				 /* curdata */ 1,
> > > > +				 /* dvcid */ 0,
> > > > +				 /* curdata */ 0,
> > > >  				 /* count */ 1,
> > > >  				 /* data_ptr */ data,
> > > >  				 /* dxfer_len */ 1024,
> > > > @@ -1284,8 +1284,8 @@
> > > >  				 /* voltag */ want_voltags,
> > > >  				 /* sea */ softc->sc_firsts[chet]
> > > >  				 + cesr->cesr_element_base,
> > > > -				 /* dvcid */ 1,
> > > > -				 /* curdata */ 1,
> > > > +				 /* dvcid */ 0,
> > > > +				 /* curdata */ 0,
> > > >  				 /* count */ cesr->cesr_element_count,
> > > >  				 /* data_ptr */ data,
> > > >  				 /* dxfer_len */ size,
> > > > 
> > > > 	-Andre
> > > 
> > > Oops, sorry.
> > > 
> > > We need to check the SCSI version to see whether to set those bits, and
> > > also fall back in case it doesn't work.
> > > 
> > > I am on vacation and have very spotty net access.  I can't do anything
> > > about it until I get back next week.
> > > 
> > > Justin and Alan (CCed) can work on the fix, though.
> > 
> > Take your time, for me it's working right now
> > with the above patch...
> 
> Okay, I'm back and can take a look at this.

Welcome back ;-)

> 
> Can you send me:

Sure, I am happy to help.

> 
> camcontrol inquiry ch0 -v

pass17:  Removable Changer SCSI-2 device 
pass17: Serial Number 0021009613
pass17: 3.300MB/s transfers

> camcontrol cmd ch0 -v -c "12 0 0 0 ff 0" -i 255 "s58 i2 i2 i2 i2 i2 i2 i2 i2"

0 0 0 0 0 0 0 0 

> 
> I want to see what SCSI version this changer reports.  The second command
> will print out the SCSI version descriptors, if any, that the changer
> reports.

In case you need more info just drop me a note.

Thanks for looking into this.

	-Andre

> 
> Ken
> -- 
> Kenneth Merry
> ken@FreeBSD.ORG
> 

-- 
ech`echo xiun | tr nu oc | sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 19:15:59 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id EA6F4627;
 Wed, 10 Jul 2013 19:15:59 +0000 (UTC)
 (envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id C24491683;
 Wed, 10 Jul 2013 19:15:59 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AJFxg9051920;
 Wed, 10 Jul 2013 19:15:59 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AJFxAE051919;
 Wed, 10 Jul 2013 19:15:59 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201307101915.r6AJFxAE051919@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 10 Jul 2013 19:15:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-svnadmin@freebsd.org
Subject: svn commit: r253165 - svnadmin/conf
X-SVN-Group: svnadmin
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 19:16:00 -0000

Author: gavin
Date: Wed Jul 10 19:15:59 2013
New Revision: 253165
URL: http://svnweb.freebsd.org/changeset/base/253165

Log:
  Re-enable rodrigc's commit bit, per his request to core.
  
  Approved by:	core

Modified:
  svnadmin/conf/access

Modified: svnadmin/conf/access
==============================================================================
--- svnadmin/conf/access	Wed Jul 10 18:27:14 2013	(r253164)
+++ svnadmin/conf/access	Wed Jul 10 19:15:59 2013	(r253165)
@@ -175,6 +175,7 @@ rmacklem
 rmh
 rnoland
 roberto
+rodrigc
 rpaulo
 rrs
 rstone

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 19:18:58 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 118E4776;
 Wed, 10 Jul 2013 19:18:58 +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 8DD50169A;
 Wed, 10 Jul 2013 19:18:57 +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 r6AInGCX029433;
 Wed, 10 Jul 2013 12:49:16 -0600 (MDT)
 (envelope-from ken@nargothrond.kdm.org)
Received: (from ken@localhost)
 by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r6AInFvT029432;
 Wed, 10 Jul 2013 12:49:15 -0600 (MDT) (envelope-from ken)
Date: Wed, 10 Jul 2013 12:49:15 -0600
From: "Kenneth D. Merry" 
To: Andre Albsmeier 
Subject: Re: svn commit: r252214 - in stable/9: bin/chio sys/cam/scsi sys/sys
Message-ID: <20130710184915.GA28790@nargothrond.kdm.org>
References: <201306252143.r5PLhoM0064338@svn.freebsd.org>
 <20130702055333.GA2729@bali> <20130703052236.GA65730@nargothrond.kdm.org>
 <20130703054349.GA13656@bali>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20130703054349.GA13656@bali>
User-Agent: Mutt/1.4.2i
Cc: "src-committers@freebsd.org" ,
 "asomers@freebsd.org" ,
 "svn-src-stable@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "svn-src-stable-9@freebsd.org" ,
 "gibbs@freebsd.org" 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 19:18:58 -0000

On Wed, Jul 03, 2013 at 07:43:49 +0200, Andre Albsmeier wrote:
> On Wed, 03-Jul-2013 at 07:22:36 +0200, Kenneth D. Merry wrote:
> > On Tue, Jul 02, 2013 at 07:53:33 +0200, Andre Albsmeier wrote:
> > > On Tue, 25-Jun-2013 at 23:43:50 +0200, Kenneth D. Merry wrote:
> > > > Author: ken
> > > > Date: Tue Jun 25 21:43:49 2013
> > > > New Revision: 252214
> > > > URL: http://svnweb.freebsd.org/changeset/base/252214
> > > 
> > > Hi Ken,
> > > 
> > > > Log:
> > > >   MFC: 249658, 249701
> > > > 
> > > >   Update chio(1) and ch(4) to support reporting element designators.
> > > > 
> > > >   This allows mapping a tape drive in a changer (as reported by
> > > >   'chio status') to a sa(4) driver instance by comparing the
> > > >   serial numbers.
> > > > 
> > > >   The designators can be ASCII (which is printed out directly), binary
> > > >   (which is printed in hex format) or UTF-8, which is printed in either
> > > >   native UTF-8 format if the terminal can support it, or in %XX notation
> > > >   for non-ASCII characters.  Thanks to Hiroki Sato  for the
> > > >   explanation and example UTF-8 printing code.
> > > > 
> > > >   chio.h:               Modify the changer_element_status structure to add new
> > > >                 fields and definitions from the SMC3r16 spec.
> > > > 
> > > >                 Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and
> > > >                 define a new CHIOGSTATUS ioctl.
> > > > 
> > > >                 Clean up some tab/space issues.
> > > > 
> > > >   chio.c:       For the 'status' subcommand, print the designator field
> > > >                 if it is supplied by a device.
> > > > 
> > > >   scsi_ch.h:    Add new flags for DVCID and CURDATA to the READ
> > > >                 ELEMENT STATUS command structure.
> > > > 
> > > >                 Add a read_element_status_device_id structure
> > > >                 for the data fields in the new standard. Add new
> > > >                 unions, dt_or_obsolete and voltage_devid, to hold
> > > >                 and address data from either SCSI-2 or newer devices.
> > > > 
> > > >   scsi_ch.c:    Implement support for fetching device IDs with READ
> > > >                 ELEMENT STATUS data.
> > > > 
> > > >                 Add new arguments to scsi_read_element_status() to
> > > >                 allow the user to request the DVCID and CURDATA bits.
> > > 
> > > This broke "chio status" when talking to my QUALSTAR TLS-8211 library:
> > > 
> > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): READ ELEMENT STATUS. CDB: b8 10 fd e8 00 01 03 00 04 00 00 00
> > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): CAM status: SCSI Status Error
> > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): SCSI status: Check Condition
> > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
> > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): Command byte 6 is invalid
> > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): Error 22, Unretryable error
> > > 
> > > scsi_cmd->flags (Byte 6) must be zero for this library so I had to use
> > > this workaround to make it work again until a better solution is available:
> > > 
> > > --- sys/cam/scsi/scsi_ch.c.ORI	2013-06-26 13:38:54.000000000 +0200
> > > +++ sys/cam/scsi/scsi_ch.c	2013-07-02 07:42:24.000000000 +0200
> > > @@ -1245,8 +1245,8 @@
> > >  				 /* tag_action */ MSG_SIMPLE_Q_TAG,
> > >  				 /* voltag */ want_voltags,
> > >  				 /* sea */ softc->sc_firsts[chet],
> > > -				 /* dvcid */ 1,
> > > -				 /* curdata */ 1,
> > > +				 /* dvcid */ 0,
> > > +				 /* curdata */ 0,
> > >  				 /* count */ 1,
> > >  				 /* data_ptr */ data,
> > >  				 /* dxfer_len */ 1024,
> > > @@ -1284,8 +1284,8 @@
> > >  				 /* voltag */ want_voltags,
> > >  				 /* sea */ softc->sc_firsts[chet]
> > >  				 + cesr->cesr_element_base,
> > > -				 /* dvcid */ 1,
> > > -				 /* curdata */ 1,
> > > +				 /* dvcid */ 0,
> > > +				 /* curdata */ 0,
> > >  				 /* count */ cesr->cesr_element_count,
> > >  				 /* data_ptr */ data,
> > >  				 /* dxfer_len */ size,
> > > 
> > > 	-Andre
> > 
> > Oops, sorry.
> > 
> > We need to check the SCSI version to see whether to set those bits, and
> > also fall back in case it doesn't work.
> > 
> > I am on vacation and have very spotty net access.  I can't do anything
> > about it until I get back next week.
> > 
> > Justin and Alan (CCed) can work on the fix, though.
> 
> Take your time, for me it's working right now
> with the above patch...

Okay, I'm back and can take a look at this.

Can you send me:

camcontrol inquiry ch0 -v
camcontrol cmd ch0 -v -c "12 0 0 0 ff 0" -i 255 "s58 i2 i2 i2 i2 i2 i2 i2 i2"

I want to see what SCSI version this changer reports.  The second command
will print out the SCSI version descriptors, if any, that the changer
reports.

Ken
-- 
Kenneth Merry
ken@FreeBSD.ORG

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 19:42:08 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 83609F4B;
 Wed, 10 Jul 2013 19:42:08 +0000 (UTC)
 (envelope-from trociny@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 5B8EB17A4;
 Wed, 10 Jul 2013 19:42:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AJg8hY060410;
 Wed, 10 Jul 2013 19:42:08 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AJg8PH060409;
 Wed, 10 Jul 2013 19:42:08 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201307101942.r6AJg8PH060409@svn.freebsd.org>
From: Mikolaj Golub 
Date: Wed, 10 Jul 2013 19:42:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253166 - stable/9/lib/libkvm
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 19:42:08 -0000

Author: trociny
Date: Wed Jul 10 19:42:07 2013
New Revision: 253166
URL: http://svnweb.freebsd.org/changeset/base/253166

Log:
  Direct commit to stable branch to fix ABI breakage:
  
  In r227839, when removing libkvm dependency on procfs(5),
  kvm_uread() function, used for reading from /proc/pid/mem, was
  removed too. This change broke ABI.
  
  Bring kvm_uread() back so that the ABI is kept. In head soname is
  going to be bumped instead.
  
  Reported by:	rmh
  Discussed on:	arch
  Suggested by:	jilles

Modified:
  stable/9/lib/libkvm/kvm_proc.c

Modified: stable/9/lib/libkvm/kvm_proc.c
==============================================================================
--- stable/9/lib/libkvm/kvm_proc.c	Wed Jul 10 19:15:59 2013	(r253165)
+++ stable/9/lib/libkvm/kvm_proc.c	Wed Jul 10 19:42:07 2013	(r253166)
@@ -712,3 +712,55 @@ kvm_getenvv(kvm_t *kd, const struct kinf
 {
 	return (kvm_argv(kd, kp, 1, nchr));
 }
+
+/*
+ * Read from user space.  The user context is given by p.
+ */
+ssize_t
+kvm_uread(kvm_t *kd, const struct kinfo_proc *kp, u_long uva, char *buf,
+	size_t len)
+{
+	char *cp;
+	char procfile[MAXPATHLEN];
+	ssize_t amount;
+	int fd;
+
+	if (!ISALIVE(kd)) {
+		_kvm_err(kd, kd->program,
+		    "cannot read user space from dead kernel");
+		return (0);
+	}
+
+	sprintf(procfile, "/proc/%d/mem", kp->ki_pid);
+	fd = open(procfile, O_RDONLY, 0);
+	if (fd < 0) {
+		_kvm_err(kd, kd->program, "cannot open %s", procfile);
+		return (0);
+	}
+
+	cp = buf;
+	while (len > 0) {
+		errno = 0;
+		if (lseek(fd, (off_t)uva, 0) == -1 && errno != 0) {
+			_kvm_err(kd, kd->program, "invalid address (%lx) in %s",
+			    uva, procfile);
+			break;
+		}
+		amount = read(fd, cp, len);
+		if (amount < 0) {
+			_kvm_syserr(kd, kd->program, "error reading %s",
+			    procfile);
+			break;
+		}
+		if (amount == 0) {
+			_kvm_err(kd, kd->program, "EOF reading %s", procfile);
+			break;
+		}
+		cp += amount;
+		uva += amount;
+		len -= amount;
+	}
+
+	close(fd);
+	return ((ssize_t)(cp - buf));
+}

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 19:44:44 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 3A11917D;
 Wed, 10 Jul 2013 19:44:44 +0000 (UTC)
 (envelope-from trociny@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 1233017D6;
 Wed, 10 Jul 2013 19:44:44 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AJihdF060774;
 Wed, 10 Jul 2013 19:44:43 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AJihNV060771;
 Wed, 10 Jul 2013 19:44:43 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201307101944.r6AJihNV060771@svn.freebsd.org>
From: Mikolaj Golub 
Date: Wed, 10 Jul 2013 19:44:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253167 - in head: . lib/libkvm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 19:44:44 -0000

Author: trociny
Date: Wed Jul 10 19:44:43 2013
New Revision: 253167
URL: http://svnweb.freebsd.org/changeset/base/253167

Log:
  In r227839, when removing libkvm dependency on procfs(5),
  kvm_uread() function, used for reading from /proc/pid/mem, was
  removed too. But the function declaration remained in kvm.h
  public header and the soname was not bumped.
  
  Remove kvm_uread() from kvm.h and bump the soname.
  
  Reported by:	rmh
  Discussed on:	arch

Modified:
  head/ObsoleteFiles.inc
  head/lib/libkvm/Makefile
  head/lib/libkvm/kvm.h

Modified: head/ObsoleteFiles.inc
==============================================================================
--- head/ObsoleteFiles.inc	Wed Jul 10 19:42:07 2013	(r253166)
+++ head/ObsoleteFiles.inc	Wed Jul 10 19:44:43 2013	(r253167)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20130710: libkvm version bump 
+OLD_LIBS+=lib/libkvm.so.5
+OLD_LIBS+=usr/lib32/libkvm.so.5
 # 20130623: dialog update from 1.1 to 1.2
 OLD_LIBS+=usr/lib/libdialog.so.7
 OLD_LIBS+=usr/lib32/libdialog.so.7

Modified: head/lib/libkvm/Makefile
==============================================================================
--- head/lib/libkvm/Makefile	Wed Jul 10 19:42:07 2013	(r253166)
+++ head/lib/libkvm/Makefile	Wed Jul 10 19:44:43 2013	(r253167)
@@ -3,6 +3,7 @@
 
 LIB=	kvm
 SHLIBDIR?= /lib
+SHLIB_MAJOR=	6
 CFLAGS+=-DLIBC_SCCS -I${.CURDIR}
 
 .if exists(${.CURDIR}/kvm_${MACHINE_ARCH}.c)

Modified: head/lib/libkvm/kvm.h
==============================================================================
--- head/lib/libkvm/kvm.h	Wed Jul 10 19:42:07 2013	(r253166)
+++ head/lib/libkvm/kvm.h	Wed Jul 10 19:44:43 2013	(r253167)
@@ -89,8 +89,6 @@ kvm_t	 *kvm_openfiles
 	    (const char *, const char *, const char *, int, char *);
 ssize_t	  kvm_read(kvm_t *, unsigned long, void *, size_t);
 ssize_t	  kvm_read_zpcpu(kvm_t *, void *, u_long, size_t, int);
-ssize_t	  kvm_uread
-	    (kvm_t *, const struct kinfo_proc *, unsigned long, char *, size_t);
 ssize_t	  kvm_write(kvm_t *, unsigned long, const void *, size_t);
 __END_DECLS
 

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 20:20:24 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 716E5E00;
 Wed, 10 Jul 2013 20:20:24 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 630EA19C9;
 Wed, 10 Jul 2013 20:20:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AKKOoV072130;
 Wed, 10 Jul 2013 20:20:24 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AKKONv072129;
 Wed, 10 Jul 2013 20:20:24 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201307102020.r6AKKONv072129@svn.freebsd.org>
From: Devin Teske 
Date: Wed, 10 Jul 2013 20:20:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253168 - stable/9/usr.sbin/bsdconfig/share
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 20:20:24 -0000

Author: dteske
Date: Wed Jul 10 20:20:23 2013
New Revision: 253168
URL: http://svnweb.freebsd.org/changeset/base/253168

Log:
  MFC r253121: Adjust comments to fit within 80-columns.

Modified:
  stable/9/usr.sbin/bsdconfig/share/dialog.subr

Modified: stable/9/usr.sbin/bsdconfig/share/dialog.subr
==============================================================================
--- stable/9/usr.sbin/bsdconfig/share/dialog.subr	Wed Jul 10 19:44:43 2013	(r253167)
+++ stable/9/usr.sbin/bsdconfig/share/dialog.subr	Wed Jul 10 20:20:23 2013	(r253168)
@@ -195,8 +195,8 @@ f_dialog_line_sanitize()
 # argument is NULL, the current title is returned.
 #
 # Each time this function is called, a backup of the current values is made
-# allowing a one-time (single-level) restoration of the previous title using the
-# f_dialog_title_restore() function (below).
+# allowing a one-time (single-level) restoration of the previous title using
+# the f_dialog_title_restore() function (below).
 #
 f_dialog_title()
 {

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 20:22:31 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 9E1AEFDF;
 Wed, 10 Jul 2013 20:22:31 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8FC9819E4;
 Wed, 10 Jul 2013 20:22:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AKMVY4072463;
 Wed, 10 Jul 2013 20:22:31 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AKMVCd072462;
 Wed, 10 Jul 2013 20:22:31 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201307102022.r6AKMVCd072462@svn.freebsd.org>
From: Devin Teske 
Date: Wed, 10 Jul 2013 20:22:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253169 - stable/9/usr.sbin/bsdconfig/share
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 20:22:31 -0000

Author: dteske
Date: Wed Jul 10 20:22:31 2013
New Revision: 253169
URL: http://svnweb.freebsd.org/changeset/base/253169

Log:
  MFC r253118: Fix conditional (der should match the comment above it).
  MFC r253117:
  
  Do two things: First, don't obscure the backtitle. Second, read ~/.dialogrc
  if it exists to determine if use_shadow is true (ON) or false (OFF).
  
  The purpose of determining the value of use_shadow is to know how many lines
  to subtract from the maximum height value in assuring that the backtitle is
  not obscured.
  
  The detriment of obscuring the backtitle is that it provides information
  that is not easily obtained elsewhere. That is the command-line shortcut
  used to access the current menu. As you navigate from one dialog to the
  next, invariably transparently corssing module boundaries, the backtitle
  represents the command-line argument used to get there. Obscuring this
  information with a widget that is too-tall and/or too-wide would see that
  data go unnoticed (leaving few other ways to get that information in the
  same helpful context).
  
  So despite the fact that this change reduces the standard maximum height for
  all widgets, there is a trap-door to prevent this calculation. If you want
  to utilize the full screen height on the terminal (remember, this adjustment
  is not made for Xdialog(1)) you can set $NO_BACKTITLE to 1 (or any non-NULL
  value for that matter) and this calculation will be skipped. You will be
  able to draw a widget that partially obscures the backtitle if-necessary.

Modified:
  stable/9/usr.sbin/bsdconfig/share/dialog.subr

Modified: stable/9/usr.sbin/bsdconfig/share/dialog.subr
==============================================================================
--- stable/9/usr.sbin/bsdconfig/share/dialog.subr	Wed Jul 10 20:20:23 2013	(r253168)
+++ stable/9/usr.sbin/bsdconfig/share/dialog.subr	Wed Jul 10 20:22:31 2013	(r253169)
@@ -292,7 +292,31 @@ f_dialog_max_size()
 		__max_size=$( stty size 2> /dev/null ) # usually "24 80"
 		: ${__max_size:=$DEFAULT_TERMINAL_SIZE}
 	fi
-	[ "$__var_height" ] && setvar "$__var_height" "${__max_size%%[$IFS]*}"
+	if [ "$__var_height" ]; then
+		local __height="${__max_size%%[$IFS]*}"
+		#
+		# If we're not using Xdialog(1), we should assume that $DIALOG
+		# will render --backtitle behind the widget. In such a case, we
+		# should prevent a widget from obscuring the backtitle (unless
+		# $NO_BACKTITLE is set and non-NULL, allowing a trap-door).
+		#
+		if [ ! "$USE_XDIALOG" ] && [ ! "$NO_BACKTITLE" ]; then
+			#
+			# If use_shadow (in ~/.dialogrc) is OFF, we need to
+			# subtract 4, otherwise 5. However, don't check this
+			# every time, rely on an initialization variable set
+			# by f_dialog_init().
+			#
+			local __adjust=5
+			[ "$NO_SHADOW" ] && __adjust=4
+
+			# Don't adjust height if already too small (allowing
+			# obscured backtitle for small values of __height).
+			[ ${__height:-0} -gt 11 ] &&
+				__height=$(( $__height - $__adjust ))
+		fi
+		setvar "$__var_height" "$__height"
+	fi
 	[ "$__var_width" ] && setvar "$__var_width" "${__max_size##*[$IFS]}"
 }
 
@@ -1999,6 +2023,12 @@ f_dialog_menutag2index_with_help()
 # 	              that (while running as root) sudo(8) authentication is
 # 	              required to proceed.
 #
+# Also reads ~/.dialogrc for the following information:
+#
+# 	NO_SHADOW     Either NULL or Non-NULL. If use_shadow is OFF (case-
+# 	              insensitive) in ~/.dialogrc this is set to "1" (otherwise
+# 	              unset).
+#
 f_dialog_init()
 {
 	DIALOG_SELF_INITIALIZE=
@@ -2058,6 +2088,22 @@ f_dialog_init()
 	fi
 
 	#
+	# Read ~/.dialogrc (unless using Xdialog(1)) for properties
+	#
+	if [ -f ~/.dialogrc -a ! "$USE_XDIALOG" ]; then
+		eval "$(
+			awk -v param=use_shadow -v expect=OFF \
+			    -v set="NO_SHADOW=1" '
+			!/^[[:space:]]*(#|$)/ && \
+			tolower($1) ~ "^"param"(=|$)" && \
+			/[^#]*=/ {
+				sub(/^[^=]*=[[:space:]]*/, "")
+				if ( toupper($1) == expect ) print set";"
+			}' ~/.dialogrc
+		)"
+	fi
+
+	#
 	# If we're already running as root but we got there by way of sudo(8)
 	# and we have X11, we should merge the xauth(1) credentials from our
 	# original user.

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 20:28:37 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 706F9354;
 Wed, 10 Jul 2013 20:28:37 +0000 (UTC)
 (envelope-from marcel@xcllnt.net)
Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214])
 by mx1.freebsd.org (Postfix) with ESMTP id 4F0821A29;
 Wed, 10 Jul 2013 20:28:36 +0000 (UTC)
Received: from amoroson-sslvpn-nc.jnpr.net (natint3.juniper.net
 [66.129.224.36]) (authenticated bits=0)
 by mail.xcllnt.net (8.14.7/8.14.7) with ESMTP id r6AJxk0W053747
 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO);
 Wed, 10 Jul 2013 12:59:47 -0700 (PDT)
 (envelope-from marcel@xcllnt.net)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\))
Subject: Re: svn commit: r253161 - head/sys/dev/uart
From: Marcel Moolenaar 
In-Reply-To: <201307101409.42228.jhb@freebsd.org>
Date: Wed, 10 Jul 2013 12:59:40 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201307101742.r6AHgKOm024113@svn.freebsd.org>
 <201307101405.44158.jhb@freebsd.org> <201307101409.42228.jhb@freebsd.org>
To: John Baldwin 
X-Mailer: Apple Mail (2.1508)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 Marcel Moolenaar , src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 20:28:37 -0000


On Jul 10, 2013, at 11:09 AM, John Baldwin  wrote:

> On Wednesday, July 10, 2013 2:05:43 pm John Baldwin wrote:
>> On Wednesday, July 10, 2013 1:42:20 pm Marcel Moolenaar wrote:
>>> Author: marcel
>>> Date: Wed Jul 10 17:42:20 2013
>>> New Revision: 253161
>>> URL: http://svnweb.freebsd.org/changeset/base/253161
>>>=20
>>> Log:
>>>  Protect against broken hardware. In this particular case, protect =
against
>>>  H/W not de-asserting the interrupt at all. On x86, and because of =
the
>>>  following conditions, this results in a hard hang with interrupts =
disabled:
>>>  1.  The uart(4) driver uses a spin lock to protect against =
concurrent
>>>      access to the H/W. Spin locks disable and restore interrupts.
>>>  2.  Restoring the interrupt on x86 always writes the flags =
register. Even
>>>      if we're restoring the interrupt from disabled to disabled.
>>>  3.  The x86 CPU has a short window in which interrupts are enabled =
when the
>>>      flags register is written.
>>=20
>> Do you have proof of this?

No. I only have proof of a hard hang during auto configuration that
cannot be fixed in any other way than not to setup the interrupt at
all.

--=20
Marcel Moolenaar
marcel@xcllnt.net



From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 20:56:04 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id C1080DB3;
 Wed, 10 Jul 2013 20:56:04 +0000 (UTC) (envelope-from pfg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id B2B871B6F;
 Wed, 10 Jul 2013 20:56:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AKu4ji081652;
 Wed, 10 Jul 2013 20:56:04 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AKu4dP081651;
 Wed, 10 Jul 2013 20:56:04 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201307102056.r6AKu4dP081651@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Wed, 10 Jul 2013 20:56:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253170 - stable/9/sys/fs/ext2fs
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 20:56:04 -0000

Author: pfg
Date: Wed Jul 10 20:56:04 2013
New Revision: 253170
URL: http://svnweb.freebsd.org/changeset/base/253170

Log:
  MFC	r252956:
  
  Implement SEEK_HOLE/SEEK_DATA for ext2fs.

Modified:
  stable/9/sys/fs/ext2fs/ext2_vnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_vnops.c	Wed Jul 10 20:22:31 2013	(r253169)
+++ stable/9/sys/fs/ext2fs/ext2_vnops.c	Wed Jul 10 20:56:04 2013	(r253170)
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -94,6 +95,7 @@ static vop_close_t	ext2_close;
 static vop_create_t	ext2_create;
 static vop_fsync_t	ext2_fsync;
 static vop_getattr_t	ext2_getattr;
+static vop_ioctl_t	ext2_ioctl;
 static vop_link_t	ext2_link;
 static vop_mkdir_t	ext2_mkdir;
 static vop_mknod_t	ext2_mknod;
@@ -124,6 +126,7 @@ struct vop_vector ext2_vnodeops = {
 	.vop_fsync =		ext2_fsync,
 	.vop_getattr =		ext2_getattr,
 	.vop_inactive =		ext2_inactive,
+	.vop_ioctl =		ext2_ioctl,
 	.vop_link =		ext2_link,
 	.vop_lookup =		vfs_cache_lookup,
 	.vop_mkdir =		ext2_mkdir,
@@ -1433,6 +1436,9 @@ ext2_pathconf(struct vop_pathconf_args *
 	case _PC_NO_TRUNC:
 		*ap->a_retval = 1;
 		return (0);
+	case _PC_MIN_HOLE_SIZE:
+		*ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize;
+		return(0);
 	default:
 		return (EINVAL);
 	}
@@ -1707,6 +1713,20 @@ ext2_read(struct vop_read_args *ap)
 	return (error);
 }
 
+static int
+ext2_ioctl(struct vop_ioctl_args *ap)
+{
+
+	switch (ap->a_command) {
+	case FIOSEEKDATA:
+	case FIOSEEKHOLE:
+		return (vn_bmap_seekhole(ap->a_vp, ap->a_command,
+		    (off_t *)ap->a_data, ap->a_cred));
+	default:
+		return (ENOTTY);
+	}
+}
+
 /*
  * Vnode op for writing.
  */

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 21:05:03 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id E876FF0;
 Wed, 10 Jul 2013 21:05:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id C04E71BDB;
 Wed, 10 Jul 2013 21:05:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AL53IV084691;
 Wed, 10 Jul 2013 21:05:03 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AL535O084689;
 Wed, 10 Jul 2013 21:05:03 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201307102105.r6AL535O084689@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Wed, 10 Jul 2013 21:05:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253171 - stable/9/usr.bin/sed
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 21:05:04 -0000

Author: pfg
Date: Wed Jul 10 21:05:03 2013
New Revision: 253171
URL: http://svnweb.freebsd.org/changeset/base/253171

Log:
  MFC	r252231:
  
  sed: use getline() instead of fgetln().
  
  In BSD, fgetln() available in libc but in Illumos the Solaris port had to
  include it internally. It also seems to have caused problems [1].
  
  Aid portability by using getline() instead.

Modified:
  stable/9/usr.bin/sed/main.c
Directory Properties:
  stable/9/usr.bin/sed/   (props changed)

Modified: stable/9/usr.bin/sed/main.c
==============================================================================
--- stable/9/usr.bin/sed/main.c	Wed Jul 10 20:56:04 2013	(r253170)
+++ stable/9/usr.bin/sed/main.c	Wed Jul 10 21:05:03 2013	(r253171)
@@ -1,4 +1,5 @@
 /*-
+ * Copyright (c) 2013 Johann 'Myrkraverk' Oskarsson.
  * Copyright (c) 1992 Diomidis Spinellis.
  * Copyright (c) 1992, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -57,6 +58,7 @@ static const char sccsid[] = "@(#)main.c
 #include 
 #include 
 #include 
+#define _WITH_GETLINE
 #include 
 #include 
 #include 
@@ -307,8 +309,9 @@ int
 mf_fgets(SPACE *sp, enum e_spflag spflag)
 {
 	struct stat sb;
-	size_t len;
-	char *p;
+	ssize_t len;
+	static char *p = NULL;
+	static size_t plen = 0;
 	int c;
 	static int firstfile;
 
@@ -424,13 +427,13 @@ mf_fgets(SPACE *sp, enum e_spflag spflag
 	 * We are here only when infile is open and we still have something
 	 * to read from it.
 	 *
-	 * Use fgetln so that we can handle essentially infinite input data.
-	 * Can't use the pointer into the stdio buffer as the process space
-	 * because the ungetc() can cause it to move.
+	 * Use getline() so that we can handle essentially infinite input
+	 * data.  The p and plen are static so each invocation gives
+	 * getline() the same buffer which is expanded as needed.
 	 */
-	p = fgetln(infile, &len);
-	if (ferror(infile))
-		errx(1, "%s: %s", fname, strerror(errno ? errno : EIO));
+	len = getline(&p, &plen, infile);
+	if (len == -1)
+		err(1, "%s", fname);
 	if (len != 0 && p[len - 1] == '\n')
 		len--;
 	cspace(sp, p, len, spflag);

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 21:37:51 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 6D88FB80;
 Wed, 10 Jul 2013 21:37:51 +0000 (UTC)
 (envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 408AF1D11;
 Wed, 10 Jul 2013 21:37:51 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6ALbpjk094268;
 Wed, 10 Jul 2013 21:37:51 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6ALbpl7094267;
 Wed, 10 Jul 2013 21:37:51 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201307102137.r6ALbpl7094267@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 10 Jul 2013 21:37:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253172 - head/sys/boot/ficl
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 21:37:51 -0000

Author: marcel
Date: Wed Jul 10 21:37:50 2013
New Revision: 253172
URL: http://svnweb.freebsd.org/changeset/base/253172

Log:
  Add 2 builtin words for working with directories:
  	isdir?		( fd -- bool )
  	freaddir	( fd -- ptr len TRUE | FALSE )
  
  The 'isdir?' word returns `true' if the file descriptor is for a
  directory and `false' otherwise.
  
  The 'freaddir' word reads the next directory entry and if successful,
  returns its name and 'true'. Otherwise 'false' is returned.
  
  These words give the loader the ability to scan directories and read
  files contained in them for 'rc.d'-like flexibility in handling which
  modules to load and/or which tunables to set.
  
  Obtained from:	Juniper Networks, Inc.

Modified:
  head/sys/boot/ficl/loader.c

Modified: head/sys/boot/ficl/loader.c
==============================================================================
--- head/sys/boot/ficl/loader.c	Wed Jul 10 21:05:03 2013	(r253171)
+++ head/sys/boot/ficl/loader.c	Wed Jul 10 21:37:50 2013	(r253172)
@@ -404,6 +404,34 @@ static void displayCellNoPad(FICL_VM *pV
     return;
 }
 
+/*      isdir? - Return whether an fd corresponds to a directory.
+ *
+ * isdir? ( fd -- bool )
+ */
+static void isdirQuestion(FICL_VM *pVM)
+{
+    struct stat sb;
+    FICL_INT flag;
+    int fd;
+
+#if FICL_ROBUST > 1
+    vmCheckStack(pVM, 1, 1);
+#endif
+
+    fd = stackPopINT(pVM->pStack);
+    flag = FICL_FALSE;
+    do {
+        if (fd < 0)
+            break;
+        if (fstat(fd, &sb) < 0)
+            break;
+        if (!S_ISDIR(sb.st_mode))
+            break;
+        flag = FICL_TRUE;
+    } while (0);
+    stackPushINT(pVM->pStack, flag);
+}
+
 /*          fopen - open a file and return new fd on stack.
  *
  * fopen ( ptr count mode -- fd )
@@ -477,6 +505,30 @@ static void pfread(FICL_VM *pVM)
     return;
 }
 
+/*      freaddir - read directory contents
+ *
+ * freaddir ( fd -- ptr len TRUE | FALSE )
+ */
+static void pfreaddir(FICL_VM *pVM)
+{
+    struct dirent *d;
+    int fd;
+
+#if FICL_ROBUST > 1
+    vmCheckStack(pVM, 1, 3);
+#endif
+
+    fd = stackPopINT(pVM->pStack);
+    d = readdirfd(fd);
+    if (d != NULL) {
+        stackPushPtr(pVM->pStack, d->d_name);
+        stackPushINT(pVM->pStack, strlen(d->d_name));
+        stackPushINT(pVM->pStack, FICL_TRUE);
+    } else {
+        stackPushINT(pVM->pStack, FICL_FALSE);
+    }
+}
+
 /*          fload - interpret file contents
  *
  * fload  ( fd -- )
@@ -653,9 +705,11 @@ void ficlCompilePlatform(FICL_SYSTEM *pS
     assert (dp);
 
     dictAppendWord(dp, ".#",        displayCellNoPad,    FW_DEFAULT);
+    dictAppendWord(dp, "isdir?",    isdirQuestion,  FW_DEFAULT);
     dictAppendWord(dp, "fopen",	    pfopen,	    FW_DEFAULT);
     dictAppendWord(dp, "fclose",    pfclose,	    FW_DEFAULT);
     dictAppendWord(dp, "fread",	    pfread,	    FW_DEFAULT);
+    dictAppendWord(dp, "freaddir",  pfreaddir,	    FW_DEFAULT);
     dictAppendWord(dp, "fload",	    pfload,	    FW_DEFAULT);
     dictAppendWord(dp, "fkey",	    fkey,	    FW_DEFAULT);
     dictAppendWord(dp, "fseek",     pfseek,	    FW_DEFAULT);

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 22:03:01 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id D52B7365;
 Wed, 10 Jul 2013 22:03:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id ACE811E29;
 Wed, 10 Jul 2013 22:03:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AM31tK002531;
 Wed, 10 Jul 2013 22:03:01 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AM31GI002530;
 Wed, 10 Jul 2013 22:03:01 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201307102203.r6AM31GI002530@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Wed, 10 Jul 2013 22:03:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253173 - head/sys/fs/ext2fs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 22:03:01 -0000

Author: pfg
Date: Wed Jul 10 22:03:01 2013
New Revision: 253173
URL: http://svnweb.freebsd.org/changeset/base/253173

Log:
  Implement 1003.1-2001 pathconf() keys.
  
  This is based on r106058 in UFS.
  
  MFC after:	1 month

Modified:
  head/sys/fs/ext2fs/ext2_vnops.c

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vnops.c	Wed Jul 10 21:37:50 2013	(r253172)
+++ head/sys/fs/ext2fs/ext2_vnops.c	Wed Jul 10 22:03:01 2013	(r253173)
@@ -1410,33 +1410,68 @@ ext2fifo_kqfilter(struct vop_kqfilter_ar
 static int
 ext2_pathconf(struct vop_pathconf_args *ap)
 {
+	int error = 0;
 
 	switch (ap->a_name) {
 	case _PC_LINK_MAX:
 		*ap->a_retval = EXT2_LINK_MAX;
-		return (0);
+		break;
 	case _PC_NAME_MAX:
 		*ap->a_retval = NAME_MAX;
-		return (0);
+		break;
 	case _PC_PATH_MAX:
 		*ap->a_retval = PATH_MAX;
-		return (0);
+		break;
 	case _PC_PIPE_BUF:
 		*ap->a_retval = PIPE_BUF;
-		return (0);
+		break;
 	case _PC_CHOWN_RESTRICTED:
 		*ap->a_retval = 1;
-		return (0);
+		break;
 	case _PC_NO_TRUNC:
 		*ap->a_retval = 1;
-		return (0);
+		break;
 	case _PC_MIN_HOLE_SIZE:
 		*ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize;
-		return(0);
+		break;
+	case _PC_ASYNC_IO:
+		/* _PC_ASYNC_IO should have been handled by upper layers. */
+		KASSERT(0, ("_PC_ASYNC_IO should not get here"));
+		error = EINVAL;
+		break;
+	case _PC_PRIO_IO:
+		*ap->a_retval = 0;
+		break;
+	case _PC_SYNC_IO:
+		*ap->a_retval = 0;
+		break;
+	case _PC_ALLOC_SIZE_MIN:
+		*ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_bsize;
+		break;
+	case _PC_FILESIZEBITS:
+		*ap->a_retval = 64;
+		break;
+	case _PC_REC_INCR_XFER_SIZE:
+		*ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize;
+		break;
+	case _PC_REC_MAX_XFER_SIZE:
+		*ap->a_retval = -1; /* means ``unlimited'' */
+		break;
+	case _PC_REC_MIN_XFER_SIZE:
+		*ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize;
+		break;
+	case _PC_REC_XFER_ALIGN:
+		*ap->a_retval = PAGE_SIZE;
+		break;
+	case _PC_SYMLINK_MAX:
+		*ap->a_retval = MAXPATHLEN;
+		break;
+
 	default:
-		return (EINVAL);
+		error = EINVAL;
+		break;
 	}
-	/* NOTREACHED */
+	return (error);
 }
 
 /*

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 22:12:49 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 2C60674A;
 Wed, 10 Jul 2013 22:12:49 +0000 (UTC)
 (envelope-from marino@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 1E2C21E88;
 Wed, 10 Jul 2013 22:12:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AMCmrt005722;
 Wed, 10 Jul 2013 22:12:48 GMT (envelope-from marino@svn.freebsd.org)
Received: (from marino@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AMCm5c005721;
 Wed, 10 Jul 2013 22:12:48 GMT (envelope-from marino@svn.freebsd.org)
Message-Id: <201307102212.r6AMCm5c005721@svn.freebsd.org>
From: John Marino 
Date: Wed, 10 Jul 2013 22:12:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253174 - head/share/misc
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 22:12:49 -0000

Author: marino (ports committer)
Date: Wed Jul 10 22:12:48 2013
New Revision: 253174
URL: http://svnweb.freebsd.org/changeset/base/253174

Log:
  Add John Marino to committers-port.dot
  
  Approved by:	bapt (mentor)

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

Modified: head/share/misc/committers-ports.dot
==============================================================================
--- head/share/misc/committers-ports.dot	Wed Jul 10 22:03:01 2013	(r253173)
+++ head/share/misc/committers-ports.dot	Wed Jul 10 22:12:48 2013	(r253174)
@@ -143,6 +143,7 @@ maho [label="Maho Nakata\nmaho@FreeBSD.o
 makc [label="Max Brazhnikov\nmakc@FreeBSD.org\n2008/08/25"]
 mandree [label="Matthias Andree\nmandree@FreeBSD.org\n2009/11/18"]
 marcus [label="Joe Marcus Clarke\nmarcus@FreeBSD.org\n2002/04/05"]
+marino [label="John Marino\nmarino@FreeBSD.org\n2013/07/04"]
 marius [label="Marius Strobl\nmarius@FreeBSD.org\n2012/12/29"]
 markus [label="Markus Brueffer\nmarkus@FreeBSD.org\n2004/02/21"]
 martymac [label="Ganael Laplanche\nmartymac@FreeBSD.org\n2010/09/24"]
@@ -247,6 +248,7 @@ bapt -> bdrewery
 bapt -> eadler
 bapt -> jlaffaye
 bapt -> marius
+bapt -> marino
 
 beat -> decke
 beat -> marius
@@ -276,6 +278,7 @@ crees -> tijl
 
 culot -> jase
 culot -> wg
+culot -> marino
 
 db -> tj
 

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 22:45:08 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 3EE4E177;
 Wed, 10 Jul 2013 22:45:08 +0000 (UTC)
 (envelope-from dteske@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 307241FBE;
 Wed, 10 Jul 2013 22:45:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6AMj8xB014630;
 Wed, 10 Jul 2013 22:45:08 GMT (envelope-from dteske@svn.freebsd.org)
Received: (from dteske@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6AMj8dk014629;
 Wed, 10 Jul 2013 22:45:08 GMT (envelope-from dteske@svn.freebsd.org)
Message-Id: <201307102245.r6AMj8dk014629@svn.freebsd.org>
From: Devin Teske 
Date: Wed, 10 Jul 2013 22:45:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253175 - head/usr.sbin/bsdconfig/share
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 22:45:08 -0000

Author: dteske
Date: Wed Jul 10 22:45:07 2013
New Revision: 253175
URL: http://svnweb.freebsd.org/changeset/base/253175

Log:
  Introduce a new [yet unused] function for [efficiently] getting the path to
  an executable by-name without forking or using externals.
  
  In a performance benchmark of 10,000 runs on circa 2006 hardware, f_which
  out-performed `which' with an average completion time of ~2.5 seconds versus
  ~56 seconds.
  
  This should be handy for future use (not that I make it a habit to call
  `which' in a loop 10,000 times).

Modified:
  head/usr.sbin/bsdconfig/share/common.subr

Modified: head/usr.sbin/bsdconfig/share/common.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/common.subr	Wed Jul 10 22:12:48 2013	(r253174)
+++ head/usr.sbin/bsdconfig/share/common.subr	Wed Jul 10 22:45:07 2013	(r253175)
@@ -212,6 +212,35 @@ f_have()
 	f_quietly type "$@"
 }
 
+# f_which $anything [$var_to_set]
+#
+# A fast built-in replacement for syntaxes such as foo=$( which bar ). In a
+# comparison of 10,000 runs of this function versus which, this function
+# completed in under 3 seconds, while `which' took almost a full minute.
+#
+# If $var_to_set is missing or NULL, output is (like which) to standard out.
+# Returns success if a match was found, failure otherwise.
+#
+f_which()
+{
+	local __name="$1" __var_to_set="$2"
+	case "$__name" in */*|'') return $FAILURE; esac
+	local __p IFS=":" __found=
+	for __p in $PATH; do
+		local __exec="$__p/$__name"
+		[ -f "$__exec" -a -x "$__exec" ] && __found=1 && break
+	done
+	if [ "$__found" ]; then
+		if [ "$__var_to_set" ]; then
+			setvar "$__var_to_set" "$__exec"
+		else
+			echo "$__exec"
+		fi
+		return $SUCCESS
+	fi
+	return $FAILURE
+}
+
 # f_getvar $var_to_get [$var_to_set]
 #
 # Utility function designed to go along with the already-builtin setvar.

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 23:14:25 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 121AB7F5;
 Wed, 10 Jul 2013 23:14:25 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 03DD610D2;
 Wed, 10 Jul 2013 23:14:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6ANEOIC023517;
 Wed, 10 Jul 2013 23:14:24 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6ANEOUR023516;
 Wed, 10 Jul 2013 23:14:24 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201307102314.r6ANEOUR023516@svn.freebsd.org>
From: Jack F Vogel 
Date: Wed, 10 Jul 2013 23:14:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253176 - head/sys/dev/ixgbe
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 23:14:25 -0000

Author: jfv
Date: Wed Jul 10 23:14:24 2013
New Revision: 253176
URL: http://svnweb.freebsd.org/changeset/base/253176

Log:
  Fix to a panic found internally, bad pointer during rxeof
  processing. Thanks for John Baldwin for catching this. Not
  clearing the flag member of the rxbuf could result in a NULL
  mbuf pointer being used.
  
  MFC after:	2 days (this needs to get into 9.2!)

Modified:
  head/sys/dev/ixgbe/ixgbe.c

Modified: head/sys/dev/ixgbe/ixgbe.c
==============================================================================
--- head/sys/dev/ixgbe/ixgbe.c	Wed Jul 10 22:45:07 2013	(r253175)
+++ head/sys/dev/ixgbe/ixgbe.c	Wed Jul 10 23:14:24 2013	(r253176)
@@ -3943,6 +3943,7 @@ ixgbe_free_receive_ring(struct rx_ring *
 			rxbuf->buf->m_flags |= M_PKTHDR;
 			m_freem(rxbuf->buf);
 			rxbuf->buf = NULL;
+			rxbuf->flag = 0;
 		}
 	}
 }

From owner-svn-src-all@FreeBSD.ORG  Wed Jul 10 23:58:32 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 1CB40D26;
 Wed, 10 Jul 2013 23:58:32 +0000 (UTC)
 (envelope-from yaneurabeya@gmail.com)
Received: from mail-vc0-x22c.google.com (mail-vc0-x22c.google.com
 [IPv6:2607:f8b0:400c:c03::22c])
 by mx1.freebsd.org (Postfix) with ESMTP id 9C63F11EE;
 Wed, 10 Jul 2013 23:58:31 +0000 (UTC)
Received: by mail-vc0-f172.google.com with SMTP id ib11so6284442vcb.17
 for ; Wed, 10 Jul 2013 16:58:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=wI3mFey19Fy5XfGWqSow00VGAfxqzds6kz9qYHcbi8E=;
 b=LafCbKhAxuaZ1YitfPn0ZmszHeICGL4A6SupSEDR6MYLfT2v+RS2dnx8qQ9CqyeuKc
 qzTe03ISJgrDsPMXT1+zD9ZSJumJ9XD8Qobc/N9q0BIPpZ5wQJtzJp2Mo9yhZsDP5S6m
 Ful3AL0UtD4alSUX8qFjLC9bqzX4/MGGdoNUHJi/G51ETBCxnoZTjANF3T5b3HvelmlW
 UFmTkJqAq7clyxwricy7h2iKLNQAcPb/eQiLbE9AzkZLgnjEV0K0iUWFdRIYaEXuAJUv
 Kr6kWDjzvIy0ApMBycBwSROfsCYp/kIACqHV2rcOfsNvy121ZgDY1Sv1gPg5YNy4wFrk
 1ieA==
MIME-Version: 1.0
X-Received: by 10.52.16.77 with SMTP id e13mr17027131vdd.49.1373500710573;
 Wed, 10 Jul 2013 16:58:30 -0700 (PDT)
Received: by 10.220.146.145 with HTTP; Wed, 10 Jul 2013 16:58:30 -0700 (PDT)
In-Reply-To: <201307091120.22114.jhb@freebsd.org>
References: <201307082125.r68LPDlY023493@svn.freebsd.org>
 <3FF894D3-ACDF-4796-A682-F9F9DD8C943D@gmail.com>
 <201307091120.22114.jhb@freebsd.org>
Date: Wed, 10 Jul 2013 16:58:30 -0700
Message-ID: 
Subject: Re: svn commit: r253048 - in head/sys/ofed: drivers/net/mlx4
 include/linux
From: Garrett Cooper 
To: John Baldwin 
Content-Type: text/plain; charset=ISO-8859-1
Cc: svn-src-head ,
 svn-src-all ,
 src-committers , shahark@mellanox.com,
 acornehl@gmail.com
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 10 Jul 2013 23:58:32 -0000

On Tue, Jul 9, 2013 at 8:20 AM, John Baldwin  wrote:

...

> I hadn't seen it.  I had wondered if the '\n' issue was a generic sysfs thing.
> It sounds like it is and I'd be happy to revert the mlx4 change and alter the
> sysfs bits to manage the newline directly if that is more appropriate.

I'll doublecheck this, but basically I'm really adverse to diverging
from Linux in this area -- hence that's why I did what I did in the PR
I mentioned.

> I'd also like this to use sysctl_handle_string() if at all possible.  Are you in
> a position to test patches still?

Unfortunately I'm not right now :(. Anthony may or may not be able to
test this out (I used his machine when we were hacking around on IB
stuff).

> If so, maybe give this a whirl.  It's similar to yours except it uses
> sysctl_handle_string() and strlcat() rather than continuing to do things
> by hand.  It also outputs an empty string to userland if the attribute
> doesn't have a show method (your version would never pass out an old
> string in that case unlike the original code).

Can you please pass along a patch to Anthony and me so we can try and
apply it to test it out (Gmail's going to taint the inline patch, as
is the EMC Exchange server with the patch attachment)? If Anthony
still has the machine setup, then I'd be more than happy to test out
the patch :).

Thanks!

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 01:30:25 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 5A80AF8F;
 Thu, 11 Jul 2013 01:30:25 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 3284A17E6;
 Thu, 11 Jul 2013 01:30:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B1UPYF063635;
 Thu, 11 Jul 2013 01:30:25 GMT
 (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B1UP6h063634;
 Thu, 11 Jul 2013 01:30:25 GMT
 (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201307110130.r6B1UP6h063634@svn.freebsd.org>
From: Rick Macklem 
Date: Thu, 11 Jul 2013 01:30:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253177 - stable/9/sys/nfsclient
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 01:30:25 -0000

Author: rmacklem
Date: Thu Jul 11 01:30:24 2013
New Revision: 253177
URL: http://svnweb.freebsd.org/changeset/base/253177

Log:
  MFC: r252673
  A problem with the old NFS client where large writes to large files
  would sometimes result in a corrupted file was reported via email.
  This problem appears to have been caused by r251719 (reverting
  r251719 fixed the problem). Although I have not been able to
  reproduce this problem, I suspect it is caused by another thread
  increasing np->n_size after the mtx_unlock(&np->n_mtx) but before
  the vnode_pager_setsize() call. Since the np->n_mtx mutex serializes
  updates to np->n_size, doing the vnode_pager_setsize() with the
  mutex locked appears to avoid the problem.
  Unfortunately, vnode_pager_setsize() where the new size is smaller,
  cannot be called with a mutex held.
  This patch returns the semantics to be close to pre-r251719 such that the
  call to the vnode_pager_setsize() is only delayed until after the mutex is
  unlocked when np->n_size is shrinking. Since the file is growing
  when being written, I believe this will fix the corruption.
  
  Tested by:	remy.nonnenmacher@activnetworks.com

Modified:
  stable/9/sys/nfsclient/nfs_subs.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/nfsclient/nfs_subs.c
==============================================================================
--- stable/9/sys/nfsclient/nfs_subs.c	Wed Jul 10 23:14:24 2013	(r253176)
+++ stable/9/sys/nfsclient/nfs_subs.c	Thu Jul 11 01:30:24 2013	(r253177)
@@ -595,6 +595,7 @@ nfs_loadattrcache(struct vnode **vpp, st
 				vap->va_size = np->n_size;
 				np->n_attrstamp = 0;
 				KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
+				vnode_pager_setsize(vp, np->n_size);
 			} else if (np->n_flag & NMODIFIED) {
 				/*
 				 * We've modified the file: Use the larger
@@ -606,12 +607,22 @@ nfs_loadattrcache(struct vnode **vpp, st
 					np->n_size = vap->va_size;
 					np->n_flag |= NSIZECHANGED;
 				}
+				vnode_pager_setsize(vp, np->n_size);
+			} else if (vap->va_size < np->n_size) {
+				/*
+				 * When shrinking the size, the call to
+				 * vnode_pager_setsize() cannot be done
+				 * with the mutex held, so delay it until
+				 * after the mtx_unlock call.
+				 */
+				nsize = np->n_size = vap->va_size;
+				np->n_flag |= NSIZECHANGED;
+				setnsize = 1;
 			} else {
 				np->n_size = vap->va_size;
 				np->n_flag |= NSIZECHANGED;
+				vnode_pager_setsize(vp, np->n_size);
 			}
-			setnsize = 1;
-			nsize = vap->va_size;
 		} else {
 			np->n_size = vap->va_size;
 		}

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 02:10:23 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id D555B79B;
 Thu, 11 Jul 2013 02:10:23 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id C80A419EA;
 Thu, 11 Jul 2013 02:10:23 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B2ANoI074290;
 Thu, 11 Jul 2013 02:10:23 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B2ANNj074288;
 Thu, 11 Jul 2013 02:10:23 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307110210.r6B2ANNj074288@svn.freebsd.org>
From: Jim Harris 
Date: Thu, 11 Jul 2013 02:10:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253178 - head/share/man/man4
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 02:10:23 -0000

Author: jimharris
Date: Thu Jul 11 02:10:23 2013
New Revision: 253178
URL: http://svnweb.freebsd.org/changeset/base/253178

Log:
  Bump date for nvme(4) and nvd(4).
  
  MFC after:	3 days

Modified:
  head/share/man/man4/nvd.4
  head/share/man/man4/nvme.4

Modified: head/share/man/man4/nvd.4
==============================================================================
--- head/share/man/man4/nvd.4	Thu Jul 11 01:30:24 2013	(r253177)
+++ head/share/man/man4/nvd.4	Thu Jul 11 02:10:23 2013	(r253178)
@@ -33,7 +33,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 10, 2012
+.Dd July 9, 2013
 .Dt NVD 4
 .Os
 .Sh NAME

Modified: head/share/man/man4/nvme.4
==============================================================================
--- head/share/man/man4/nvme.4	Thu Jul 11 01:30:24 2013	(r253177)
+++ head/share/man/man4/nvme.4	Thu Jul 11 02:10:23 2013	(r253178)
@@ -33,7 +33,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 10, 2012
+.Dd July 9, 2013
 .Dt NVME 4
 .Os
 .Sh NAME

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 03:44:07 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 632DF78D;
 Thu, 11 Jul 2013 03:44:07 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 562281E1A;
 Thu, 11 Jul 2013 03:44:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B3i7Ws006728;
 Thu, 11 Jul 2013 03:44:07 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B3i7dL006727;
 Thu, 11 Jul 2013 03:44:07 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201307110344.r6B3i7dL006727@svn.freebsd.org>
From: Jack F Vogel 
Date: Thu, 11 Jul 2013 03:44:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253179 - head/sys/dev/ixgbe
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 03:44:07 -0000

Author: jfv
Date: Thu Jul 11 03:44:06 2013
New Revision: 253179
URL: http://svnweb.freebsd.org/changeset/base/253179

Log:
  Fix my last commit, flags rather than flag... duh.
  
  MFC after: 2 days

Modified:
  head/sys/dev/ixgbe/ixgbe.c

Modified: head/sys/dev/ixgbe/ixgbe.c
==============================================================================
--- head/sys/dev/ixgbe/ixgbe.c	Thu Jul 11 02:10:23 2013	(r253178)
+++ head/sys/dev/ixgbe/ixgbe.c	Thu Jul 11 03:44:06 2013	(r253179)
@@ -3943,7 +3943,7 @@ ixgbe_free_receive_ring(struct rx_ring *
 			rxbuf->buf->m_flags |= M_PKTHDR;
 			m_freem(rxbuf->buf);
 			rxbuf->buf = NULL;
-			rxbuf->flag = 0;
+			rxbuf->flags = 0;
 		}
 	}
 }

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 03:49:16 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 2C894924;
 Thu, 11 Jul 2013 03:49:16 +0000 (UTC)
 (envelope-from bryanv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 0D1391E47;
 Thu, 11 Jul 2013 03:49:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B3nFKT007356;
 Thu, 11 Jul 2013 03:49:15 GMT (envelope-from bryanv@svn.freebsd.org)
Received: (from bryanv@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B3nF3x007351;
 Thu, 11 Jul 2013 03:49:15 GMT (envelope-from bryanv@svn.freebsd.org)
Message-Id: <201307110349.r6B3nF3x007351@svn.freebsd.org>
From: Bryan Venteicher 
Date: Thu, 11 Jul 2013 03:49:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253180 - stable/9/share/man/man4
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 03:49:16 -0000

Author: bryanv
Date: Thu Jul 11 03:49:14 2013
New Revision: 253180
URL: http://svnweb.freebsd.org/changeset/base/253180

Log:
  MFC VirtIO r252703,r252707
  
  r252703: Document new cache write mode tunables/sysctl
  r252707: Minor cleanup and use my FreeBSD.org email
  
  Also change the release where first appeared closer to reality.

Modified:
  stable/9/share/man/man4/virtio.4
  stable/9/share/man/man4/virtio_balloon.4
  stable/9/share/man/man4/virtio_blk.4
  stable/9/share/man/man4/virtio_scsi.4
  stable/9/share/man/man4/vtnet.4
Directory Properties:
  stable/9/share/man/man4/   (props changed)

Modified: stable/9/share/man/man4/virtio.4
==============================================================================
--- stable/9/share/man/man4/virtio.4	Thu Jul 11 03:44:06 2013	(r253179)
+++ stable/9/share/man/man4/virtio.4	Thu Jul 11 03:49:14 2013	(r253180)
@@ -53,10 +53,10 @@ This emulation is often inefficient.
 .Pp
 VirtIO defines an interface for efficient I/O between the hypervisor and VM.
 The
-.Xr virtio 4
+.Nm
 module provides a shared memory transport called a virtqueue.
 The
-.Xr virtio_pci 4
+.Xr virtio_pci
 device driver represents an emulated PCI device that the hypervisor makes
 available to the VM.
 This device provides the probing, configuration, and 
@@ -89,9 +89,9 @@ device driver.
 .Xr vtnet 4
 .Sh HISTORY
 Support for VirtIO first appeared in
-.Fx 9.0 .
+.Fx 9.2 .
 .Sh AUTHORS
 .An -nosplit
 .Fx
 support for VirtIO was first added by
-.An Bryan Venteicher Aq bryanv@daemoninthecloset.org .
+.An Bryan Venteicher Aq bryanv@FreeBSD.org .

Modified: stable/9/share/man/man4/virtio_balloon.4
==============================================================================
--- stable/9/share/man/man4/virtio_balloon.4	Thu Jul 11 03:44:06 2013	(r253179)
+++ stable/9/share/man/man4/virtio_balloon.4	Thu Jul 11 03:49:14 2013	(r253180)
@@ -59,6 +59,6 @@ The hypervisor can later signal the ball
 The
 .Nm
 driver was written by
-.An Bryan Venteicher Aq bryanv@daemoninthecloset.org .
+.An Bryan Venteicher Aq bryanv@FreeBSD.org .
 It first appeared in
-.Fx 9.0 .
+.Fx 9.2 .

Modified: stable/9/share/man/man4/virtio_blk.4
==============================================================================
--- stable/9/share/man/man4/virtio_blk.4	Thu Jul 11 03:44:06 2013	(r253179)
+++ stable/9/share/man/man4/virtio_blk.4	Thu Jul 11 03:49:14 2013	(r253180)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 22, 2012
+.Dd July 2, 2013
 .Dt VIRTIO_BLK 4
 .Os
 .Sh NAME
@@ -53,11 +53,33 @@ Tunables can be set at the
 .Xr loader 8
 prompt before booting the kernel or stored in
 .Xr loader.conf 5 .
-.Bl -tag -width "xxxxxx"
+.Bl -tag -width indent
 .It Va hw.vtblk.no_ident
-This tunable disables retrieving the device identification string
-from the hypervisor.
+.It Va hw.vtblk. Ns Ar X Ns Va .no_ident
+.Pp
+These tunables disable retrieving the device identification string
+from the hypervisor either globally or per-device.
 The default value is 0.
+.It Va hw.vtblk.writecache_mode
+.It Va hw.vtblk. Ns Ar X Ns Va .writecache_mode
+.Pp
+These tunables determine the write cache mode globally or per-device.
+The mode can changed only if the ConfigWCE feature is negotiated.
+Set to 0 for writethrough mode, 1 for writeback mode, and -1 to leave
+it as-is.
+The default value is to leave as-is.
+.El
+.Sh SYSCTL VARIABLES
+The following variables are available as
+.Xr sysctl 8
+variables.
+.Bl -tag -width indent
+.It Va dev.vtblk. Ns Ar X Ns Va .writecache_mode
+.Pp
+The write cache mode of the device can be either writethrough (0) or
+writeback (1).
+If the ConfigWCE feature is negotiated, the write cache mode can
+be toggled between writethrough and writeback.
 .El
 .Sh SEE ALSO
 .Xr virtio 4
@@ -65,6 +87,6 @@ The default value is 0.
 The
 .Nm
 driver was written by
-.An Bryan Venteicher Aq bryanv@daemoninthecloset.org .
+.An Bryan Venteicher Aq bryanv@FreeBSD.org .
 It first appeared in
-.Fx 9.0 .
+.Fx 9.2 .

Modified: stable/9/share/man/man4/virtio_scsi.4
==============================================================================
--- stable/9/share/man/man4/virtio_scsi.4	Thu Jul 11 03:44:06 2013	(r253179)
+++ stable/9/share/man/man4/virtio_scsi.4	Thu Jul 11 03:49:14 2013	(r253180)
@@ -87,6 +87,6 @@ Enable tracing prints.
 The
 .Nm
 driver was written by
-.An Bryan Venteicher Aq bryanv@daemoninthecloset.org .
+.An Bryan Venteicher Aq bryanv@FreeBSD.org .
 It first appeared in
-.Fx 10.0 .
+.Fx 9.2 .

Modified: stable/9/share/man/man4/vtnet.4
==============================================================================
--- stable/9/share/man/man4/vtnet.4	Thu Jul 11 03:44:06 2013	(r253179)
+++ stable/9/share/man/man4/vtnet.4	Thu Jul 11 03:49:14 2013	(r253180)
@@ -89,9 +89,9 @@ The default value is 0.
 The
 .Nm
 driver was written by
-.An Bryan Venteicher Aq bryanv@daemoninthecloset.org .
+.An Bryan Venteicher Aq bryanv@FreeBSD.org .
 It first appeared in
-.Fx 9.0 .
+.Fx 9.2 .
 .Sh CAVEATS
 The
 .Nm

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 03:54:36 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id AA50DAA0;
 Thu, 11 Jul 2013 03:54:36 +0000 (UTC)
 (envelope-from grehan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 9CD161E6F;
 Thu, 11 Jul 2013 03:54:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B3sa2d009586;
 Thu, 11 Jul 2013 03:54:36 GMT (envelope-from grehan@svn.freebsd.org)
Received: (from grehan@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B3saLY009583;
 Thu, 11 Jul 2013 03:54:36 GMT (envelope-from grehan@svn.freebsd.org)
Message-Id: <201307110354.r6B3saLY009583@svn.freebsd.org>
From: Peter Grehan 
Date: Thu, 11 Jul 2013 03:54:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253181 - head/usr.sbin/bhyve
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 03:54:36 -0000

Author: grehan
Date: Thu Jul 11 03:54:35 2013
New Revision: 253181
URL: http://svnweb.freebsd.org/changeset/base/253181

Log:
  Implement RTC CMOS nvram. Init some fields that are used
  by FreeBSD and UEFI.
  Tested with nvram(4).
  
  Reviewed by:	neel

Added:
  head/usr.sbin/bhyve/rtc.h   (contents, props changed)
Modified:
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/rtc.c

Modified: head/usr.sbin/bhyve/bhyverun.c
==============================================================================
--- head/usr.sbin/bhyve/bhyverun.c	Thu Jul 11 03:49:14 2013	(r253180)
+++ head/usr.sbin/bhyve/bhyverun.c	Thu Jul 11 03:54:35 2013	(r253181)
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
 #include "xmsr.h"
 #include "ioapic.h"
 #include "spinup_ap.h"
+#include "rtc.h"
 
 #define	DEFAULT_GUEST_HZ	100
 #define	DEFAULT_GUEST_TSLICE	200
@@ -735,6 +736,8 @@ main(int argc, char *argv[])
 	init_mem();
 	init_inout();
 
+	rtc_init(ctx);
+
 	/*
 	 * Exit if a device emulation finds an error in it's initilization
 	 */

Modified: head/usr.sbin/bhyve/rtc.c
==============================================================================
--- head/usr.sbin/bhyve/rtc.c	Thu Jul 11 03:49:14 2013	(r253180)
+++ head/usr.sbin/bhyve/rtc.c	Thu Jul 11 03:54:35 2013	(r253181)
@@ -33,10 +33,15 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
+#include 
+#include 
+
 #include "inout.h"
+#include "rtc.h"
 
 #define	IO_RTC	0x70
 
@@ -64,16 +69,30 @@ __FBSDID("$FreeBSD$");
 #define RTC_STATUSD	0x0d	/* status register D (R) Lost Power */
 #define  RTCSD_PWR	 0x80	/* clock power OK */
 
-#define	RTC_DIAG	0x0e
+#define	RTC_NVRAM_START	0x0e
+#define	RTC_NVRAM_END	0x7f
+#define RTC_NVRAM_SZ	(128 - RTC_NVRAM_START)
+#define	nvoff(x)	((x) - RTC_NVRAM_START)
 
+#define	RTC_DIAG	0x0e
 #define RTC_RSTCODE	0x0f
-
 #define	RTC_EQUIPMENT	0x14
+#define	RTC_LMEM_LSB	0x34
+#define	RTC_LMEM_MSB	0x35
+#define	RTC_HMEM_LSB	0x5b
+#define	RTC_HMEM_SB	0x5c
+#define	RTC_HMEM_MSB	0x5d
+
+#define m_64KB		(64*1024)
+#define	m_16MB		(16*1024*1024)
+#define	m_4GB		(4ULL*1024*1024*1024)
 
 static int addr;
 
+static uint8_t rtc_nvram[RTC_NVRAM_SZ];
+
 /* XXX initialize these to default values as they would be from BIOS */
-static uint8_t status_a, status_b, rstcode;
+static uint8_t status_a, status_b;
 
 static u_char const bin2bcd_data[] = {
 	0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
@@ -135,14 +154,11 @@ rtc_addr_handler(struct vmctx *ctx, int 
 	case RTC_DAY:
 	case RTC_MONTH:
 	case RTC_YEAR:
-	case RTC_CENTURY:
 	case RTC_STATUSA:
 	case RTC_STATUSB:
 	case RTC_INTR:
 	case RTC_STATUSD:
-	case RTC_DIAG:
-	case RTC_RSTCODE:
-	case RTC_EQUIPMENT:
+	case RTC_NVRAM_START ... RTC_NVRAM_END:
 		break;
 	default:
 		return (-1);
@@ -217,9 +233,6 @@ rtc_data_handler(struct vmctx *ctx, int 
 		case RTC_YEAR:
 			*eax = rtcout(tm.tm_year % 100);
 			return (0);
-		case RTC_CENTURY:
-			*eax = rtcout(tm.tm_year / 100);
-			break;
 		case RTC_STATUSA:
 			*eax = status_a;
 			return (0);
@@ -232,14 +245,8 @@ rtc_data_handler(struct vmctx *ctx, int 
 		case RTC_STATUSD:
 			*eax = RTCSD_PWR;
 			return (0);
-		case RTC_DIAG:
-			*eax = 0;
-			return (0);
-		case RTC_RSTCODE:
-			*eax = rstcode;
-			return (0);
-		case RTC_EQUIPMENT:
-			*eax = 0;
+		case RTC_NVRAM_START ... RTC_NVRAM_END:
+			*eax = rtc_nvram[addr - RTC_NVRAM_START];
 			return (0);
 		default:
 			return (-1);
@@ -259,9 +266,6 @@ rtc_data_handler(struct vmctx *ctx, int 
 	case RTC_STATUSD:
 		/* ignore write */
 		break;
-	case RTC_RSTCODE:
-		rstcode = *eax;
-		break;
 	case RTC_SEC:
 	case RTC_MIN:
 	case RTC_HRS:
@@ -269,16 +273,58 @@ rtc_data_handler(struct vmctx *ctx, int 
 	case RTC_DAY:
 	case RTC_MONTH:
 	case RTC_YEAR:
-	case RTC_CENTURY:
 		/*
 		 * Ignore writes to the time of day registers
 		 */
 		break;
+	case RTC_NVRAM_START ... RTC_NVRAM_END:
+		rtc_nvram[addr - RTC_NVRAM_START] = *eax;
+		break;
 	default:
 		return (-1);
 	}
 	return (0);
 }
 
+void
+rtc_init(struct vmctx *ctx)
+{	
+	struct timeval cur;
+	struct tm tm;
+	size_t himem;
+	size_t lomem;
+	int err;
+
+	err = gettimeofday(&cur, NULL);
+	assert(err == 0);
+	(void) localtime_r(&cur.tv_sec, &tm);
+
+	memset(rtc_nvram, 0, sizeof(rtc_nvram));
+
+	rtc_nvram[nvoff(RTC_CENTURY)] = rtcout(tm.tm_year / 100);
+
+	/* XXX init diag/reset code/equipment/checksum ? */
+
+	/*
+	 * Report guest memory size in nvram cells as required by UEFI.
+	 * Little-endian encoding.
+	 * 0x34/0x35 - 64KB chunks above 16MB, below 4GB
+	 * 0x5b/0x5c/0x5d - 64KB chunks above 4GB
+	 */
+	err = vm_get_memory_seg(ctx, 0, &lomem);
+	assert(err == 0);
+
+	lomem = (lomem - m_16MB) / m_64KB;
+	rtc_nvram[nvoff(RTC_LMEM_LSB)] = lomem;
+	rtc_nvram[nvoff(RTC_LMEM_MSB)] = lomem >> 8;
+
+	if (vm_get_memory_seg(ctx, m_4GB, &himem) == 0) {	  
+		himem /= m_64KB;
+		rtc_nvram[nvoff(RTC_HMEM_LSB)] = himem;
+		rtc_nvram[nvoff(RTC_HMEM_SB)]  = himem >> 8;
+		rtc_nvram[nvoff(RTC_NVRAM_START)] = himem >> 16;
+	}
+}
+
 INOUT_PORT(rtc, IO_RTC, IOPORT_F_INOUT, rtc_addr_handler);
 INOUT_PORT(rtc, IO_RTC + 1, IOPORT_F_INOUT, rtc_data_handler);

Added: head/usr.sbin/bhyve/rtc.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.sbin/bhyve/rtc.h	Thu Jul 11 03:54:35 2013	(r253181)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2013  Peter Grehan 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _RTC_H_
+#define _RTC_H_
+
+void	rtc_init(struct vmctx *ctx);
+
+#endif /* _RTC_H_ */

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 04:47:44 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 92EA8714;
 Thu, 11 Jul 2013 04:47:44 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 85E8F1FEB;
 Thu, 11 Jul 2013 04:47:44 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B4liJq024732;
 Thu, 11 Jul 2013 04:47:44 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B4liXR024731;
 Thu, 11 Jul 2013 04:47:44 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307110447.r6B4liXR024731@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 11 Jul 2013 04:47:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253183 - stable/9/sys/fs/nullfs
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 04:47:44 -0000

Author: kib
Date: Thu Jul 11 04:47:44 2013
New Revision: 253183
URL: http://svnweb.freebsd.org/changeset/base/253183

Log:
  MFC r252714:
  The tvp vnode on rename is usually unlinked.  Drop the cached null
  vnode for tvp to allow the free of the lower vnode, if needed.
  
  PR:	kern/180236

Modified:
  stable/9/sys/fs/nullfs/null_vnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/nullfs/null_vnops.c
==============================================================================
--- stable/9/sys/fs/nullfs/null_vnops.c	Thu Jul 11 03:57:53 2013	(r253182)
+++ stable/9/sys/fs/nullfs/null_vnops.c	Thu Jul 11 04:47:44 2013	(r253183)
@@ -554,6 +554,7 @@ null_rename(struct vop_rename_args *ap)
 	struct vnode *fvp = ap->a_fvp;
 	struct vnode *fdvp = ap->a_fdvp;
 	struct vnode *tvp = ap->a_tvp;
+	struct null_node *tnn;
 
 	/* Check for cross-device rename. */
 	if ((fvp->v_mount != tdvp->v_mount) ||
@@ -568,7 +569,11 @@ null_rename(struct vop_rename_args *ap)
 		vrele(fvp);
 		return (EXDEV);
 	}
-	
+
+	if (tvp != NULL) {
+		tnn = VTONULL(tvp);
+		tnn->null_flags |= NULLV_DROP;
+	}
 	return (null_bypass((struct vop_generic_args *)ap));
 }
 

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 04:57:08 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id DC39A9EC;
 Thu, 11 Jul 2013 04:57:08 +0000 (UTC)
 (envelope-from alfred@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id CDDF9103B;
 Thu, 11 Jul 2013 04:57:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B4v8TQ027533;
 Thu, 11 Jul 2013 04:57:08 GMT (envelope-from alfred@svn.freebsd.org)
Received: (from alfred@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B4v8WZ027532;
 Thu, 11 Jul 2013 04:57:08 GMT (envelope-from alfred@svn.freebsd.org)
Message-Id: <201307110457.r6B4v8WZ027532@svn.freebsd.org>
From: Alfred Perlstein 
Date: Thu, 11 Jul 2013 04:57:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253184 - stable/9/sys/kern
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 04:57:08 -0000

Author: alfred
Date: Thu Jul 11 04:57:08 2013
New Revision: 253184
URL: http://svnweb.freebsd.org/changeset/base/253184

Log:
  Fix for lost software interrupts/cam lockup.
  
  MFC: 252683

Modified:
  stable/9/sys/kern/kern_intr.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_intr.c
==============================================================================
--- stable/9/sys/kern/kern_intr.c	Thu Jul 11 04:47:44 2013	(r253183)
+++ stable/9/sys/kern/kern_intr.c	Thu Jul 11 04:57:08 2013	(r253184)
@@ -841,7 +841,7 @@ ok:
 		 * again and remove this handler if it has already passed
 		 * it on the list.
 		 */
-		ie->ie_thread->it_need = 1;
+		atomic_store_rel_int(&ie->ie_thread->it_need, 1);
 	} else
 		TAILQ_REMOVE(&ie->ie_handlers, handler, ih_next);
 	thread_unlock(ie->ie_thread->it_thread);
@@ -912,7 +912,7 @@ intr_event_schedule_thread(struct intr_e
 	 * running.  Then, lock the thread and see if we actually need to
 	 * put it on the runqueue.
 	 */
-	it->it_need = 1;
+	atomic_store_rel_int(&it->it_need, 1);
 	thread_lock(td);
 	if (TD_AWAITING_INTR(td)) {
 		CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, p->p_pid,
@@ -990,7 +990,7 @@ ok:
 		 * again and remove this handler if it has already passed
 		 * it on the list.
 		 */
-		it->it_need = 1;
+		atomic_store_rel_int(&it->it_need, 1);
 	} else
 		TAILQ_REMOVE(&ie->ie_handlers, handler, ih_next);
 	thread_unlock(it->it_thread);
@@ -1066,7 +1066,7 @@ intr_event_schedule_thread(struct intr_e
 	 * running.  Then, lock the thread and see if we actually need to
 	 * put it on the runqueue.
 	 */
-	it->it_need = 1;
+	atomic_store_rel_int(&it->it_need, 1);
 	thread_lock(td);
 	if (TD_AWAITING_INTR(td)) {
 		CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, p->p_pid,
@@ -1256,7 +1256,7 @@ intr_event_execute_handlers(struct proc 
 		 * interrupt threads always invoke all of their handlers.
 		 */
 		if (ie->ie_flags & IE_SOFT) {
-			if (!ih->ih_need)
+			if (atomic_load_acq_int(&ih->ih_need) == 0)
 				continue;
 			else
 				atomic_store_rel_int(&ih->ih_need, 0);
@@ -1358,7 +1358,7 @@ ithread_loop(void *arg)
 		 * we are running, it will set it_need to note that we
 		 * should make another pass.
 		 */
-		while (ithd->it_need) {
+		while (atomic_load_acq_int(&ithd->it_need) != 0) {
 			/*
 			 * This might need a full read and write barrier
 			 * to make sure that this write posts before any
@@ -1377,7 +1377,8 @@ ithread_loop(void *arg)
 		 * set again, so we have to check it again.
 		 */
 		thread_lock(td);
-		if (!ithd->it_need && !(ithd->it_flags & (IT_DEAD | IT_WAIT))) {
+		if ((atomic_load_acq_int(&ithd->it_need) == 0) &&
+		    !(ithd->it_flags & (IT_DEAD | IT_WAIT))) {
 			TD_SET_IWAIT(td);
 			ie->ie_count = 0;
 			mi_switch(SW_VOL | SWT_IWAIT, NULL);
@@ -1538,7 +1539,7 @@ ithread_loop(void *arg)
 		 * we are running, it will set it_need to note that we
 		 * should make another pass.
 		 */
-		while (ithd->it_need) {
+		while (atomic_load_acq_int(&ithd->it_need) != 0) {
 			/*
 			 * This might need a full read and write barrier
 			 * to make sure that this write posts before any
@@ -1560,7 +1561,8 @@ ithread_loop(void *arg)
 		 * set again, so we have to check it again.
 		 */
 		thread_lock(td);
-		if (!ithd->it_need && !(ithd->it_flags & (IT_DEAD | IT_WAIT))) {
+		if ((atomic_load_acq_int(&ithd->it_need) == 0) &&
+		    !(ithd->it_flags & (IT_DEAD | IT_WAIT))) {
 			TD_SET_IWAIT(td);
 			ie->ie_count = 0;
 			mi_switch(SW_VOL | SWT_IWAIT, NULL);

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 05:10:36 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id CBC8AEC8;
 Thu, 11 Jul 2013 05:10:36 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id BF4F9108C;
 Thu, 11 Jul 2013 05:10:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B5AaOB033010;
 Thu, 11 Jul 2013 05:10:36 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B5Aa1l033009;
 Thu, 11 Jul 2013 05:10:36 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307110510.r6B5Aa1l033009@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 11 Jul 2013 05:10:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253185 - head/sys/i386/i386
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 05:10:36 -0000

Author: kib
Date: Thu Jul 11 05:10:36 2013
New Revision: 253185
URL: http://svnweb.freebsd.org/changeset/base/253185

Log:
  MFamd64 r253140:
  Clear m->object for the page taken from the delayed free list in
  pmap_pv_reclaim().
  
  Noted by:	alc

Modified:
  head/sys/i386/i386/pmap.c

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Thu Jul 11 04:57:08 2013	(r253184)
+++ head/sys/i386/i386/pmap.c	Thu Jul 11 05:10:36 2013	(r253185)
@@ -2311,6 +2311,7 @@ out:
 	if (m_pc == NULL && pv_vafree != 0 && free != NULL) {
 		m_pc = free;
 		free = (void *)m_pc->object;
+		m_pc->object = NULL;
 		/* Recycle a freed page table page. */
 		m_pc->wire_count = 1;
 		atomic_add_int(&cnt.v_wire_count, 1);

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 05:15:31 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 590A1DA;
 Thu, 11 Jul 2013 05:15:31 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 4CA3E10B0;
 Thu, 11 Jul 2013 05:15:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B5FVG9033847;
 Thu, 11 Jul 2013 05:15:31 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B5FVlX033846;
 Thu, 11 Jul 2013 05:15:31 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307110515.r6B5FVlX033846@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 11 Jul 2013 05:15:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253186 - head/sys/i386/i386
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 05:15:31 -0000

Author: kib
Date: Thu Jul 11 05:15:30 2013
New Revision: 253186
URL: http://svnweb.freebsd.org/changeset/base/253186

Log:
  Explicitely panic instead of possibly doing undefined things when
  ptelist KVA is exhausted.  Currently this cannot happen, the added
  panic serves as assert.
  
  Discussed with:	alc
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/i386/i386/pmap.c

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Thu Jul 11 05:10:36 2013	(r253185)
+++ head/sys/i386/i386/pmap.c	Thu Jul 11 05:15:30 2013	(r253186)
@@ -680,7 +680,7 @@ pmap_ptelist_alloc(vm_offset_t *head)
 
 	va = *head;
 	if (va == 0)
-		return (va);	/* Out of memory */
+		panic("pmap_ptelist_alloc: exhausted ptelist KVA");
 	pte = vtopte(va);
 	*head = *pte;
 	if (*head & PG_V)

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 05:36:26 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 9F59131B;
 Thu, 11 Jul 2013 05:36:26 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 938E21118;
 Thu, 11 Jul 2013 05:36:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B5aQtP039542;
 Thu, 11 Jul 2013 05:36:26 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B5aQeL039541;
 Thu, 11 Jul 2013 05:36:26 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307110536.r6B5aQeL039541@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 11 Jul 2013 05:36:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253187 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 05:36:26 -0000

Author: kib
Date: Thu Jul 11 05:36:26 2013
New Revision: 253187
URL: http://svnweb.freebsd.org/changeset/base/253187

Log:
  Do not invalidate page of the B_NOCACHE buffer or buffer after an I/O
  error if any user wired mappings exist.  Doing the invalidation
  destroys the user wiring.
  
  The change is the temporal measure to close the bug, the more proper
  fix is to delegate the invalidation of the page to upper layers
  always.
  
  Reported and tested by:	pho
  Reviewed by:	alc
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==============================================================================
--- head/sys/kern/vfs_bio.c	Thu Jul 11 05:15:30 2013	(r253186)
+++ head/sys/kern/vfs_bio.c	Thu Jul 11 05:36:26 2013	(r253187)
@@ -1692,7 +1692,8 @@ brelse(struct buf *bp)
 
 				KASSERT(presid >= 0, ("brelse: extra page"));
 				VM_OBJECT_WLOCK(obj);
-				vm_page_set_invalid(m, poffset, presid);
+				if (pmap_page_wired_mappings(m) == 0)
+					vm_page_set_invalid(m, poffset, presid);
 				VM_OBJECT_WUNLOCK(obj);
 				if (had_bogus)
 					printf("avoided corruption bug in bogus_page/brelse code\n");

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 05:38:40 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 32B3B481;
 Thu, 11 Jul 2013 05:38:40 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 26230112F;
 Thu, 11 Jul 2013 05:38:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B5ces9039826;
 Thu, 11 Jul 2013 05:38:40 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B5cepS039825;
 Thu, 11 Jul 2013 05:38:40 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307110538.r6B5cepS039825@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 11 Jul 2013 05:38:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253188 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 05:38:40 -0000

Author: kib
Date: Thu Jul 11 05:38:39 2013
New Revision: 253188
URL: http://svnweb.freebsd.org/changeset/base/253188

Log:
  In the vm_page_set_invalid() function, do not assert that the page is
  not busy, since its only caller brelse() can legitimately call it on
  busy page.  This happens for VOP_PUTPAGES() on filesystems that use
  buffers and which VOP_WRITE() method marked the buffer containing page
  as non-cacheable.
  
  Reported and tested by:	pho
  Reviewed by:	alc
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Thu Jul 11 05:36:26 2013	(r253187)
+++ head/sys/vm/vm_page.c	Thu Jul 11 05:38:39 2013	(r253188)
@@ -2631,8 +2631,6 @@ vm_page_set_invalid(vm_page_t m, int bas
 	vm_page_bits_t bits;
 
 	VM_OBJECT_ASSERT_WLOCKED(m->object);
-	KASSERT((m->oflags & VPO_BUSY) == 0,
-	    ("vm_page_set_invalid: page %p is busy", m));
 	bits = vm_page_bits(base, size);
 	if (m->valid == VM_PAGE_BITS_ALL && bits != 0)
 		pmap_remove_all(m);

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 05:47:27 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 9A56F89D;
 Thu, 11 Jul 2013 05:47:27 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 746AB11A0;
 Thu, 11 Jul 2013 05:47:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B5lRRL042536;
 Thu, 11 Jul 2013 05:47:27 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B5lRda042534;
 Thu, 11 Jul 2013 05:47:27 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307110547.r6B5lRda042534@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 11 Jul 2013 05:47:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253189 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 05:47:27 -0000

Author: kib
Date: Thu Jul 11 05:47:26 2013
New Revision: 253189
URL: http://svnweb.freebsd.org/changeset/base/253189

Log:
  Never remove user-wired pages from an object when doing
  msync(MS_INVALIDATE).  The vm_fault_copy_entry() requires that object
  range which corresponds to the user-wired vm_map_entry, is always
  fully populated.
  
  Add OBJPR_NOTWIRED flag for vm_object_page_remove() to request the
  preserving behaviour, use it when calling vm_object_page_remove() from
  vm_object_sync().
  
  Reported and tested by:	pho
  Reviewed by:	alc
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/sys/vm/vm_object.c
  head/sys/vm/vm_object.h

Modified: head/sys/vm/vm_object.c
==============================================================================
--- head/sys/vm/vm_object.c	Thu Jul 11 05:38:39 2013	(r253188)
+++ head/sys/vm/vm_object.c	Thu Jul 11 05:47:26 2013	(r253189)
@@ -1054,9 +1054,9 @@ vm_object_sync(vm_object_t object, vm_oo
 			 */
 			flags = OBJPR_NOTMAPPED;
 		else if (old_msync)
-			flags = 0;
+			flags = OBJPR_NOTWIRED;
 		else
-			flags = OBJPR_CLEANONLY;
+			flags = OBJPR_CLEANONLY | OBJPR_NOTWIRED;
 		vm_object_page_remove(object, OFF_TO_IDX(offset),
 		    OFF_TO_IDX(offset + size + PAGE_MASK), flags);
 	}
@@ -1892,7 +1892,8 @@ again:
 		vm_page_lock(p);
 		if ((wirings = p->wire_count) != 0 &&
 		    (wirings = pmap_page_wired_mappings(p)) != p->wire_count) {
-			if ((options & OBJPR_NOTMAPPED) == 0) {
+			if ((options & (OBJPR_NOTWIRED | OBJPR_NOTMAPPED)) ==
+			    0) {
 				pmap_remove_all(p);
 				/* Account for removal of wired mappings. */
 				if (wirings != 0)
@@ -1902,8 +1903,7 @@ again:
 				p->valid = 0;
 				vm_page_undirty(p);
 			}
-			vm_page_unlock(p);
-			continue;
+			goto next;
 		}
 		if (vm_page_sleep_if_busy(p, TRUE, "vmopar"))
 			goto again;
@@ -1912,12 +1912,12 @@ again:
 		if ((options & OBJPR_CLEANONLY) != 0 && p->valid != 0) {
 			if ((options & OBJPR_NOTMAPPED) == 0)
 				pmap_remove_write(p);
-			if (p->dirty) {
-				vm_page_unlock(p);
-				continue;
-			}
+			if (p->dirty)
+				goto next;
 		}
 		if ((options & OBJPR_NOTMAPPED) == 0) {
+			if ((options & OBJPR_NOTWIRED) != 0 && wirings != 0)
+				goto next;
 			pmap_remove_all(p);
 			/* Account for removal of wired mappings. */
 			if (wirings != 0) {
@@ -1929,6 +1929,7 @@ again:
 			}
 		}
 		vm_page_free(p);
+next:
 		vm_page_unlock(p);
 	}
 	vm_object_pip_wakeup(object);

Modified: head/sys/vm/vm_object.h
==============================================================================
--- head/sys/vm/vm_object.h	Thu Jul 11 05:38:39 2013	(r253188)
+++ head/sys/vm/vm_object.h	Thu Jul 11 05:47:26 2013	(r253189)
@@ -205,6 +205,7 @@ struct vm_object {
  */
 #define	OBJPR_CLEANONLY	0x1		/* Don't remove dirty pages. */
 #define	OBJPR_NOTMAPPED	0x2		/* Don't unmap pages. */
+#define	OBJPR_NOTWIRED	0x4		/* Don't remove wired pages. */
 
 TAILQ_HEAD(object_q, vm_object);
 

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 05:55:08 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id DE789D30;
 Thu, 11 Jul 2013 05:55:08 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id D1F12123E;
 Thu, 11 Jul 2013 05:55:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B5t878045371;
 Thu, 11 Jul 2013 05:55:08 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B5t8xG045368;
 Thu, 11 Jul 2013 05:55:08 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307110555.r6B5t8xG045368@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 11 Jul 2013 05:55:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253190 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 05:55:08 -0000

Author: kib
Date: Thu Jul 11 05:55:08 2013
New Revision: 253190
URL: http://svnweb.freebsd.org/changeset/base/253190

Log:
  The mlockall() or VM_MAP_WIRE_HOLESOK does not interact properly with
  parallel creation of the map entries, e.g. by mmap() or stack growing.
  It also breaks when other entry is wired in parallel.
  
  The vm_map_wire() iterates over the map entries in the region, and
  assumes that map entries it finds are marked as in transition before,
  also that any entry marked as in transition, are marked by the current
  invocation of vm_map_wire().  This is not true for new entries in the
  holes.
  
  Add the thread owner of the MAP_ENTRY_IN_TRANSITION flag to struct
  vm_map_entry.  In vm_map_wire() and vm_map_unwire(), only process the
  entries which transition owner is the current thread.
  
  Reported and tested by:	pho
  Reviewed by:	alc
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/sys/vm/vm_map.c
  head/sys/vm/vm_map.h

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Thu Jul 11 05:47:26 2013	(r253189)
+++ head/sys/vm/vm_map.c	Thu Jul 11 05:55:08 2013	(r253190)
@@ -2281,6 +2281,7 @@ vm_map_unwire(vm_map_t map, vm_offset_t 
 		 * above.)
 		 */
 		entry->eflags |= MAP_ENTRY_IN_TRANSITION;
+		entry->wiring_thread = curthread;
 		/*
 		 * Check the map for holes in the specified region.
 		 * If VM_MAP_WIRE_HOLESOK was specified, skip this check.
@@ -2313,8 +2314,24 @@ done:
 		else
 			KASSERT(result, ("vm_map_unwire: lookup failed"));
 	}
-	entry = first_entry;
-	while (entry != &map->header && entry->start < end) {
+	for (entry = first_entry; entry != &map->header && entry->start < end;
+	    entry = entry->next) {
+		/*
+		 * If VM_MAP_WIRE_HOLESOK was specified, an empty
+		 * space in the unwired region could have been mapped
+		 * while the map lock was dropped for draining
+		 * MAP_ENTRY_IN_TRANSITION.  Moreover, another thread
+		 * could be simultaneously wiring this new mapping
+		 * entry.  Detect these cases and skip any entries
+		 * marked as in transition by us.
+		 */
+		if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) == 0 ||
+		    entry->wiring_thread != curthread) {
+			KASSERT((flags & VM_MAP_WIRE_HOLESOK) != 0,
+			    ("vm_map_unwire: !HOLESOK and new/changed entry"));
+			continue;
+		}
+
 		if (rv == KERN_SUCCESS && (!user_unwire ||
 		    (entry->eflags & MAP_ENTRY_USER_WIRED))) {
 			if (user_unwire)
@@ -2330,15 +2347,15 @@ done:
 				    OBJ_FICTITIOUS) != 0);
 			}
 		}
-		KASSERT(entry->eflags & MAP_ENTRY_IN_TRANSITION,
-			("vm_map_unwire: in-transition flag missing"));
+		KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0,
+		    ("vm_map_unwire: in-transition flag missing"));
 		entry->eflags &= ~MAP_ENTRY_IN_TRANSITION;
+		entry->wiring_thread = NULL;
 		if (entry->eflags & MAP_ENTRY_NEEDS_WAKEUP) {
 			entry->eflags &= ~MAP_ENTRY_NEEDS_WAKEUP;
 			need_wakeup = TRUE;
 		}
 		vm_map_simplify_entry(map, entry);
-		entry = entry->next;
 	}
 	vm_map_unlock(map);
 	if (need_wakeup)
@@ -2432,6 +2449,7 @@ vm_map_wire(vm_map_t map, vm_offset_t st
 		 * above.)
 		 */
 		entry->eflags |= MAP_ENTRY_IN_TRANSITION;
+		entry->wiring_thread = curthread;
 		if ((entry->protection & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0
 		    || (entry->protection & prot) != prot) {
 			entry->eflags |= MAP_ENTRY_WIRE_SKIPPED;
@@ -2523,10 +2541,27 @@ done:
 		else
 			KASSERT(result, ("vm_map_wire: lookup failed"));
 	}
-	entry = first_entry;
-	while (entry != &map->header && entry->start < end) {
+	for (entry = first_entry; entry != &map->header && entry->start < end;
+	    entry = entry->next) {
 		if ((entry->eflags & MAP_ENTRY_WIRE_SKIPPED) != 0)
 			goto next_entry_done;
+
+		/*
+		 * If VM_MAP_WIRE_HOLESOK was specified, an empty
+		 * space in the unwired region could have been mapped
+		 * while the map lock was dropped for faulting in the
+		 * pages or draining MAP_ENTRY_IN_TRANSITION.
+		 * Moreover, another thread could be simultaneously
+		 * wiring this new mapping entry.  Detect these cases
+		 * and skip any entries marked as in transition by us.
+		 */
+		if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) == 0 ||
+		    entry->wiring_thread != curthread) {
+			KASSERT((flags & VM_MAP_WIRE_HOLESOK) != 0,
+			    ("vm_map_wire: !HOLESOK and new/changed entry"));
+			continue;
+		}
+
 		if (rv == KERN_SUCCESS) {
 			if (user_wire)
 				entry->eflags |= MAP_ENTRY_USER_WIRED;
@@ -2551,15 +2586,18 @@ done:
 			}
 		}
 	next_entry_done:
-		KASSERT(entry->eflags & MAP_ENTRY_IN_TRANSITION,
-			("vm_map_wire: in-transition flag missing"));
-		entry->eflags &= ~(MAP_ENTRY_IN_TRANSITION|MAP_ENTRY_WIRE_SKIPPED);
+		KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0,
+		    ("vm_map_wire: in-transition flag missing %p", entry));
+		KASSERT(entry->wiring_thread == curthread,
+		    ("vm_map_wire: alien wire %p", entry));
+		entry->eflags &= ~(MAP_ENTRY_IN_TRANSITION |
+		    MAP_ENTRY_WIRE_SKIPPED);
+		entry->wiring_thread = NULL;
 		if (entry->eflags & MAP_ENTRY_NEEDS_WAKEUP) {
 			entry->eflags &= ~MAP_ENTRY_NEEDS_WAKEUP;
 			need_wakeup = TRUE;
 		}
 		vm_map_simplify_entry(map, entry);
-		entry = entry->next;
 	}
 	vm_map_unlock(map);
 	if (need_wakeup)
@@ -3193,6 +3231,7 @@ vmspace_fork(struct vmspace *vm1, vm_oof
 			*new_entry = *old_entry;
 			new_entry->eflags &= ~(MAP_ENTRY_USER_WIRED |
 			    MAP_ENTRY_IN_TRANSITION);
+			new_entry->wiring_thread = NULL;
 			new_entry->wired_count = 0;
 			if (new_entry->eflags & MAP_ENTRY_VN_WRITECNT) {
 				vnode_pager_update_writecount(object,
@@ -3227,6 +3266,7 @@ vmspace_fork(struct vmspace *vm1, vm_oof
 			 */
 			new_entry->eflags &= ~(MAP_ENTRY_USER_WIRED |
 			    MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_VN_WRITECNT);
+			new_entry->wiring_thread = NULL;
 			new_entry->wired_count = 0;
 			new_entry->object.vm_object = NULL;
 			new_entry->cred = NULL;

Modified: head/sys/vm/vm_map.h
==============================================================================
--- head/sys/vm/vm_map.h	Thu Jul 11 05:47:26 2013	(r253189)
+++ head/sys/vm/vm_map.h	Thu Jul 11 05:55:08 2013	(r253190)
@@ -116,6 +116,7 @@ struct vm_map_entry {
 	int wired_count;		/* can be paged if = 0 */
 	vm_pindex_t next_read;		/* index of the next sequential read */
 	struct ucred *cred;		/* tmp storage for creator ref */
+	struct thread *wiring_thread;
 };
 
 #define MAP_ENTRY_NOSYNC		0x0001

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 05:58:29 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 82532E7E;
 Thu, 11 Jul 2013 05:58:29 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 7618C1250;
 Thu, 11 Jul 2013 05:58:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B5wTuv045773;
 Thu, 11 Jul 2013 05:58:29 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B5wT6x045772;
 Thu, 11 Jul 2013 05:58:29 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307110558.r6B5wT6x045772@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 11 Jul 2013 05:58:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253191 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 05:58:29 -0000

Author: kib
Date: Thu Jul 11 05:58:28 2013
New Revision: 253191
URL: http://svnweb.freebsd.org/changeset/base/253191

Log:
  The vm_fault() should not be allowed to proceed on the map entry which
  is being wired now.  The entry wired count is changed to non-zero in
  advance, before the map lock is dropped.  This makes the vm_fault() to
  perceive the entry as wired, and breaks the fragment which moves the
  wire count from the shadowed page, to the upper page, making the code
  unwiring non-wired page.
  
  On the other hand, the vm_fault() calls from vm_fault_wire() should be
  allowed to proceed, so only drain MAP_ENTRY_IN_TRANSITION from
  vm_fault() when wiring_thread is not current.
  
  Reported and tested by:	pho
  Reviewed by:	alc
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==============================================================================
--- head/sys/vm/vm_fault.c	Thu Jul 11 05:55:08 2013	(r253190)
+++ head/sys/vm/vm_fault.c	Thu Jul 11 05:58:28 2013	(r253191)
@@ -280,6 +280,19 @@ RetryFault:;
 		    (u_long)vaddr);
 	}
 
+	if (fs.entry->eflags & MAP_ENTRY_IN_TRANSITION &&
+	    fs.entry->wiring_thread != curthread) {
+		vm_map_unlock_read(fs.map);
+		vm_map_lock(fs.map);
+		if (vm_map_lookup_entry(fs.map, vaddr, &fs.entry) &&
+		    (fs.entry->eflags & MAP_ENTRY_IN_TRANSITION)) {
+			fs.entry->eflags |= MAP_ENTRY_NEEDS_WAKEUP;
+			vm_map_unlock_and_wait(fs.map, 0);
+		} else
+			vm_map_unlock(fs.map);
+		goto RetryFault;
+	}
+
 	/*
 	 * Make a reference to this object to prevent its disposal while we
 	 * are messing with it.  Once we have the reference, the map is free

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 06:48:54 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 131A9D57;
 Thu, 11 Jul 2013 06:48:54 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 0446D15BA;
 Thu, 11 Jul 2013 06:48:54 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B6mrCN061112;
 Thu, 11 Jul 2013 06:48:53 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B6mrUX061111;
 Thu, 11 Jul 2013 06:48:53 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201307110648.r6B6mrUX061111@svn.freebsd.org>
From: Dimitry Andric 
Date: Thu, 11 Jul 2013 06:48:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253192 - stable/9/contrib/llvm/lib/CodeGen/SelectionDAG
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 06:48:54 -0000

Author: dim
Date: Thu Jul 11 06:48:53 2013
New Revision: 253192
URL: http://svnweb.freebsd.org/changeset/base/253192

Log:
  MFC r253042:
  
  Pull in r185616 from llvm trunk:
  
    FastISel can only append to basic blocks.
  
    Compute the insertion point from the end of the basic block instead of
    skipping labels from the front.
  
    This caused failures in landing pads when live-in copies where inserted
    before instruction selection.
  
  I missed this change in r252720; without it, certain compilation flags
  can cause exception labels to not be generated, but still referenced,
  leading to link errors.
  
  Reported by:	zeising

Modified:
  stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
Directory Properties:
  stable/9/contrib/llvm/   (props changed)

Modified: stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
==============================================================================
--- stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp	Thu Jul 11 05:58:28 2013	(r253191)
+++ stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp	Thu Jul 11 06:48:53 2013	(r253192)
@@ -75,15 +75,12 @@ STATISTIC(NumFastIselDead, "Number of de
 void FastISel::startNewBlock() {
   LocalValueMap.clear();
 
+  // Instructions are appended to FuncInfo.MBB. If the basic block already
+  // contains labels or copies, use the last instruction as the last local
+  // value.
   EmitStartPt = 0;
-
-  // Advance the emit start point past any EH_LABEL instructions.
-  MachineBasicBlock::iterator
-    I = FuncInfo.MBB->begin(), E = FuncInfo.MBB->end();
-  while (I != E && I->getOpcode() == TargetOpcode::EH_LABEL) {
-    EmitStartPt = I;
-    ++I;
-  }
+  if (!FuncInfo.MBB->empty())
+    EmitStartPt = &FuncInfo.MBB->back();
   LastLocalValue = EmitStartPt;
 }
 

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 07:14:52 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 1C735A28;
 Thu, 11 Jul 2013 07:14:52 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 0E9F01705;
 Thu, 11 Jul 2013 07:14:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B7EpW6069623;
 Thu, 11 Jul 2013 07:14:51 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B7EpBu069621;
 Thu, 11 Jul 2013 07:14:51 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201307110714.r6B7EpBu069621@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 11 Jul 2013 07:14:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253193 - stable/9/sys/dev/sound/pci/hda
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 07:14:52 -0000

Author: mav
Date: Thu Jul 11 07:14:51 2013
New Revision: 253193
URL: http://svnweb.freebsd.org/changeset/base/253193

Log:
  MFC r253036:
  Add quirk to configure headphones redirection on ASUS UX31A laptop.

Modified:
  stable/9/sys/dev/sound/pci/hda/hdaa_patches.c
  stable/9/sys/dev/sound/pci/hda/hdac.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/sound/pci/hda/hdaa_patches.c
==============================================================================
--- stable/9/sys/dev/sound/pci/hda/hdaa_patches.c	Thu Jul 11 06:48:53 2013	(r253192)
+++ stable/9/sys/dev/sound/pci/hda/hdaa_patches.c	Thu Jul 11 07:14:51 2013	(r253193)
@@ -363,6 +363,13 @@ hdac_pin_patch(struct hdaa_widget *w)
 			patch = "as=1 seq=15";
 			break;
 		}
+	} else if (id == HDA_CODEC_ALC269 &&
+	    subid == ASUS_UX31A_SUBVENDOR) {
+		switch (nid) {
+		case 33:
+			patch = "as=1 seq=15";
+			break;
+		}
 	}
 
 	if (patch != NULL)

Modified: stable/9/sys/dev/sound/pci/hda/hdac.h
==============================================================================
--- stable/9/sys/dev/sound/pci/hda/hdac.h	Thu Jul 11 06:48:53 2013	(r253192)
+++ stable/9/sys/dev/sound/pci/hda/hdac.h	Thu Jul 11 07:14:51 2013	(r253193)
@@ -198,6 +198,7 @@
 #define ASUS_F3JC_SUBVENDOR	HDA_MODEL_CONSTRUCT(ASUS, 0x1338)
 #define ASUS_G2K_SUBVENDOR	HDA_MODEL_CONSTRUCT(ASUS, 0x1339)
 #define ASUS_A7T_SUBVENDOR	HDA_MODEL_CONSTRUCT(ASUS, 0x13c2)
+#define ASUS_UX31A_SUBVENDOR	HDA_MODEL_CONSTRUCT(ASUS, 0x1517)
 #define ASUS_W2J_SUBVENDOR	HDA_MODEL_CONSTRUCT(ASUS, 0x1971)
 #define ASUS_M5200_SUBVENDOR	HDA_MODEL_CONSTRUCT(ASUS, 0x1993)
 #define ASUS_P5PL2_SUBVENDOR	HDA_MODEL_CONSTRUCT(ASUS, 0x817f)

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 07:17:04 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 94F43B82;
 Thu, 11 Jul 2013 07:17:04 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 87628171D;
 Thu, 11 Jul 2013 07:17:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B7H4l1069981;
 Thu, 11 Jul 2013 07:17:04 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B7H45d069979;
 Thu, 11 Jul 2013 07:17:04 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201307110717.r6B7H45d069979@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 11 Jul 2013 07:17:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253194 - stable/9/sys/dev/ahci
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 07:17:04 -0000

Author: mav
Date: Thu Jul 11 07:17:03 2013
New Revision: 253194
URL: http://svnweb.freebsd.org/changeset/base/253194

Log:
  MFC r253069, r253074:
  Add one more ID of Marvell SATA controller.
  Add ID for Marvell 88SE9215 AHCI SATA controller.

Modified:
  stable/9/sys/dev/ahci/ahci.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/ahci/ahci.c
==============================================================================
--- stable/9/sys/dev/ahci/ahci.c	Thu Jul 11 07:14:51 2013	(r253193)
+++ stable/9/sys/dev/ahci/ahci.c	Thu Jul 11 07:17:03 2013	(r253194)
@@ -234,6 +234,8 @@ static struct {
 	{0x91301b4b, 0x00, "Marvell 88SE9130",  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
 	{0x91721b4b, 0x00, "Marvell 88SE9172",	AHCI_Q_NOBSYRES},
 	{0x91821b4b, 0x00, "Marvell 88SE9182",	AHCI_Q_NOBSYRES},
+	{0x91a01b4b, 0x00, "Marvell 88SE91Ax",	AHCI_Q_NOBSYRES},
+	{0x92151b4b, 0x00, "Marvell 88SE9215",  AHCI_Q_NOBSYRES},
 	{0x92201b4b, 0x00, "Marvell 88SE9220",  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
 	{0x92301b4b, 0x00, "Marvell 88SE9230",  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
 	{0x92351b4b, 0x00, "Marvell 88SE9235",  AHCI_Q_NOBSYRES},

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 08:18:01 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id DF3DDDA9;
 Thu, 11 Jul 2013 08:18:01 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id D00351A14;
 Thu, 11 Jul 2013 08:18:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B8I1Gx087769;
 Thu, 11 Jul 2013 08:18:01 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B8I1a4087767;
 Thu, 11 Jul 2013 08:18:01 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307110818.r6B8I1a4087767@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Thu, 11 Jul 2013 08:18:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253195 - stable/9/sys/dev/bge
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 08:18:02 -0000

Author: yongari
Date: Thu Jul 11 08:18:00 2013
New Revision: 253195
URL: http://svnweb.freebsd.org/changeset/base/253195

Log:
  MFC r245870:
    bge_attach() can fail before attaching mii(4). So make sure to check
    bge_miibus before detaching mii(4).

Modified:
  stable/9/sys/dev/bge/if_bge.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/bge/if_bge.c
==============================================================================
--- stable/9/sys/dev/bge/if_bge.c	Thu Jul 11 07:17:03 2013	(r253194)
+++ stable/9/sys/dev/bge/if_bge.c	Thu Jul 11 08:18:00 2013	(r253195)
@@ -3911,9 +3911,9 @@ bge_detach(device_t dev)
 	if (sc->bge_tq)
 		taskqueue_drain(sc->bge_tq, &sc->bge_intr_task);
 
-	if (sc->bge_flags & BGE_FLAG_TBI) {
+	if (sc->bge_flags & BGE_FLAG_TBI)
 		ifmedia_removeall(&sc->bge_ifmedia);
-	} else {
+	else if (sc->bge_miibus != NULL) {
 		bus_generic_detach(dev);
 		device_delete_child(dev, sc->bge_miibus);
 	}

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 08:18:46 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 9B5B8FB7;
 Thu, 11 Jul 2013 08:18:46 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8DDA61A2D;
 Thu, 11 Jul 2013 08:18:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B8IkH0087889;
 Thu, 11 Jul 2013 08:18:46 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B8Ikvu087888;
 Thu, 11 Jul 2013 08:18:46 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307110818.r6B8Ikvu087888@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Thu, 11 Jul 2013 08:18:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253196 - stable/8/sys/dev/bge
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 08:18:46 -0000

Author: yongari
Date: Thu Jul 11 08:18:46 2013
New Revision: 253196
URL: http://svnweb.freebsd.org/changeset/base/253196

Log:
  MFC r245870:
    bge_attach() can fail before attaching mii(4). So make sure to check
    bge_miibus before detaching mii(4).

Modified:
  stable/8/sys/dev/bge/if_bge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/bge/   (props changed)

Modified: stable/8/sys/dev/bge/if_bge.c
==============================================================================
--- stable/8/sys/dev/bge/if_bge.c	Thu Jul 11 08:18:00 2013	(r253195)
+++ stable/8/sys/dev/bge/if_bge.c	Thu Jul 11 08:18:46 2013	(r253196)
@@ -3924,9 +3924,9 @@ bge_detach(device_t dev)
 	if (sc->bge_tq)
 		taskqueue_drain(sc->bge_tq, &sc->bge_intr_task);
 
-	if (sc->bge_flags & BGE_FLAG_TBI) {
+	if (sc->bge_flags & BGE_FLAG_TBI)
 		ifmedia_removeall(&sc->bge_ifmedia);
-	} else {
+	else if (sc->bge_miibus != NULL) {
 		bus_generic_detach(dev);
 		device_delete_child(dev, sc->bge_miibus);
 	}

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 08:41:46 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 5E12F7DF;
 Thu, 11 Jul 2013 08:41:46 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 4EBC21B18;
 Thu, 11 Jul 2013 08:41:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B8fkfA096553;
 Thu, 11 Jul 2013 08:41:46 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B8fkCs096552;
 Thu, 11 Jul 2013 08:41:46 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307110841.r6B8fkCs096552@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Thu, 11 Jul 2013 08:41:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253197 - stable/9/sys/dev/bge
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 08:41:46 -0000

Author: yongari
Date: Thu Jul 11 08:41:45 2013
New Revision: 253197
URL: http://svnweb.freebsd.org/changeset/base/253197

Log:
  MFC r245867:
    For 57765 class controllers, set low watermark max receive frames to 1.

Modified:
  stable/9/sys/dev/bge/if_bge.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/bge/if_bge.c
==============================================================================
--- stable/9/sys/dev/bge/if_bge.c	Thu Jul 11 08:18:46 2013	(r253196)
+++ stable/9/sys/dev/bge/if_bge.c	Thu Jul 11 08:41:45 2013	(r253197)
@@ -5453,7 +5453,7 @@ bge_init_locked(struct bge_softc *sc)
 	 * this number of frames, it will drop subsequent incoming
 	 * frames until the MBUF High Watermark is reached.
 	 */
-	if (sc->bge_asicrev == BGE_ASICREV_BCM57765)
+	if (BGE_IS_57765_PLUS(sc))
 		CSR_WRITE_4(sc, BGE_MAX_RX_FRAME_LOWAT, 1);
 	else
 		CSR_WRITE_4(sc, BGE_MAX_RX_FRAME_LOWAT, 2);

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 08:42:18 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id F35F2911;
 Thu, 11 Jul 2013 08:42:17 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id E55681B1E;
 Thu, 11 Jul 2013 08:42:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B8gHX9096665;
 Thu, 11 Jul 2013 08:42:17 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B8gH1V096664;
 Thu, 11 Jul 2013 08:42:17 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307110842.r6B8gH1V096664@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Thu, 11 Jul 2013 08:42:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253198 - stable/8/sys/dev/bge
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 08:42:18 -0000

Author: yongari
Date: Thu Jul 11 08:42:17 2013
New Revision: 253198
URL: http://svnweb.freebsd.org/changeset/base/253198

Log:
  MFC r245867:
    For 57765 class controllers, set low watermark max receive frames to 1.

Modified:
  stable/8/sys/dev/bge/if_bge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/bge/   (props changed)

Modified: stable/8/sys/dev/bge/if_bge.c
==============================================================================
--- stable/8/sys/dev/bge/if_bge.c	Thu Jul 11 08:41:45 2013	(r253197)
+++ stable/8/sys/dev/bge/if_bge.c	Thu Jul 11 08:42:17 2013	(r253198)
@@ -5466,7 +5466,7 @@ bge_init_locked(struct bge_softc *sc)
 	 * this number of frames, it will drop subsequent incoming
 	 * frames until the MBUF High Watermark is reached.
 	 */
-	if (sc->bge_asicrev == BGE_ASICREV_BCM57765)
+	if (BGE_IS_57765_PLUS(sc))
 		CSR_WRITE_4(sc, BGE_MAX_RX_FRAME_LOWAT, 1);
 	else
 		CSR_WRITE_4(sc, BGE_MAX_RX_FRAME_LOWAT, 2);

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 08:50:31 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 07ACBCD9;
 Thu, 11 Jul 2013 08:50:31 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id ED21F1BA7;
 Thu, 11 Jul 2013 08:50:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B8oUdG099291;
 Thu, 11 Jul 2013 08:50:30 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B8oUQP099290;
 Thu, 11 Jul 2013 08:50:30 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307110850.r6B8oUQP099290@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Thu, 11 Jul 2013 08:50:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253199 - stable/8/sys/dev/bge
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 08:50:31 -0000

Author: yongari
Date: Thu Jul 11 08:50:30 2013
New Revision: 253199
URL: http://svnweb.freebsd.org/changeset/base/253199

Log:
  MFC r245926, r245931
    - Improve some comments.
    - Make bge_lookup_{rev,vendor}() static.
    - Factor out chip identification rather than duplicating the code.
    - Sanitize bge_probe() a bit (don't hardcode buffer sizes, allow
      bge_lookup_vendor() to return NULL so the excessive panic() can
      be removed there, etc.) and return BUS_PROBE_DEFAULT rather than
      hardcoding 0.
    - According to the Linux tg3 driver, BCM57791 and BCM57795 aren't
      capable of Gigabit Ethernet.
    - Check the return value of taskqueue_start_threads().
    - Mention NetLink controllers in the fallback description, too.

Modified:
  stable/8/sys/dev/bge/if_bge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/bge/   (props changed)

Modified: stable/8/sys/dev/bge/if_bge.c
==============================================================================
--- stable/8/sys/dev/bge/if_bge.c	Thu Jul 11 08:42:17 2013	(r253198)
+++ stable/8/sys/dev/bge/if_bge.c	Thu Jul 11 08:50:30 2013	(r253199)
@@ -35,10 +35,10 @@
 __FBSDID("$FreeBSD$");
 
 /*
- * Broadcom BCM570x family gigabit ethernet driver for FreeBSD.
+ * Broadcom BCM57xx(x)/BCM590x NetXtreme and NetLink family Ethernet driver
  *
  * The Broadcom BCM5700 is based on technology originally developed by
- * Alteon Networks as part of the Tigon I and Tigon II gigabit ethernet
+ * Alteon Networks as part of the Tigon I and Tigon II Gigabit Ethernet
  * MAC chips. The BCM5700, sometimes referred to as the Tigon III, has
  * two on-board MIPS R4000 CPUs and can have as much as 16MB of external
  * SSRAM. The BCM5700 supports TCP, UDP and IP checksum offload, jumbo
@@ -367,8 +367,9 @@ static const struct bge_revision bge_maj
 #define	BGE_IS_5717_PLUS(sc)		((sc)->bge_flags & BGE_FLAG_5717_PLUS)
 #define	BGE_IS_57765_PLUS(sc)		((sc)->bge_flags & BGE_FLAG_57765_PLUS)
 
-const struct bge_revision * bge_lookup_rev(uint32_t);
-const struct bge_vendor * bge_lookup_vendor(uint16_t);
+static uint32_t bge_chipid(device_t);
+static const struct bge_vendor * bge_lookup_vendor(uint16_t);
+static const struct bge_revision * bge_lookup_rev(uint32_t);
 
 typedef int	(*bge_eaddr_fcn_t)(struct bge_softc *, uint8_t[]);
 
@@ -1916,7 +1917,7 @@ bge_chipinit(struct bge_softc *sc)
 	PCI_CLRBIT(sc->bge_dev, BGE_PCI_CMD,
 	    PCIM_CMD_INTxDIS | PCIM_CMD_MWIEN, 4);
 
-	/* Set the timer prescaler (always 66Mhz) */
+	/* Set the timer prescaler (always 66 MHz). */
 	CSR_WRITE_4(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ);
 
 	/* XXX: The Linux tg3 driver does this at the start of brgphy_reset. */
@@ -2586,7 +2587,7 @@ bge_blockinit(struct bge_softc *sc)
 	return (0);
 }
 
-const struct bge_revision *
+static const struct bge_revision *
 bge_lookup_rev(uint32_t chipid)
 {
 	const struct bge_revision *br;
@@ -2604,7 +2605,7 @@ bge_lookup_rev(uint32_t chipid)
 	return (NULL);
 }
 
-const struct bge_vendor *
+static const struct bge_vendor *
 bge_lookup_vendor(uint16_t vid)
 {
 	const struct bge_vendor *v;
@@ -2613,10 +2614,47 @@ bge_lookup_vendor(uint16_t vid)
 		if (v->v_id == vid)
 			return (v);
 
-	panic("%s: unknown vendor %d", __func__, vid);
 	return (NULL);
 }
 
+static uint32_t
+bge_chipid(device_t dev)
+{
+	uint32_t id;
+
+	id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >>
+	    BGE_PCIMISCCTL_ASICREV_SHIFT;
+	if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) {
+		/*
+		 * Find the ASCI revision.  Different chips use different
+		 * registers.
+		 */
+		switch (pci_get_device(dev)) {
+		case BCOM_DEVICEID_BCM5717:
+		case BCOM_DEVICEID_BCM5718:
+		case BCOM_DEVICEID_BCM5719:
+		case BCOM_DEVICEID_BCM5720:
+			id = pci_read_config(dev,
+			    BGE_PCI_GEN2_PRODID_ASICREV, 4);
+			break;
+		case BCOM_DEVICEID_BCM57761:
+		case BCOM_DEVICEID_BCM57762:
+		case BCOM_DEVICEID_BCM57765:
+		case BCOM_DEVICEID_BCM57766:
+		case BCOM_DEVICEID_BCM57781:
+		case BCOM_DEVICEID_BCM57785:
+		case BCOM_DEVICEID_BCM57791:
+		case BCOM_DEVICEID_BCM57795:
+			id = pci_read_config(dev,
+			    BGE_PCI_GEN15_PRODID_ASICREV, 4);
+			break;
+		default:
+			id = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, 4);
+		}
+	}
+	return (id);
+}
+
 /*
  * Probe for a Broadcom chip. Check the PCI vendor and device IDs
  * against our list and return its name if we find a match.
@@ -2634,61 +2672,34 @@ bge_probe(device_t dev)
 	char model[64];
 	const struct bge_revision *br;
 	const char *pname;
-	struct bge_softc *sc = device_get_softc(dev);
+	struct bge_softc *sc;
 	const struct bge_type *t = bge_devs;
 	const struct bge_vendor *v;
 	uint32_t id;
 	uint16_t did, vid;
 
+	sc = device_get_softc(dev);
 	sc->bge_dev = dev;
 	vid = pci_get_vendor(dev);
 	did = pci_get_device(dev);
 	while(t->bge_vid != 0) {
 		if ((vid == t->bge_vid) && (did == t->bge_did)) {
-			id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >>
-			    BGE_PCIMISCCTL_ASICREV_SHIFT;
-			if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) {
-				/*
-				 * Find the ASCI revision.  Different chips
-				 * use different registers.
-				 */
-				switch (pci_get_device(dev)) {
-				case BCOM_DEVICEID_BCM5717:
-				case BCOM_DEVICEID_BCM5718:
-				case BCOM_DEVICEID_BCM5719:
-				case BCOM_DEVICEID_BCM5720:
-					id = pci_read_config(dev,
-					    BGE_PCI_GEN2_PRODID_ASICREV, 4);
-					break;
-				case BCOM_DEVICEID_BCM57761:
-				case BCOM_DEVICEID_BCM57762:
-				case BCOM_DEVICEID_BCM57765:
-				case BCOM_DEVICEID_BCM57766:
-				case BCOM_DEVICEID_BCM57781:
-				case BCOM_DEVICEID_BCM57785:
-				case BCOM_DEVICEID_BCM57791:
-				case BCOM_DEVICEID_BCM57795:
-					id = pci_read_config(dev,
-					    BGE_PCI_GEN15_PRODID_ASICREV, 4);
-					break;
-				default:
-					id = pci_read_config(dev,
-					    BGE_PCI_PRODID_ASICREV, 4);
-				}
-			}
+			id = bge_chipid(dev);
 			br = bge_lookup_rev(id);
-			v = bge_lookup_vendor(vid);
 			if (bge_has_eaddr(sc) &&
 			    pci_get_vpd_ident(dev, &pname) == 0)
-				snprintf(model, 64, "%s", pname);
-			else
-				snprintf(model, 64, "%s %s", v->v_name,
+				snprintf(model, sizeof(model), "%s", pname);
+			else {
+				v = bge_lookup_vendor(vid);
+				snprintf(model, sizeof(model), "%s %s",
+				    v != NULL ? v->v_name : "Unknown",
 				    br != NULL ? br->br_name :
-				    "NetXtreme Ethernet Controller");
-			snprintf(buf, 96, "%s, %sASIC rev. %#08x", model,
-			    br != NULL ? "" : "unknown ", id);
+				    "NetXtreme/NetLink Ethernet Controller");
+			}
+			snprintf(buf, sizeof(buf), "%s, %sASIC rev. %#08x",
+			    model, br != NULL ? "" : "unknown ", id);
 			device_set_desc_copy(dev, buf);
-			return (0);
+			return (BUS_PROBE_DEFAULT);
 		}
 		t++;
 	}
@@ -3272,38 +3283,7 @@ bge_attach(device_t dev)
 
 	/* Save various chip information. */
 	sc->bge_func_addr = pci_get_function(dev);
-	sc->bge_chipid =
-	    pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >>
-	    BGE_PCIMISCCTL_ASICREV_SHIFT;
-	if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG) {
-		/*
-		 * Find the ASCI revision.  Different chips use different
-		 * registers.
-		 */
-		switch (pci_get_device(dev)) {
-		case BCOM_DEVICEID_BCM5717:
-		case BCOM_DEVICEID_BCM5718:
-		case BCOM_DEVICEID_BCM5719:
-		case BCOM_DEVICEID_BCM5720:
-			sc->bge_chipid = pci_read_config(dev,
-			    BGE_PCI_GEN2_PRODID_ASICREV, 4);
-			break;
-		case BCOM_DEVICEID_BCM57761:
-		case BCOM_DEVICEID_BCM57762:
-		case BCOM_DEVICEID_BCM57765:
-		case BCOM_DEVICEID_BCM57766:
-		case BCOM_DEVICEID_BCM57781:
-		case BCOM_DEVICEID_BCM57785:
-		case BCOM_DEVICEID_BCM57791:
-		case BCOM_DEVICEID_BCM57795:
-			sc->bge_chipid = pci_read_config(dev,
-			    BGE_PCI_GEN15_PRODID_ASICREV, 4);
-			break;
-		default:
-			sc->bge_chipid = pci_read_config(dev,
-			    BGE_PCI_PRODID_ASICREV, 4);
-		}
-	}
+	sc->bge_chipid = bge_chipid(dev);
 	sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid);
 	sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid);
 
@@ -3493,6 +3473,8 @@ bge_attach(device_t dev)
 	    pci_get_device(dev) == BCOM_DEVICEID_BCM5753F ||
 	    pci_get_device(dev) == BCOM_DEVICEID_BCM5787F)) ||
 	    pci_get_device(dev) == BCOM_DEVICEID_BCM57790 ||
+	    pci_get_device(dev) == BCOM_DEVICEID_BCM57791 ||
+	    pci_get_device(dev) == BCOM_DEVICEID_BCM57795 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM5906) {
 		/* These chips are 10/100 only. */
 		capmask &= ~BMSR_EXTSTAT;
@@ -3504,8 +3486,8 @@ bge_attach(device_t dev)
 	 * TSO. But the firmware is not available to FreeBSD and Linux
 	 * claims that the TSO performed by the firmware is slower than
 	 * hardware based TSO. Moreover the firmware based TSO has one
-	 * known bug which can't handle TSO if ethernet header + IP/TCP
-	 * header is greater than 80 bytes. The workaround for the TSO
+	 * known bug which can't handle TSO if Ethernet header + IP/TCP
+	 * header is greater than 80 bytes. A workaround for the TSO
 	 * bug exist but it seems it's too expensive than not using
 	 * TSO at all. Some hardwares also have the TSO bug so limit
 	 * the TSO to the controllers that are not affected TSO issues
@@ -3878,8 +3860,13 @@ again:
 			error = ENOMEM;
 			goto fail;
 		}
-		taskqueue_start_threads(&sc->bge_tq, 1, PI_NET, "%s taskq",
-		    device_get_nameunit(sc->bge_dev));
+		error = taskqueue_start_threads(&sc->bge_tq, 1, PI_NET,
+		    "%s taskq", device_get_nameunit(sc->bge_dev));
+		if (error != 0) {
+			device_printf(dev, "could not start threads.\n");
+			ether_ifdetach(ifp);
+			goto fail;
+		}
 		error = bus_setup_intr(dev, sc->bge_irq,
 		    INTR_TYPE_NET | INTR_MPSAFE, bge_msi_intr, NULL, sc,
 		    &sc->bge_intrhand);

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 09:10:18 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 70C05268;
 Thu, 11 Jul 2013 09:10:18 +0000 (UTC) (envelope-from smh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 62F4C1C9C;
 Thu, 11 Jul 2013 09:10:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B9AIZJ003895;
 Thu, 11 Jul 2013 09:10:18 GMT (envelope-from smh@svn.freebsd.org)
Received: (from smh@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B9AIXV003892;
 Thu, 11 Jul 2013 09:10:18 GMT (envelope-from smh@svn.freebsd.org)
Message-Id: <201307110910.r6B9AIXV003892@svn.freebsd.org>
From: Steven Hartland 
Date: Thu, 11 Jul 2013 09:10:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253200 - in stable/9/sys/cam: ata scsi
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 09:10:18 -0000

Author: smh
Date: Thu Jul 11 09:10:17 2013
New Revision: 253200
URL: http://svnweb.freebsd.org/changeset/base/253200

Log:
  MFC r253091:
  Added 4K QUIRK for OCZ Vertex 4 SSDs

Modified:
  stable/9/sys/cam/ata/ata_da.c
  stable/9/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/ata/ata_da.c
==============================================================================
--- stable/9/sys/cam/ata/ata_da.c	Thu Jul 11 08:50:30 2013	(r253199)
+++ stable/9/sys/cam/ata/ata_da.c	Thu Jul 11 09:10:17 2013	(r253200)
@@ -398,6 +398,14 @@ static struct ada_quirk_entry ada_quirk_
 	},
 	{
 		/*
+		 * OCZ Vertex 4 SSDs
+		 * 4k optimised & trim only works in 4k requests + 4k aligned
+		 */
+		{ T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-VERTEX4*", "*" },
+		/*quirks*/ADA_Q_4K
+	},
+	{
+		/*
 		 * Samsung 830 Series SSDs
 		 * 4k optimised
 		 */

Modified: stable/9/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/9/sys/cam/scsi/scsi_da.c	Thu Jul 11 08:50:30 2013	(r253199)
+++ stable/9/sys/cam/scsi/scsi_da.c	Thu Jul 11 09:10:17 2013	(r253200)
@@ -1032,6 +1032,14 @@ static struct da_quirk_entry da_quirk_ta
 	},
 	{
 		/*
+		 * OCZ Vertex 4 SSDs
+		 * 4k optimised & trim only works in 4k requests + 4k aligned
+		 */
+		{ T_DIRECT, SIP_MEDIA_FIXED, "ATA", "OCZ-VERTEX4*", "*" },
+		/*quirks*/DA_Q_4K
+	},
+	{
+		/*
 		 * Samsung 830 Series SSDs
 		 * 4k optimised & trim only works in 4k requests + 4k aligned
 		 */

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 09:13:06 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 988144E0;
 Thu, 11 Jul 2013 09:13:06 +0000 (UTC) (envelope-from smh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8A6841CC8;
 Thu, 11 Jul 2013 09:13:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B9D6I7006062;
 Thu, 11 Jul 2013 09:13:06 GMT (envelope-from smh@svn.freebsd.org)
Received: (from smh@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B9D6nE006059;
 Thu, 11 Jul 2013 09:13:06 GMT (envelope-from smh@svn.freebsd.org)
Message-Id: <201307110913.r6B9D6nE006059@svn.freebsd.org>
From: Steven Hartland 
Date: Thu, 11 Jul 2013 09:13:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253201 - in stable/8/sys/cam: ata scsi
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 09:13:06 -0000

Author: smh
Date: Thu Jul 11 09:13:05 2013
New Revision: 253201
URL: http://svnweb.freebsd.org/changeset/base/253201

Log:
  MFC r253091:
  Added 4K QUIRK for OCZ Vertex 4 SSDs

Modified:
  stable/8/sys/cam/ata/ata_da.c
  stable/8/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/cam/   (props changed)

Modified: stable/8/sys/cam/ata/ata_da.c
==============================================================================
--- stable/8/sys/cam/ata/ata_da.c	Thu Jul 11 09:10:17 2013	(r253200)
+++ stable/8/sys/cam/ata/ata_da.c	Thu Jul 11 09:13:05 2013	(r253201)
@@ -396,6 +396,14 @@ static struct ada_quirk_entry ada_quirk_
 	},
 	{
 		/*
+		 * OCZ Vertex 4 SSDs
+		 * 4k optimised & trim only works in 4k requests + 4k aligned
+		 */
+		{ T_DIRECT, SIP_MEDIA_FIXED, "*", "OCZ-VERTEX4*", "*" },
+		/*quirks*/ADA_Q_4K
+	},
+	{
+		/*
 		 * Samsung 830 Series SSDs
 		 * 4k optimised
 		 */

Modified: stable/8/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/8/sys/cam/scsi/scsi_da.c	Thu Jul 11 09:10:17 2013	(r253200)
+++ stable/8/sys/cam/scsi/scsi_da.c	Thu Jul 11 09:13:05 2013	(r253201)
@@ -1020,6 +1020,14 @@ static struct da_quirk_entry da_quirk_ta
 	},
 	{
 		/*
+		 * OCZ Vertex 4 SSDs
+		 * 4k optimised & trim only works in 4k requests + 4k aligned
+		 */
+		{ T_DIRECT, SIP_MEDIA_FIXED, "ATA", "OCZ-VERTEX4*", "*" },
+		/*quirks*/DA_Q_4K
+	},
+	{
+		/*
 		 * Samsung 830 Series SSDs
 		 * 4k optimised & trim only works in 4k requests + 4k aligned
 		 */

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 09:27:57 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 808BD87B;
 Thu, 11 Jul 2013 09:27:57 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 588D21D85;
 Thu, 11 Jul 2013 09:27:57 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6B9RvuW009550;
 Thu, 11 Jul 2013 09:27:57 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6B9Ru7B009547;
 Thu, 11 Jul 2013 09:27:56 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201307110927.r6B9Ru7B009547@svn.freebsd.org>
From: Alexander Motin 
Date: Thu, 11 Jul 2013 09:27:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253202 - in stable/9/etc: defaults periodic/daily
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 09:27:57 -0000

Author: mav
Date: Thu Jul 11 09:27:56 2013
New Revision: 253202
URL: http://svnweb.freebsd.org/changeset/base/253202

Log:
  Partially MFC r249095:
  Add period script for graid(8) monitoring.

Added:
  stable/9/etc/periodic/daily/401.status-graid
     - copied unchanged from r249095, head/etc/periodic/daily/401.status-graid
Modified:
  stable/9/etc/defaults/periodic.conf
  stable/9/etc/periodic/daily/Makefile
Directory Properties:
  stable/9/etc/   (props changed)

Modified: stable/9/etc/defaults/periodic.conf
==============================================================================
--- stable/9/etc/defaults/periodic.conf	Thu Jul 11 09:13:05 2013	(r253201)
+++ stable/9/etc/defaults/periodic.conf	Thu Jul 11 09:27:56 2013	(r253202)
@@ -94,6 +94,9 @@ daily_news_expire_enable="YES"				# Run 
 daily_status_disks_enable="YES"				# Check disk status
 daily_status_disks_df_flags="-l -h"		# df(1) flags for check
 
+# 401.status-graid
+daily_status_graid_enable="NO"				# Check graid(8)
+
 # 404.status-zfs
 daily_status_zfs_enable="NO"				# Check ZFS
 daily_status_zfs_zpool_list_enable="YES"		# List ZFS pools

Copied: stable/9/etc/periodic/daily/401.status-graid (from r249095, head/etc/periodic/daily/401.status-graid)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/9/etc/periodic/daily/401.status-graid	Thu Jul 11 09:27:56 2013	(r253202, copy of r249095, head/etc/periodic/daily/401.status-graid)
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/periodic.conf ]
+then
+    . /etc/defaults/periodic.conf
+    source_periodic_confs
+fi
+
+case "$daily_status_graid_enable" in
+    [Yy][Ee][Ss])
+	echo
+	echo 'Checking status of graid(8) devices:'
+
+	if graid status; then
+		components="$(graid status -s | fgrep -v OPTIMAL)"
+		if [ "${components}" ]; then
+			rc=3
+		else
+			rc=0
+		fi
+	else
+		rc=2
+	fi
+	;;
+
+    *)  rc=0;;
+esac
+
+exit $rc

Modified: stable/9/etc/periodic/daily/Makefile
==============================================================================
--- stable/9/etc/periodic/daily/Makefile	Thu Jul 11 09:13:05 2013	(r253201)
+++ stable/9/etc/periodic/daily/Makefile	Thu Jul 11 09:27:56 2013	(r253202)
@@ -10,6 +10,7 @@ FILES=	100.clean-disks \
 	220.backup-pkgdb \
 	330.news \
 	400.status-disks \
+	401.status-graid \
 	405.status-ata-raid \
 	406.status-gmirror \
 	407.status-graid3 \

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 12:42:46 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id D9ECFC84;
 Thu, 11 Jul 2013 12:42:46 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id CC54A1A7A;
 Thu, 11 Jul 2013 12:42:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BCgkoA067426;
 Thu, 11 Jul 2013 12:42:46 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BCgkxs067425;
 Thu, 11 Jul 2013 12:42:46 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201307111242.r6BCgkxs067425@svn.freebsd.org>
From: Andriy Gapon 
Date: Thu, 11 Jul 2013 12:42:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253203 - stable/9/sys/kern
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 12:42:46 -0000

Author: avg
Date: Thu Jul 11 12:42:46 2013
New Revision: 253203
URL: http://svnweb.freebsd.org/changeset/base/253203

Log:
  MFC r253077: should_yield: protect from td_swvoltick being uninitialized
  or too stale

Modified:
  stable/9/sys/kern/kern_synch.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_synch.c
==============================================================================
--- stable/9/sys/kern/kern_synch.c	Thu Jul 11 09:27:56 2013	(r253202)
+++ stable/9/sys/kern/kern_synch.c	Thu Jul 11 12:42:46 2013	(r253203)
@@ -578,7 +578,7 @@ int
 should_yield(void)
 {
 
-	return (ticks - curthread->td_swvoltick >= hogticks);
+	return ((unsigned int)(ticks - curthread->td_swvoltick) >= hogticks);
 }
 
 void

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 12:46:35 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id ECBA2E1A;
 Thu, 11 Jul 2013 12:46:35 +0000 (UTC)
 (envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id C4ADF1AAE;
 Thu, 11 Jul 2013 12:46:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BCkZpx067988;
 Thu, 11 Jul 2013 12:46:35 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BCkZ3V067987;
 Thu, 11 Jul 2013 12:46:35 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201307111246.r6BCkZ3V067987@svn.freebsd.org>
From: Andre Oppermann 
Date: Thu, 11 Jul 2013 12:46:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253204 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 12:46:36 -0000

Author: andre
Date: Thu Jul 11 12:46:35 2013
New Revision: 253204
URL: http://svnweb.freebsd.org/changeset/base/253204

Log:
  Fix style issues, a typo in "kern.ipc.nmbufs" and correctly plave and
  expose the value of the tunable maxmbufmem as "kern.ipc.maxmbufmem"
  through sysctl.
  
  Reported by:	smh
  MFC after:	1 day

Modified:
  head/sys/kern/kern_mbuf.c

Modified: head/sys/kern/kern_mbuf.c
==============================================================================
--- head/sys/kern/kern_mbuf.c	Thu Jul 11 12:42:46 2013	(r253203)
+++ head/sys/kern/kern_mbuf.c	Thu Jul 11 12:46:35 2013	(r253204)
@@ -104,13 +104,18 @@ int nmbjumbo9;			/* limits number of 9k 
 int nmbjumbo16;			/* limits number of 16k jumbo clusters */
 struct mbstat mbstat;
 
+static quad_t maxmbufmem;	/* overall real memory limit for all mbufs */
+
+SYSCTL_QUAD(_kern_ipc, OID_AUTO, maxmbufmem, CTLFLAG_RDTUN, &maxmbufmem, 0,
+    "Maximum real memory allocateable to various mbuf types");
+
 /*
  * tunable_mbinit() has to be run before any mbuf allocations are done.
  */
 static void
 tunable_mbinit(void *dummy)
 {
-	quad_t realmem, maxmbufmem;
+	quad_t realmem;
 
 	/*
 	 * The default limit for all mbuf related memory is 1/2 of all
@@ -120,7 +125,7 @@ tunable_mbinit(void *dummy)
 	realmem = qmin((quad_t)physmem * PAGE_SIZE,
 	    vm_map_max(kmem_map) - vm_map_min(kmem_map));
 	maxmbufmem = realmem / 2;
-	TUNABLE_QUAD_FETCH("kern.maxmbufmem", &maxmbufmem);
+	TUNABLE_QUAD_FETCH("kern.ipc.maxmbufmem", &maxmbufmem);
 	if (maxmbufmem > realmem / 4 * 3)
 		maxmbufmem = realmem / 4 * 3;
 
@@ -204,7 +209,7 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS)
 	newnmbjumbo9 = nmbjumbo9;
 	error = sysctl_handle_int(oidp, &newnmbjumbo9, 0, req);
 	if (error == 0 && req->newptr) {
-		if (newnmbjumbo9 > nmbjumbo9&&
+		if (newnmbjumbo9 > nmbjumbo9 &&
 		    nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) {
 			nmbjumbo9 = newnmbjumbo9;
 			uma_zone_set_max(zone_jumbo9, nmbjumbo9);
@@ -258,7 +263,7 @@ sysctl_nmbufs(SYSCTL_HANDLER_ARGS)
 	}
 	return (error);
 }
-SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbuf, CTLTYPE_INT|CTLFLAG_RW,
+SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbufs, CTLTYPE_INT|CTLFLAG_RW,
 &nmbufs, 0, sysctl_nmbufs, "IU",
     "Maximum number of mbufs allowed");
 

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 12:47:07 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 461C1F51;
 Thu, 11 Jul 2013 12:47:07 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 37E271AB6;
 Thu, 11 Jul 2013 12:47:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BCl7Ge068116;
 Thu, 11 Jul 2013 12:47:07 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BCl6gq068114;
 Thu, 11 Jul 2013 12:47:06 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201307111247.r6BCl6gq068114@svn.freebsd.org>
From: Dag-Erling Smørgrav 
Date: Thu, 11 Jul 2013 12:47:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253205 - stable/9/usr.bin/newgrp
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 12:47:07 -0000

Author: des
Date: Thu Jul 11 12:47:06 2013
New Revision: 253205
URL: http://svnweb.freebsd.org/changeset/base/253205

Log:
  MFH (r246553): document and explain need for setuid bit.
  
  PR:		docs/167741

Modified:
  stable/9/usr.bin/newgrp/newgrp.1
  stable/9/usr.bin/newgrp/newgrp.c
Directory Properties:
  stable/9/usr.bin/newgrp/   (props changed)

Modified: stable/9/usr.bin/newgrp/newgrp.1
==============================================================================
--- stable/9/usr.bin/newgrp/newgrp.1	Thu Jul 11 12:46:35 2013	(r253204)
+++ stable/9/usr.bin/newgrp/newgrp.1	Thu Jul 11 12:47:06 2013	(r253205)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 23, 2002
+.Dd February 8, 2013
 .Dt NEWGRP 1
 .Os
 .Sh NAME
@@ -90,6 +90,15 @@ A
 utility appeared in
 .At v6 .
 .Sh BUGS
+For security reasons, the
+.Nm
+utility is normally installed without the setuid bit.
+To enable it, run the following command:
+.Bd -literal -offset indent
+chmod u+s /usr/bin/newgrp
+.Ed
+.Pp
 Group passwords are inherently insecure as there is no way to stop
-users obtaining the crypted passwords from the group database.
+users obtaining the password hash from the group database.
 Their use is discouraged.
+Instead, users should simply be added to the necessary groups.

Modified: stable/9/usr.bin/newgrp/newgrp.c
==============================================================================
--- stable/9/usr.bin/newgrp/newgrp.c	Thu Jul 11 12:46:35 2013	(r253204)
+++ stable/9/usr.bin/newgrp/newgrp.c	Thu Jul 11 12:47:06 2013	(r253205)
@@ -73,7 +73,8 @@ main(int argc, char *argv[])
 {
 	int ch, login;
 
-	euid = geteuid();
+	if ((euid = geteuid()) != 0)
+		warnx("need root permissions to function properly, check setuid bit");
 	if (seteuid(getuid()) < 0)
 		err(1, "seteuid");
 

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 12:49:13 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 7A46430B;
 Thu, 11 Jul 2013 12:49:13 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 668591B05;
 Thu, 11 Jul 2013 12:49:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BCnDKY068414;
 Thu, 11 Jul 2013 12:49:13 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BCnDuc068413;
 Thu, 11 Jul 2013 12:49:13 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201307111249.r6BCnDuc068413@svn.freebsd.org>
From: Dag-Erling Smørgrav 
Date: Thu, 11 Jul 2013 12:49:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253206 - stable/9/share/man/man5
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 12:49:13 -0000

Author: des
Date: Thu Jul 11 12:49:12 2013
New Revision: 253206
URL: http://svnweb.freebsd.org/changeset/base/253206

Log:
  MFH (r246552): mention newgrp(1) and how to change the group password.
  
  PR:		docs/167741

Modified:
  stable/9/share/man/man5/group.5
Directory Properties:
  stable/9/share/man/man5/   (props changed)

Modified: stable/9/share/man/man5/group.5
==============================================================================
--- stable/9/share/man/man5/group.5	Thu Jul 11 12:47:06 2013	(r253205)
+++ stable/9/share/man/man5/group.5	Thu Jul 11 12:49:12 2013	(r253206)
@@ -32,7 +32,7 @@
 .\"     From: @(#)group.5	8.3 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd September 29, 1994
+.Dd February 8, 2013
 .Dt GROUP 5
 .Os
 .Sh NAME
@@ -139,6 +139,7 @@ may still have this limit.
 .It Pa /etc/group
 .El
 .Sh SEE ALSO
+.Xr newgrp 1 ,
 .Xr passwd 1 ,
 .Xr setgroups 2 ,
 .Xr crypt 3 ,
@@ -156,9 +157,14 @@ file format appeared in
 .At v6 .
 Support for comments first appeared in
 .Fx 3.0 .
-.Sh BUGS
+.Sh IMPLEMENTATION NOTES
 The
 .Xr passwd 1
 command does not change the
 .Nm
 passwords.
+The
+.Xr pw 8
+utility's
+.Cm groupmod
+command should be used instead.

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 12:53:13 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id F0AA9760;
 Thu, 11 Jul 2013 12:53:13 +0000 (UTC)
 (envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id CB1A81B68;
 Thu, 11 Jul 2013 12:53:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BCrDcK070583;
 Thu, 11 Jul 2013 12:53:13 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BCrDnl070582;
 Thu, 11 Jul 2013 12:53:13 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201307111253.r6BCrDnl070582@svn.freebsd.org>
From: Andre Oppermann 
Date: Thu, 11 Jul 2013 12:53:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253207 - head/sys/kern
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 12:53:14 -0000

Author: andre
Date: Thu Jul 11 12:53:13 2013
New Revision: 253207
URL: http://svnweb.freebsd.org/changeset/base/253207

Log:
  Make use of the fact that uma_zone_set_max(9) already returns the
  rounded limit making a call to uma_zone_get_max(9) unnecessary.
  
  MFC after:	1 day

Modified:
  head/sys/kern/kern_mbuf.c

Modified: head/sys/kern/kern_mbuf.c
==============================================================================
--- head/sys/kern/kern_mbuf.c	Thu Jul 11 12:49:12 2013	(r253206)
+++ head/sys/kern/kern_mbuf.c	Thu Jul 11 12:53:13 2013	(r253207)
@@ -167,8 +167,7 @@ sysctl_nmbclusters(SYSCTL_HANDLER_ARGS)
 		if (newnmbclusters > nmbclusters &&
 		    nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) {
 			nmbclusters = newnmbclusters;
-			uma_zone_set_max(zone_clust, nmbclusters);
-			nmbclusters = uma_zone_get_max(zone_clust);
+			nmbclusters = uma_zone_set_max(zone_clust, nmbclusters);
 			EVENTHANDLER_INVOKE(nmbclusters_change);
 		} else
 			error = EINVAL;
@@ -190,8 +189,7 @@ sysctl_nmbjumbop(SYSCTL_HANDLER_ARGS)
 		if (newnmbjumbop > nmbjumbop &&
 		    nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) {
 			nmbjumbop = newnmbjumbop;
-			uma_zone_set_max(zone_jumbop, nmbjumbop);
-			nmbjumbop = uma_zone_get_max(zone_jumbop);
+			nmbjumbop = uma_zone_set_max(zone_jumbop, nmbjumbop);
 		} else
 			error = EINVAL;
 	}
@@ -212,8 +210,7 @@ sysctl_nmbjumbo9(SYSCTL_HANDLER_ARGS)
 		if (newnmbjumbo9 > nmbjumbo9 &&
 		    nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) {
 			nmbjumbo9 = newnmbjumbo9;
-			uma_zone_set_max(zone_jumbo9, nmbjumbo9);
-			nmbjumbo9 = uma_zone_get_max(zone_jumbo9);
+			nmbjumbo9 = uma_zone_set_max(zone_jumbo9, nmbjumbo9);
 		} else
 			error = EINVAL;
 	}
@@ -234,8 +231,7 @@ sysctl_nmbjumbo16(SYSCTL_HANDLER_ARGS)
 		if (newnmbjumbo16 > nmbjumbo16 &&
 		    nmbufs >= nmbclusters + nmbjumbop + nmbjumbo9 + nmbjumbo16) {
 			nmbjumbo16 = newnmbjumbo16;
-			uma_zone_set_max(zone_jumbo16, nmbjumbo16);
-			nmbjumbo16 = uma_zone_get_max(zone_jumbo16);
+			nmbjumbo16 = uma_zone_set_max(zone_jumbo16, nmbjumbo16);
 		} else
 			error = EINVAL;
 	}
@@ -255,8 +251,7 @@ sysctl_nmbufs(SYSCTL_HANDLER_ARGS)
 	if (error == 0 && req->newptr) {
 		if (newnmbufs > nmbufs) {
 			nmbufs = newnmbufs;
-			uma_zone_set_max(zone_mbuf, nmbufs);
-			nmbufs = uma_zone_get_max(zone_mbuf);
+			nmbufs = uma_zone_set_max(zone_mbuf, nmbufs);
 			EVENTHANDLER_INVOKE(nmbufs_change);
 		} else
 			error = EINVAL;

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 13:23:17 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 250741F1;
 Thu, 11 Jul 2013 13:23:17 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 by mx1.freebsd.org (Postfix) with ESMTP id F3C221CC9;
 Thu, 11 Jul 2013 13:23:16 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4927CB982;
 Thu, 11 Jul 2013 09:23:16 -0400 (EDT)
From: John Baldwin 
To: Garrett Cooper 
Subject: Re: svn commit: r253048 - in head/sys/ofed: drivers/net/mlx4
 include/linux
Date: Thu, 11 Jul 2013 08:26:44 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; )
References: <201307082125.r68LPDlY023493@svn.freebsd.org>
 <201307091120.22114.jhb@freebsd.org>
 
In-Reply-To: 
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201307110826.44287.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Thu, 11 Jul 2013 09:23:16 -0400 (EDT)
Cc: svn-src-head ,
 svn-src-all ,
 src-committers , shahark@mellanox.com,
 acornehl@gmail.com
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 13:23:17 -0000

On Wednesday, July 10, 2013 7:58:30 pm Garrett Cooper wrote:
> On Tue, Jul 9, 2013 at 8:20 AM, John Baldwin  wrote:
> 
> ...
> 
> > I hadn't seen it.  I had wondered if the '\n' issue was a generic sysfs thing.
> > It sounds like it is and I'd be happy to revert the mlx4 change and alter the
> > sysfs bits to manage the newline directly if that is more appropriate.
> 
> I'll doublecheck this, but basically I'm really adverse to diverging
> from Linux in this area -- hence that's why I did what I did in the PR
> I mentioned.

I checked the other sysfs attributes under sys/ofed and all the ones that deal
with strings expect the newline.  There might be some that are "blobs" that do
not expect newlines, but it wasn't clear.  I do agree that it would be best to
avoid diffs for this case if possible in all the sysfs handlers.

(It would be even nicer if ofed used a more abstract notion for device attributes
in its drivers that could map to sysctl on FreeBSD and sysfs device attributes on
Linux, but that's a much larger change, and one OFED would have to want to do.)

> > I'd also like this to use sysctl_handle_string() if at all possible.  Are you in
> > a position to test patches still?
> 
> Unfortunately I'm not right now :(. Anthony may or may not be able to
> test this out (I used his machine when we were hacking around on IB
> stuff).
> 
> > If so, maybe give this a whirl.  It's similar to yours except it uses
> > sysctl_handle_string() and strlcat() rather than continuing to do things
> > by hand.  It also outputs an empty string to userland if the attribute
> > doesn't have a show method (your version would never pass out an old
> > string in that case unlike the original code).
> 
> Can you please pass along a patch to Anthony and me so we can try and
> apply it to test it out (Gmail's going to taint the inline patch, as
> is the EMC Exchange server with the patch attachment)? If Anthony
> still has the machine setup, then I'd be more than happy to test out
> the patch :).

Ok, I've put the patch at a URL.  Note that it is relative to what was just
committed to HEAD, so to test on 9 you'd have to apply both patches.

http://www.freebsd.org/~jhb/patches/ofed_sysfs.patch

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 14:18:39 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 92693FC9;
 Thu, 11 Jul 2013 14:18:39 +0000 (UTC)
 (envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 749D81FF0;
 Thu, 11 Jul 2013 14:18:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BEIdWC094920;
 Thu, 11 Jul 2013 14:18:39 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BEIdIo094917;
 Thu, 11 Jul 2013 14:18:39 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201307111418.r6BEIdIo094917@svn.freebsd.org>
From: Andre Oppermann 
Date: Thu, 11 Jul 2013 14:18:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253208 - head/sys/crypto/siphash
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 14:18:39 -0000

Author: andre
Date: Thu Jul 11 14:18:38 2013
New Revision: 253208
URL: http://svnweb.freebsd.org/changeset/base/253208

Log:
  SipHash is a cryptographically strong pseudo-random function (a.k.a. keyed
  hash function) optimized for speed on short messages returning a 64bit hash/
  digest value.
  
  SipHash is simpler and much faster than other secure MACs and competitive
  in speed with popular non-cryptographic hash functions.  It uses a 128-bit
  key without the hidden cost of a key expansion step.  SipHash iterates a
  simple round function consisting of four additions, four xors, and six
  rotations, interleaved with xors of message blocks for a pre-defined number
  of compression and finalization rounds.  The absence of  secret load/store
  addresses or secret branch conditions avoid timing attacks.  No state is
  shared between messages.  Hashing is deterministic and doesn't use nonces.
  It is not susceptible to length extension attacks.
  
  Target applications include network traffic authentication, message
  authentication (MAC) and hash-tables protection against hash-flooding
  denial-of-service attacks.
  
  The number of update/finalization rounds is defined during initialization:
  
   SipHash24_Init() for the fast and reasonable strong version.
   SipHash48_Init() for the strong version (half as fast).
  
  SipHash usage is similar to other hash functions:
  
   struct SIPHASH_CTX ctx;
   char *k = "16bytes long key"
   char *s = "string";
   uint64_t h = 0;
   SipHash24_Init(&ctx);
   SipHash_SetKey(&ctx, k);
   SipHash_Update(&ctx, s, strlen(s));
   SipHash_Final(&h, &ctx);  /* or */
   h = SipHash_End(&ctx);    /* or */
   h = SipHash24(&ctx, k, s, strlen(s));
  
  It was designed by Jean-Philippe Aumasson and Daniel J. Bernstein and
  is described in the paper "SipHash: a fast short-input PRF", 2012.09.18:
   https://131002.net/siphash/siphash.pdf
   Permanent ID: b9a943a805fbfc6fde808af9fc0ecdfa
  
  Implemented by:	andre (based on the paper)
  Reviewed by:	cperciva

Added:
  head/sys/crypto/siphash/
  head/sys/crypto/siphash/siphash.c   (contents, props changed)
  head/sys/crypto/siphash/siphash.h   (contents, props changed)
  head/sys/crypto/siphash/siphash_test.c   (contents, props changed)

Added: head/sys/crypto/siphash/siphash.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/crypto/siphash/siphash.c	Thu Jul 11 14:18:38 2013	(r253208)
@@ -0,0 +1,241 @@
+/*-
+ * Copyright (c) 2013 Andre Oppermann 
+ * 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. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * SipHash is a family of PRFs SipHash-c-d where the integer parameters c and d
+ * are the number of compression rounds and the number of finalization rounds.
+ * A compression round is identical to a finalization round and this round
+ * function is called SipRound.  Given a 128-bit key k and a (possibly empty)
+ * byte string m, SipHash-c-d returns a 64-bit value SipHash-c-d(k; m).
+ *
+ * Implemented from the paper "SipHash: a fast short-input PRF", 2012.09.18,
+ * by Jean-Philippe Aumasson and Daniel J. Bernstein,
+ * Permanent Document ID b9a943a805fbfc6fde808af9fc0ecdfa
+ * https://131002.net/siphash/siphash.pdf
+ * https://131002.net/siphash/
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+static void	SipRounds(SIPHASH_CTX *ctx, int final);
+
+void
+SipHash_InitX(SIPHASH_CTX *ctx, int rc, int rf)
+{
+
+	ctx->v[0] = 0x736f6d6570736575ull;
+	ctx->v[1] = 0x646f72616e646f6dull;
+	ctx->v[2] = 0x6c7967656e657261ull;
+	ctx->v[3] = 0x7465646279746573ull;
+	ctx->buf.b64 = 0;
+	ctx->bytes = 0;
+	ctx->buflen = 0;
+	ctx->rounds_compr = rc;
+	ctx->rounds_final = rf;
+	ctx->initialized = 1;
+}
+
+void
+SipHash_SetKey(SIPHASH_CTX *ctx, const uint8_t key[16])
+{
+	uint64_t k[2];
+
+	KASSERT(ctx->v[0] == 0x736f6d6570736575ull &&
+	    ctx->initialized == 1,
+	    ("%s: context %p not properly initialized", __func__, ctx));
+
+	k[0] = le64dec(&key[0]);
+	k[1] = le64dec(&key[8]);
+
+	ctx->v[0] ^= k[0];
+	ctx->v[1] ^= k[1];
+	ctx->v[2] ^= k[0];
+	ctx->v[3] ^= k[1];
+
+	ctx->initialized = 2;
+}
+
+static size_t
+SipBuf(SIPHASH_CTX *ctx, const uint8_t **src, size_t len, int final)
+{
+	size_t x = 0;
+
+	KASSERT((!final && len > 0) || (final && len == 0),
+	    ("%s: invalid parameters", __func__));
+
+	if (!final) {
+		x = MIN(len, sizeof(ctx->buf.b64) - ctx->buflen);
+		bcopy(*src, &ctx->buf.b8[ctx->buflen], x);
+		ctx->buflen += x;
+		*src += x;
+	} else
+		ctx->buf.b8[7] = (uint8_t)ctx->bytes;
+
+	if (ctx->buflen == 8 || final) {
+		ctx->v[3] ^= le64toh(ctx->buf.b64);
+		SipRounds(ctx, 0);
+		ctx->v[0] ^= le64toh(ctx->buf.b64);
+		ctx->buf.b64 = 0;
+		ctx->buflen = 0;
+	}
+	return (x);
+}
+
+void
+SipHash_Update(SIPHASH_CTX *ctx, const void *src, size_t len)
+{
+	uint64_t m, *p;
+	const uint8_t *s;
+	size_t rem;
+
+	KASSERT(ctx->initialized == 2,
+	    ("%s: context %p not properly initialized", __func__, ctx));
+
+	s = src;
+	ctx->bytes += len;
+
+	/*
+	 * Push length smaller than block size into buffer or
+	 * fill up the buffer if there is already something
+	 * in it.
+	 */
+	if (ctx->buflen > 0 || len < 8)
+		len -= SipBuf(ctx, &s, len, 0);
+	if (len == 0)
+		return;
+
+	rem = len & 0x7;
+	len >>= 3;
+
+	/* Optimze for 64bit aligned/unaligned access. */
+	if (((uintptr_t)s & 0x7) == 0) {
+		for (p = (uint64_t *)s; len > 0; len--, p++) {
+			m = le64toh(*p);
+			ctx->v[3] ^= m;
+			SipRounds(ctx, 0);
+			ctx->v[0] ^= m;
+		}
+		s = (uint8_t *)p;
+	} else {
+		for (; len > 0; len--, s += 8) {
+			m = le64dec(s);
+			ctx->v[3] ^= m;
+			SipRounds(ctx, 0);
+			ctx->v[0] ^= m;
+		}
+	}
+
+	/* Push remainder into buffer. */
+	if (rem > 0)
+		(void)SipBuf(ctx, &s, rem, 0);
+}
+
+void
+SipHash_Final(void *dst, SIPHASH_CTX *ctx)
+{
+	uint64_t r;
+
+	KASSERT(ctx->initialized == 2,
+	    ("%s: context %p not properly initialized", __func__, ctx));
+
+	r = SipHash_End(ctx);
+	le64enc(dst, r);
+}
+
+uint64_t
+SipHash_End(SIPHASH_CTX *ctx)
+{
+	uint64_t r;
+
+	KASSERT(ctx->initialized == 2,
+	    ("%s: context %p not properly initialized", __func__, ctx));
+
+	SipBuf(ctx, NULL, 0, 1);
+	ctx->v[2] ^= 0xff;
+	SipRounds(ctx, 1);
+	r = (ctx->v[0] ^ ctx->v[1]) ^ (ctx->v[2] ^ ctx->v[3]);
+
+	bzero(ctx, sizeof(*ctx));
+	return (r);
+}
+
+uint64_t
+SipHashX(SIPHASH_CTX *ctx, int rc, int rf, const uint8_t key[16],
+    const void *src, size_t len)
+{
+
+	SipHash_InitX(ctx, rc, rf);
+	SipHash_SetKey(ctx, key);
+	SipHash_Update(ctx, src, len);
+
+	return (SipHash_End(ctx));
+}
+
+#define SIP_ROTL(x, b)	(uint64_t)(((x) << (b)) | ( (x) >> (64 - (b))))
+
+static void
+SipRounds(SIPHASH_CTX *ctx, int final)
+{
+	int rounds;
+
+	if (!final)
+		rounds = ctx->rounds_compr;
+	else
+		rounds = ctx->rounds_final;
+
+	while (rounds--) {
+		ctx->v[0] += ctx->v[1];
+		ctx->v[2] += ctx->v[3];
+		ctx->v[1] = SIP_ROTL(ctx->v[1], 13);
+		ctx->v[3] = SIP_ROTL(ctx->v[3], 16);
+
+		ctx->v[1] ^= ctx->v[0];
+		ctx->v[3] ^= ctx->v[2];
+		ctx->v[0] = SIP_ROTL(ctx->v[0], 32);
+
+		ctx->v[2] += ctx->v[1];
+		ctx->v[0] += ctx->v[3];
+		ctx->v[1] = SIP_ROTL(ctx->v[1], 17);
+		ctx->v[3] = SIP_ROTL(ctx->v[3], 21);
+
+		ctx->v[1] ^= ctx->v[2];
+		ctx->v[3] ^= ctx->v[0];
+		ctx->v[2] = SIP_ROTL(ctx->v[2], 32);
+	}
+}
+

Added: head/sys/crypto/siphash/siphash.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/crypto/siphash/siphash.h	Thu Jul 11 14:18:38 2013	(r253208)
@@ -0,0 +1,83 @@
+/*-
+ * Copyright (c) 2013 Andre Oppermann 
+ * 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. The name of the author may not be used to endorse or promote
+ *    products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * SipHash is a family of pseudorandom functions (a.k.a. keyed hash functions)
+ * optimized for speed on short messages returning a 64bit hash/digest value.
+ *
+ * The number of rounds is defined during the initialization:
+ *  SipHash24_Init() for the fast and resonable strong version
+ *  SipHash48_Init() for the strong version (half as fast)
+ *
+ * struct SIPHASH_CTX ctx;
+ * SipHash24_Init(&ctx);
+ * SipHash_SetKey(&ctx, "16bytes long key");
+ * SipHash_Update(&ctx, pointer_to_string, length_of_string);
+ * SipHash_Final(output, &ctx);
+ */
+
+#ifndef _SIPHASH_H_
+#define _SIPHASH_H_
+
+#define SIPHASH_BLOCK_LENGTH	 8
+#define SIPHASH_KEY_LENGTH	16
+#define SIPHASH_DIGEST_LENGTH	 8
+
+typedef struct _SIPHASH_CTX {
+	uint64_t	v[4];
+	union {
+		uint64_t	b64;
+		uint8_t		b8[8];
+	} buf;
+	uint64_t	bytes;
+	uint8_t		buflen;
+	uint8_t		rounds_compr;
+	uint8_t		rounds_final;
+	uint8_t		initialized;
+} SIPHASH_CTX;
+
+
+#define SipHash24_Init(x)	SipHash_InitX((x), 2, 4)
+#define SipHash48_Init(x)	SipHash_InitX((x), 4, 8)
+void SipHash_InitX(SIPHASH_CTX *, int, int);
+void SipHash_SetKey(SIPHASH_CTX *, const uint8_t [16]);
+void SipHash_Update(SIPHASH_CTX *, const void *, size_t);
+void SipHash_Final(void *, SIPHASH_CTX *);
+uint64_t SipHash_End(SIPHASH_CTX *);
+
+#define SipHash24(x, y, z, i)	SipHashX((x), 2, 4, (y), (z), (i));
+#define SipHash48(x, y, z, i)	SipHashX((x), 4, 8, (y), (z), (i));
+uint64_t SipHashX(SIPHASH_CTX *, int, int, const uint8_t [16], const void *,
+    size_t);
+
+int SipHash24_TestVectors(void);
+
+#endif /* _SIPHASH_H_ */

Added: head/sys/crypto/siphash/siphash_test.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/crypto/siphash/siphash_test.c	Thu Jul 11 14:18:38 2013	(r253208)
@@ -0,0 +1,140 @@
+/*-
+ * Test Vectors from the SipHash reference C implementation:
+ *
+ * Written in 2012 by 
+ * Jean-Philippe Aumasson 
+ * Daniel J. Bernstein 
+ *
+ * Adjusted by Andre Oppermann  to use function calls in
+ * line with other hash implementations.
+ *
+ * To the extent possible under law, the author(s) have dedicated all copyright
+ * and related and neighboring rights to this software to the public domain
+ * worldwide. This software is distributed without any warranty.
+ *
+ * You should have received a copy of the CC0 Public Domain Dedication along with
+ * this software. If not, see .
+ *
+ * SipHash-2-4 output with
+ * k = 00 01 02 ...
+ * and
+ * in = (empty string)
+ * in = 00 (1 byte)
+ * in = 00 01 (2 bytes)
+ * in = 00 01 02 (3 bytes)
+ * ...
+ * in = 00 01 02 ... 3e (63 bytes)
+ */
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+uint8_t vectors[64][8] =
+{
+  { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, },
+  { 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, },
+  { 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d, },
+  { 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85, },
+  { 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf, },
+  { 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18, },
+  { 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb, },
+  { 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab, },
+  { 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93, },
+  { 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e, },
+  { 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a, },
+  { 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4, },
+  { 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75, },
+  { 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14, },
+  { 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7, },
+  { 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1, },
+  { 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f, },
+  { 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69, },
+  { 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b, },
+  { 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb, },
+  { 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe, },
+  { 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0, },
+  { 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93, },
+  { 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8, },
+  { 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8, },
+  { 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc, },
+  { 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17, },
+  { 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f, },
+  { 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde, },
+  { 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6, },
+  { 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad, },
+  { 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32, },
+  { 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71, },
+  { 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7, },
+  { 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12, },
+  { 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15, },
+  { 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, },
+  { 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, },
+  { 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, },
+  { 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, },
+  { 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, },
+  { 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad, },
+  { 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18, },
+  { 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4, },
+  { 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9, },
+  { 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9, },
+  { 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb, },
+  { 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0, },
+  { 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6, },
+  { 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7, },
+  { 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee, },
+  { 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1, },
+  { 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a, },
+  { 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81, },
+  { 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f, },
+  { 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24, },
+  { 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7, },
+  { 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea, },
+  { 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60, },
+  { 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66, },
+  { 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c, },
+  { 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f, },
+  { 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, },
+  { 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, }
+};
+
+#define MAXLEN 64
+
+int
+SipHash24_TestVectors(void)
+{
+	int i, fail = 0;
+	uint8_t in[MAXLEN], out[8], k[16];
+	SIPHASH_CTX ctx;
+
+	/* Initialize key. */
+	for (i = 0; i < 16; ++i)
+		k[i] = i;
+
+	/* Step through differnet length. */
+	for (i = 0; i < MAXLEN; ++i) {
+		in[i] = i;
+
+		SipHash24_Init(&ctx);
+		SipHash_SetKey(&ctx, k);
+		SipHash_Update(&ctx, in, i);
+		SipHash_Final(out, &ctx);
+
+		if (memcmp(out, vectors[i], 8))
+#if 0
+			printf("%i: test vector failed\n", i);
+		else
+			printf("%i: test vector correct\n", i);
+#else
+			fail++;
+#endif
+	}
+
+	return ((fail == 0));
+}

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 15:02:39 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 6F5ABE41;
 Thu, 11 Jul 2013 15:02:39 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 614F3128F;
 Thu, 11 Jul 2013 15:02:39 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BF2dMf008620;
 Thu, 11 Jul 2013 15:02:39 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BF2dJa008619;
 Thu, 11 Jul 2013 15:02:39 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307111502.r6BF2dJa008619@svn.freebsd.org>
From: Jim Harris 
Date: Thu, 11 Jul 2013 15:02:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253209 - head/sys/dev/nvme
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 15:02:39 -0000

Author: jimharris
Date: Thu Jul 11 15:02:38 2013
New Revision: 253209
URL: http://svnweb.freebsd.org/changeset/base/253209

Log:
  Fix a poorly worded comment in nvme(4).
  
  MFC after:	3 days

Modified:
  head/sys/dev/nvme/nvme.h

Modified: head/sys/dev/nvme/nvme.h
==============================================================================
--- head/sys/dev/nvme/nvme.h	Thu Jul 11 14:18:38 2013	(r253208)
+++ head/sys/dev/nvme/nvme.h	Thu Jul 11 15:02:38 2013	(r253209)
@@ -765,10 +765,10 @@ struct nvme_pt_command {
 
 	/*
 	 * is_read = 1 if the passthrough command will read data into the
-	 *  supplied buffer.
+	 *  supplied buffer from the controller.
 	 *
-	 * is_read = 0 if the passthrough command will write data into the
-	 *  supplied buffer.
+	 * is_read = 0 if the passthrough command will write data from the
+	 *  supplied buffer to the controller.
 	 */
 	uint32_t		is_read;
 

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 15:29:26 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 1C2EC128;
 Thu, 11 Jul 2013 15:29:26 +0000 (UTC)
 (envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 0DBC61475;
 Thu, 11 Jul 2013 15:29:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BFTQo0016812;
 Thu, 11 Jul 2013 15:29:26 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BFTPSf016809;
 Thu, 11 Jul 2013 15:29:25 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201307111529.r6BFTPSf016809@svn.freebsd.org>
From: Andre Oppermann 
Date: Thu, 11 Jul 2013 15:29:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253210 - in head/sys: conf netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 15:29:26 -0000

Author: andre
Date: Thu Jul 11 15:29:25 2013
New Revision: 253210
URL: http://svnweb.freebsd.org/changeset/base/253210

Log:
  Improve SYN cookies by encoding the MSS, WSCALE (window scaling) and SACK
  information into the ISN (initial sequence number) without the additional
  use of timestamp bits and switching to the very fast and cryptographically
  strong SipHash-2-4 MAC hash algorithm to protect the SYN cookie against
  forgeries.
  
  The purpose of SYN cookies is to encode all necessary session state in
  the 32 bits of our initial sequence number to avoid storing any information
  locally in memory.  This is especially important when under heavy spoofed
  SYN attacks where we would either run out of memory or the syncache would
  fill with bogus connection attempts swamping out legitimate connections.
  
  The original SYN cookies method only stored an indexed MSS values in the
  cookie.  This isn't sufficient anymore and breaks down in the presence of
  WSCALE information which is only exchanged during SYN and SYN-ACK.  If we
  can't keep track of it then we may severely underestimate the available
  send or receive window. This is compounded with large windows whose size
  information on the TCP segment header is even lower numerically.  A number
  of years back SYN cookies were extended to store the additional state in
  the TCP timestamp fields, if available on a connection.  While timestamps
  are common among the BSD, Linux and other *nix systems Windows never enabled
  them by default and thus are not present for the vast majority of clients
  seen on the Internet.
  
  The common parameters used on TCP sessions have changed quite a bit since
  SYN cookies very invented some 17 years ago.  Today we have a lot more
  bandwidth available making the use window scaling almost mandatory.  Also
  SACK has become standard making recovering from packet loss much more
  efficient.
  
  This change moves all necessary information into the ISS removing the need
  for timestamps.  Both the MSS (16 bits) and send WSCALE (4 bits) are stored
  in 3 bit indexed form together with a single bit for SACK.  While this is
  significantly less than the original range, it is sufficient to encode all
  common values with minimal rounding.
  
  The MSS depends on the MTU of the path and with the dominance of ethernet
  the main value seen is around 1460 bytes.  Encapsulations for DSL lines
  and some other overheads reduce it by a few more bytes for many connections
  seen.  Rounding down to the next lower value in some cases isn't a problem
  as we send only slightly more packets for the same amount of data.
  
  The send WSCALE index is bit more tricky as rounding down under-estimates
  the available send space available towards the remote host, however a small
  number values dominate and are carefully selected again.
  
  The receive WSCALE isn't encoded at all but recalculated based on the local
  receive socket buffer size when a valid SYN cookie returns.  A listen socket
  buffer size is unlikely to change while active.
  
  The index values for MSS and WSCALE are selected for minimal rounding errors
  based on large traffic surveys.  These values have to be periodically
  validated against newer traffic surveys adjusting the arrays tcp_sc_msstab[]
  and tcp_sc_wstab[] if necessary.
  
  In addition the hash MAC to protect the SYN cookies is changed from MD5
  to SipHash-2-4, a much faster and cryptographically secure algorithm.
  
  Reviewed by:	dwmalone
  Tested by:	Fabian Keil 

Modified:
  head/sys/conf/files
  head/sys/netinet/tcp_syncache.c
  head/sys/netinet/tcp_syncache.h

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Thu Jul 11 15:02:38 2013	(r253209)
+++ head/sys/conf/files	Thu Jul 11 15:29:25 2013	(r253210)
@@ -547,6 +547,8 @@ crypto/sha1.c			optional carp | crypto |
 					 netgraph_mppc_encryption | sctp
 crypto/sha2/sha2.c		optional crypto | geom_bde | ipsec | random | \
 					 sctp | zfs
+crypto/siphash/siphash.c	optional inet | inet6
+crypto/siphash/siphash_test.c	optional inet | inet6
 ddb/db_access.c			optional ddb
 ddb/db_break.c			optional ddb
 ddb/db_capture.c		optional ddb

Modified: head/sys/netinet/tcp_syncache.c
==============================================================================
--- head/sys/netinet/tcp_syncache.c	Thu Jul 11 15:02:38 2013	(r253209)
+++ head/sys/netinet/tcp_syncache.c	Thu Jul 11 15:29:25 2013	(r253210)
@@ -1,12 +1,12 @@
 /*-
  * Copyright (c) 2001 McAfee, Inc.
- * Copyright (c) 2006 Andre Oppermann, Internet Business Solutions AG
+ * Copyright (c) 2006,2013 Andre Oppermann, Internet Business Solutions AG
  * All rights reserved.
  *
  * This software was developed for the FreeBSD Project by Jonathan Lemon
  * and McAfee Research, the Security Research Division of McAfee, Inc. under
  * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
- * DARPA CHATS research program.
+ * DARPA CHATS research program. [2001 McAfee, Inc.]
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 		/* for proc0 declaration */
 #include 
 #include 
@@ -55,6 +54,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+#include 
+
 #include 
 
 #include 
@@ -127,12 +129,20 @@ static int	 syncache_sysctl_count(SYSCTL
 static void	 syncache_timeout(struct syncache *sc, struct syncache_head *sch,
 		    int docallout);
 static void	 syncache_timer(void *);
-static void	 syncookie_generate(struct syncache_head *, struct syncache *,
-		    u_int32_t *);
+
+static uint32_t	 syncookie_mac(struct in_conninfo *, tcp_seq, uint8_t,
+		    uint8_t *, uintptr_t);
+static tcp_seq	 syncookie_generate(struct syncache_head *, struct syncache *);
 static struct syncache
 		*syncookie_lookup(struct in_conninfo *, struct syncache_head *,
-		    struct syncache *, struct tcpopt *, struct tcphdr *,
+		    struct syncache *, struct tcphdr *, struct tcpopt *,
 		    struct socket *);
+static void	 syncookie_reseed(void *);
+#ifdef INVARIANTS
+static int	 syncookie_cmp(struct in_conninfo *inc, struct syncache_head *sch,
+		    struct syncache *sc, struct tcphdr *th, struct tcpopt *to,
+		    struct socket *lso);
+#endif
 
 /*
  * Transmit the SYN,ACK fewer times than TCP_MAXRXTSHIFT specifies.
@@ -252,17 +262,19 @@ syncache_init(void)
 	V_tcp_syncache.hashbase = malloc(V_tcp_syncache.hashsize *
 	    sizeof(struct syncache_head), M_SYNCACHE, M_WAITOK | M_ZERO);
 
-	/* Initialize the hash buckets. */
-	for (i = 0; i < V_tcp_syncache.hashsize; i++) {
 #ifdef VIMAGE
-		V_tcp_syncache.hashbase[i].sch_vnet = curvnet;
+	V_tcp_syncache.vnet = curvnet;
 #endif
+
+	/* Initialize the hash buckets. */
+	for (i = 0; i < V_tcp_syncache.hashsize; i++) {
 		TAILQ_INIT(&V_tcp_syncache.hashbase[i].sch_bucket);
 		mtx_init(&V_tcp_syncache.hashbase[i].sch_mtx, "tcp_sc_head",
 			 NULL, MTX_DEF);
 		callout_init_mtx(&V_tcp_syncache.hashbase[i].sch_timer,
 			 &V_tcp_syncache.hashbase[i].sch_mtx, 0);
 		V_tcp_syncache.hashbase[i].sch_length = 0;
+		V_tcp_syncache.hashbase[i].sch_sc = &V_tcp_syncache;
 	}
 
 	/* Create the syncache entry zone. */
@@ -270,6 +282,13 @@ syncache_init(void)
 	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
 	V_tcp_syncache.cache_limit = uma_zone_set_max(V_tcp_syncache.zone,
 	    V_tcp_syncache.cache_limit);
+
+	/* Start the SYN cookie reseeder callout. */
+	callout_init(&V_tcp_syncache.secret.reseed, 1);
+	arc4rand(V_tcp_syncache.secret.key[0], SYNCOOKIE_SECRET_SIZE, 0);
+	arc4rand(V_tcp_syncache.secret.key[1], SYNCOOKIE_SECRET_SIZE, 0);
+	callout_reset(&V_tcp_syncache.secret.reseed, SYNCOOKIE_LIFETIME * hz,
+	    syncookie_reseed, &V_tcp_syncache);
 }
 
 #ifdef VIMAGE
@@ -303,6 +322,8 @@ syncache_destroy(void)
 	/* Free the allocated global resources. */
 	uma_zdestroy(V_tcp_syncache.zone);
 	free(V_tcp_syncache.hashbase, M_SYNCACHE);
+
+	callout_drain(&V_tcp_syncache.secret.reseed);
 }
 #endif
 
@@ -414,7 +435,7 @@ syncache_timer(void *xsch)
 	int tick = ticks;
 	char *s;
 
-	CURVNET_SET(sch->sch_vnet);
+	CURVNET_SET(sch->sch_sc->vnet);
 
 	/* NB: syncache_head has already been locked by the callout. */
 	SCH_LOCK_ASSERT(sch);
@@ -927,6 +948,16 @@ syncache_expand(struct in_conninfo *inc,
 
 	sc = syncache_lookup(inc, &sch);	/* returns locked sch */
 	SCH_LOCK_ASSERT(sch);
+
+#ifdef INVARIANTS
+	/*
+	 * Test code for syncookies comparing the syncache stored
+	 * values with the reconstructed values from the cookie.
+	 */
+	if (sc != NULL)
+		syncookie_cmp(inc, sch, sc, th, to, *lsop);
+#endif
+
 	if (sc == NULL) {
 		/*
 		 * There is no syncache entry, so see if this ACK is
@@ -946,7 +977,7 @@ syncache_expand(struct in_conninfo *inc,
 			goto failed;
 		}
 		bzero(&scs, sizeof(scs));
-		sc = syncookie_lookup(inc, sch, &scs, to, th, *lsop);
+		sc = syncookie_lookup(inc, sch, &scs, th, to, *lsop);
 		SCH_UNLOCK(sch);
 		if (sc == NULL) {
 			if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
@@ -1070,7 +1101,6 @@ syncache_add(struct in_conninfo *inc, st
 	struct syncache *sc = NULL;
 	struct syncache_head *sch;
 	struct mbuf *ipopts = NULL;
-	u_int32_t flowtmp;
 	u_int ltflags;
 	int win, sb_hiwat, ip_ttl, ip_tos;
 	char *s;
@@ -1311,19 +1341,17 @@ syncache_add(struct in_conninfo *inc, st
 	if ((th->th_flags & (TH_ECE|TH_CWR)) && V_tcp_do_ecn)
 		sc->sc_flags |= SCF_ECN;
 
-	if (V_tcp_syncookies) {
-		syncookie_generate(sch, sc, &flowtmp);
+	if (V_tcp_syncookies)
+		sc->sc_iss = syncookie_generate(sch, sc);
 #ifdef INET6
-		if (autoflowlabel)
-			sc->sc_flowlabel = flowtmp;
-#endif
-	} else {
-#ifdef INET6
-		if (autoflowlabel)
-			sc->sc_flowlabel =
-			    (htonl(ip6_randomflowlabel()) & IPV6_FLOWLABEL_MASK);
-#endif
+	if (autoflowlabel) {
+		if (V_tcp_syncookies)
+			sc->sc_flowlabel = sc->sc_iss;
+		else
+			sc->sc_flowlabel = ip6_randomflowlabel();
+		sc->sc_flowlabel = htonl(sc->sc_flowlabel) & IPV6_FLOWLABEL_MASK;
 	}
+#endif
 	SCH_UNLOCK(sch);
 
 	/*
@@ -1546,265 +1574,385 @@ syncache_respond(struct syncache *sc)
 }
 
 /*
- * The purpose of SYN cookies is to avoid keeping track of all SYN's we
- * receive and to be able to handle SYN floods from bogus source addresses
- * (where we will never receive any reply).  SYN floods try to exhaust all
- * our memory and available slots in the SYN cache table to cause a denial
- * of service to legitimate users of the local host.
+ * The purpose of syncookies is to handle spoofed SYN flooding DoS attacks
+ * that exceed the capacity of the syncache by avoiding the storage of any
+ * of the SYNs we receive.  Syncookies defend against blind SYN flooding
+ * attacks where the attacker does not have access to our responses.
+ *
+ * Syncookies encode and include all necessary information about the
+ * connection setup within the SYN|ACK that we send back.  That way we
+ * can avoid keeping any local state until the ACK to our SYN|ACK returns
+ * (if ever).  Normally the syncache and syncookies are running in parallel
+ * with the latter taking over when the former is exhausted.  When matching
+ * syncache entry is found the syncookie is ignored.
+ *
+ * The only reliable information persisting the 3WHS is our inital sequence
+ * number ISS of 32 bits.  Syncookies embed a cryptographically sufficient
+ * strong hash (MAC) value and a few bits of TCP SYN options in the ISS
+ * of our SYN|ACK.  The MAC can be recomputed when the ACK to our SYN|ACK
+ * returns and signifies a legitimate connection if it matches the ACK.
+ *
+ * The available space of 32 bits to store the hash and to encode the SYN
+ * option information is very tight and we should have at least 24 bits for
+ * the MAC to keep the number of guesses by blind spoofing reasonably high.
+ *
+ * SYN option information we have to encode to fully restore a connection:
+ * MSS: is imporant to chose an optimal segment size to avoid IP level
+ *   fragmentation along the path.  The common MSS values can be encoded
+ *   in a 3-bit table.  Uncommon values are captured by the next lower value
+ *   in the table leading to a slight increase in packetization overhead.
+ * WSCALE: is necessary to allow large windows to be used for high delay-
+ *   bandwidth product links.  Not scaling the window when it was initially
+ *   negotiated is bad for performance as lack of scaling further decreases
+ *   the apparent available send window.  We only need to encode the WSCALE
+ *   we received from the remote end.  Our end can be recalculated at any
+ *   time.  The common WSCALE values can be encoded in a 3-bit table.
+ *   Uncommon values are captured by the next lower value in the table
+ *   making us under-estimate the available window size halving our
+ *   theoretically possible maximum throughput for that connection.
+ * SACK: Greatly assists in packet loss recovery and requires 1 bit.
+ * TIMESTAMP and SIGNATURE is not encoded because they are permanent options
+ *   that are included in all segments on a connection.  We enable them when
+ *   the ACK has them.
  *
- * The idea of SYN cookies is to encode and include all necessary information
- * about the connection setup state within the SYN-ACK we send back and thus
- * to get along without keeping any local state until the ACK to the SYN-ACK
- * arrives (if ever).  Everything we need to know should be available from
- * the information we encoded in the SYN-ACK.
+ * Security of syncookies and attack vectors:
  *
- * More information about the theory behind SYN cookies and its first
- * discussion and specification can be found at:
- *  http://cr.yp.to/syncookies.html    (overview)
- *  http://cr.yp.to/syncookies/archive (gory details)
+ * The MAC is computed over (faddr||laddr||fport||lport||irs||flags||secmod)
+ * together with the gloabl secret to make it unique per connection attempt.
+ * Thus any change of any of those parameters results in a different MAC output
+ * in an unpredictable way unless a collision is encountered.  24 bits of the
+ * MAC are embedded into the ISS.
  *
- * This implementation extends the orginal idea and first implementation
- * of FreeBSD by using not only the initial sequence number field to store
- * information but also the timestamp field if present.  This way we can
- * keep track of the entire state we need to know to recreate the session in
- * its original form.  Almost all TCP speakers implement RFC1323 timestamps
- * these days.  For those that do not we still have to live with the known
- * shortcomings of the ISN only SYN cookies.
+ * To prevent replay attacks two rotating global secrets are updated with a
+ * new random value every 15 seconds.  The life-time of a syncookie is thus
+ * 15-30 seconds.
  *
- * Cookie layers:
+ * Vector 1: Attacking the secret.  This requires finding a weakness in the
+ * MAC itself or the way it is used here.  The attacker can do a chosen plain
+ * text attack by varying and testing the all parameters under his control.
+ * The strength depends on the size and randomness of the secret, and the
+ * cryptographic security of the MAC function.  Due to the constant updating
+ * of the secret the attacker has at most 29.999 seconds to find the secret
+ * and launch spoofed connections.  After that he has to start all over again.
  *
- * Initial sequence number we send:
- * 31|................................|0
- *    DDDDDDDDDDDDDDDDDDDDDDDDDMMMRRRP
- *    D = MD5 Digest (first dword)
- *    M = MSS index
- *    R = Rotation of secret
- *    P = Odd or Even secret
+ * Vector 2: Collision attack on the MAC of a single ACK.  With a 24 bit MAC
+ * size an average of 4,823 attempts are required for a 50% chance of success
+ * to spoof a single syncookie (birthday collision paradox).  However the
+ * attacker is blind and doesn't know if one of his attempts succeeded unless
+ * he has a side channel to interfere success from.  A single connection setup
+ * success average of 90% requires 8,790 packets, 99.99% requires 17,578 packets.
+ * This many attempts are required for each one blind spoofed connection.  For
+ * every additional spoofed connection he has to launch another N attempts.
+ * Thus for a sustained rate 100 spoofed connections per second approximately
+ * 1,800,000 packets per second would have to be sent.
  *
- * The MD5 Digest is computed with over following parameters:
- *  a) randomly rotated secret
- *  b) struct in_conninfo containing the remote/local ip/port (IPv4&IPv6)
- *  c) the received initial sequence number from remote host
- *  d) the rotation offset and odd/even bit
+ * NB: The MAC function should be fast so that it doesn't become a CPU
+ * exhaustion attack vector itself.
  *
- * Timestamp we send:
- * 31|................................|0
- *    DDDDDDDDDDDDDDDDDDDDDDSSSSRRRRA5
- *    D = MD5 Digest (third dword) (only as filler)
- *    S = Requested send window scale
- *    R = Requested receive window scale
- *    A = SACK allowed
- *    5 = TCP-MD5 enabled (not implemented yet)
- *    XORed with MD5 Digest (forth dword)
+ * References:
+ *  RFC4987 TCP SYN Flooding Attacks and Common Mitigations
+ *  SYN cookies were first proposed by cryptographer Dan J. Bernstein in 1996
+ *   http://cr.yp.to/syncookies.html    (overview)
+ *   http://cr.yp.to/syncookies/archive (details)
  *
- * The timestamp isn't cryptographically secure and doesn't need to be.
- * The double use of the MD5 digest dwords ties it to a specific remote/
- * local host/port, remote initial sequence number and our local time
- * limited secret.  A received timestamp is reverted (XORed) and then
- * the contained MD5 dword is compared to the computed one to ensure the
- * timestamp belongs to the SYN-ACK we sent.  The other parameters may
- * have been tampered with but this isn't different from supplying bogus
- * values in the SYN in the first place.
  *
- * Some problems with SYN cookies remain however:
- * Consider the problem of a recreated (and retransmitted) cookie.  If the
- * original SYN was accepted, the connection is established.  The second
- * SYN is inflight, and if it arrives with an ISN that falls within the
- * receive window, the connection is killed.
+ * Schematic construction of a syncookie enabled Initial Sequence Number:
+ *  0        1         2         3
+ *  12345678901234567890123456789012
+ * |xxxxxxxxxxxxxxxxxxxxxxxxWWWMMMSP|
  *
- * Notes:
- * A heuristic to determine when to accept syn cookies is not necessary.
- * An ACK flood would cause the syncookie verification to be attempted,
- * but a SYN flood causes syncookies to be generated.  Both are of equal
- * cost, so there's no point in trying to optimize the ACK flood case.
- * Also, if you don't process certain ACKs for some reason, then all someone
- * would have to do is launch a SYN and ACK flood at the same time, which
- * would stop cookie verification and defeat the entire purpose of syncookies.
+ *  x 24 MAC (truncated)
+ *  W  3 Send Window Scale index
+ *  M  3 MSS index
+ *  S  1 SACK permitted
+ *  P  1 Odd/even secret
  */
-static int tcp_sc_msstab[] = { 0, 256, 468, 536, 996, 1452, 1460, 8960 };
 
-static void
-syncookie_generate(struct syncache_head *sch, struct syncache *sc,
-    u_int32_t *flowlabel)
+/*
+ * Distribution and probability of certain MSS values.  Those in between are
+ * rounded down to the next lower one.
+ * [An Analysis of TCP Maximum Segment Sizes, S. Alcock and R. Nelson, 2011]
+ *                            .2%  .3%   5%    7%    7%    20%   15%   45%
+ */
+static int tcp_sc_msstab[] = { 216, 536, 1200, 1360, 1400, 1440, 1452, 1460 };
+
+/*
+ * Distribution and probability of certain WSCALE values.  We have to map the
+ * (send) window scale (shift) option with a range of 0-14 from 4 bits into 3
+ * bits based on prevalence of certain values.  Where we don't have an exact
+ * match for are rounded down to the next lower one letting us under-estimate
+ * the true available window.  At the moment this would happen only for the
+ * very uncommon values 3, 5 and those above 8 (more than 16MB socket buffer
+ * and window size).  The absence of the WSCALE option (no scaling in either
+ * direction) is encoded with index zero.
+ * [WSCALE values histograms, Allman, 2012]
+ *                            X 10 10 35  5  6 14 10%   by host
+ *                            X 11  4  5  5 18 49  3%   by connections
+ */
+static int tcp_sc_wstab[] = { 0, 0, 1, 2, 4, 6, 7, 8 };
+
+/*
+ * Compute the MAC for the SYN cookie.  SIPHASH-2-4 is chosen for its speed
+ * and good cryptographic properties.
+ */
+static uint32_t
+syncookie_mac(struct in_conninfo *inc, tcp_seq irs, uint8_t flags,
+    uint8_t *secbits, uintptr_t secmod)
 {
-	MD5_CTX ctx;
-	u_int32_t md5_buffer[MD5_DIGEST_LENGTH / sizeof(u_int32_t)];
-	u_int32_t data;
-	u_int32_t *secbits;
-	u_int off, pmss, mss;
-	int i;
+	SIPHASH_CTX ctx;
+	uint32_t siphash[2];
+
+	SipHash24_Init(&ctx);
+	SipHash_SetKey(&ctx, secbits);
+	switch (inc->inc_flags & INC_ISIPV6) {
+#ifdef INET
+	case 0:
+		SipHash_Update(&ctx, &inc->inc_faddr, sizeof(inc->inc_faddr));
+		SipHash_Update(&ctx, &inc->inc_laddr, sizeof(inc->inc_laddr));
+		break;
+#endif
+#ifdef INET6
+	case INC_ISIPV6:
+		SipHash_Update(&ctx, &inc->inc6_faddr, sizeof(inc->inc6_faddr));
+		SipHash_Update(&ctx, &inc->inc6_laddr, sizeof(inc->inc6_laddr));
+		break;
+#endif
+	}
+	SipHash_Update(&ctx, &inc->inc_fport, sizeof(inc->inc_fport));
+	SipHash_Update(&ctx, &inc->inc_lport, sizeof(inc->inc_lport));
+	SipHash_Update(&ctx, &flags, sizeof(flags));
+	SipHash_Update(&ctx, &secmod, sizeof(secmod));
+	SipHash_Final((u_int8_t *)&siphash, &ctx);
+
+	return (siphash[0] ^ siphash[1]);
+}
+
+static tcp_seq
+syncookie_generate(struct syncache_head *sch, struct syncache *sc)
+{
+	u_int i, mss, secbit, wscale;
+	uint32_t iss, hash;
+	uint8_t *secbits;
+	union syncookie cookie;
 
 	SCH_LOCK_ASSERT(sch);
 
-	/* Which of the two secrets to use. */
-	secbits = sch->sch_oddeven ?
-			sch->sch_secbits_odd : sch->sch_secbits_even;
+	cookie.cookie = 0;
 
-	/* Reseed secret if too old. */
-	if (sch->sch_reseed < time_uptime) {
-		sch->sch_oddeven = sch->sch_oddeven ? 0 : 1;	/* toggle */
-		secbits = sch->sch_oddeven ?
-				sch->sch_secbits_odd : sch->sch_secbits_even;
-		for (i = 0; i < SYNCOOKIE_SECRET_SIZE; i++)
-			secbits[i] = arc4random();
-		sch->sch_reseed = time_uptime + SYNCOOKIE_LIFETIME;
-	}
-
-	/* Secret rotation offset. */
-	off = sc->sc_iss & 0x7;			/* iss was randomized before */
-
-	/* Maximum segment size calculation. */
-	pmss =
-	    max( min(sc->sc_peer_mss, tcp_mssopt(&sc->sc_inc)),	V_tcp_minmss);
-	for (mss = sizeof(tcp_sc_msstab) / sizeof(int) - 1; mss > 0; mss--)
-		if (tcp_sc_msstab[mss] <= pmss)
-			break;
-
-	/* Fold parameters and MD5 digest into the ISN we will send. */
-	data = sch->sch_oddeven;/* odd or even secret, 1 bit */
-	data |= off << 1;	/* secret offset, derived from iss, 3 bits */
-	data |= mss << 4;	/* mss, 3 bits */
-
-	MD5Init(&ctx);
-	MD5Update(&ctx, ((u_int8_t *)secbits) + off,
-	    SYNCOOKIE_SECRET_SIZE * sizeof(*secbits) - off);
-	MD5Update(&ctx, secbits, off);
-	MD5Update(&ctx, &sc->sc_inc, sizeof(sc->sc_inc));
-	MD5Update(&ctx, &sc->sc_irs, sizeof(sc->sc_irs));
-	MD5Update(&ctx, &data, sizeof(data));
-	MD5Final((u_int8_t *)&md5_buffer, &ctx);
+	/* Map our computed MSS into the 3-bit index. */
+	mss = min(tcp_mssopt(&sc->sc_inc), max(sc->sc_peer_mss, V_tcp_minmss));
+	for (i = sizeof(tcp_sc_msstab) / sizeof(*tcp_sc_msstab) - 1;
+	     tcp_sc_msstab[i] > mss && i > 0;
+	     i--)
+		;
+	cookie.flags.mss_idx = i;
+
+	/*
+	 * Map the send window scale into the 3-bit index but only if
+	 * the wscale option was received.
+	 */
+	if (sc->sc_flags & SCF_WINSCALE) {
+		wscale = sc->sc_requested_s_scale;
+		for (i = sizeof(tcp_sc_wstab) / sizeof(*tcp_sc_wstab) - 1;
+		     tcp_sc_wstab[i] > wscale && i > 0;
+		     i--)
+			;
+		cookie.flags.wscale_idx = i;
+	}
+
+	/* Can we do SACK? */
+	if (sc->sc_flags & SCF_SACK)
+		cookie.flags.sack_ok = 1;
 
-	data |= (md5_buffer[0] << 7);
-	sc->sc_iss = data;
+	/* Which of the two secrets to use. */
+	secbit = sch->sch_sc->secret.oddeven & 0x1;
+	cookie.flags.odd_even = secbit;
 
-#ifdef INET6
-	*flowlabel = md5_buffer[1] & IPV6_FLOWLABEL_MASK;
-#endif
+	secbits = sch->sch_sc->secret.key[secbit];
+	hash = syncookie_mac(&sc->sc_inc, sc->sc_irs, cookie.cookie, secbits,
+	    (uintptr_t)sch);
+
+	/*
+	 * Put the flags into the hash and XOR them to get better ISS number
+	 * variance.  This doesn't enhance the cryptographic strength and is
+	 * done to prevent the 8 cookie bits from showing up directly on the
+	 * wire.
+	 */
+	iss = hash & ~0xff;
+	iss |= cookie.cookie ^ (hash >> 24);
 
-	/* Additional parameters are stored in the timestamp if present. */
+	/* Randomize the timestamp. */
 	if (sc->sc_flags & SCF_TIMESTAMP) {
-		data =  ((sc->sc_flags & SCF_SIGNATURE) ? 1 : 0); /* TCP-MD5, 1 bit */
-		data |= ((sc->sc_flags & SCF_SACK) ? 1 : 0) << 1; /* SACK, 1 bit */
-		data |= sc->sc_requested_s_scale << 2;  /* SWIN scale, 4 bits */
-		data |= sc->sc_requested_r_scale << 6;  /* RWIN scale, 4 bits */
-		data |= md5_buffer[2] << 10;		/* more digest bits */
-		data ^= md5_buffer[3];
-		sc->sc_ts = data;
-		sc->sc_tsoff = data - tcp_ts_getticks();	/* after XOR */
+		sc->sc_ts = arc4random();
+		sc->sc_tsoff = sc->sc_ts - tcp_ts_getticks();
 	}
 
 	TCPSTAT_INC(tcps_sc_sendcookie);
+	return (iss);
 }
 
 static struct syncache *
 syncookie_lookup(struct in_conninfo *inc, struct syncache_head *sch, 
-    struct syncache *sc, struct tcpopt *to, struct tcphdr *th,
-    struct socket *so)
+    struct syncache *sc, struct tcphdr *th, struct tcpopt *to,
+    struct socket *lso)
 {
-	MD5_CTX ctx;
-	u_int32_t md5_buffer[MD5_DIGEST_LENGTH / sizeof(u_int32_t)];
-	u_int32_t data = 0;
-	u_int32_t *secbits;
+	uint32_t hash;
+	uint8_t *secbits;
 	tcp_seq ack, seq;
-	int off, mss, wnd, flags;
+	int wnd, wscale = 0;
+	union syncookie cookie;
 
 	SCH_LOCK_ASSERT(sch);
 
 	/*
-	 * Pull information out of SYN-ACK/ACK and
-	 * revert sequence number advances.
+	 * Pull information out of SYN-ACK/ACK and revert sequence number
+	 * advances.
 	 */
 	ack = th->th_ack - 1;
 	seq = th->th_seq - 1;
-	off = (ack >> 1) & 0x7;
-	mss = (ack >> 4) & 0x7;
-	flags = ack & 0x7f;
-
-	/* Which of the two secrets to use. */
-	secbits = (flags & 0x1) ? sch->sch_secbits_odd : sch->sch_secbits_even;
 
 	/*
-	 * The secret wasn't updated for the lifetime of a syncookie,
-	 * so this SYN-ACK/ACK is either too old (replay) or totally bogus.
+	 * Unpack the flags containing enough information to restore the
+	 * connection.
 	 */
-	if (sch->sch_reseed + SYNCOOKIE_LIFETIME < time_uptime) {
-		return (NULL);
-	}
+	cookie.cookie = (ack & 0xff) ^ (ack >> 24);
 
-	/* Recompute the digest so we can compare it. */
-	MD5Init(&ctx);
-	MD5Update(&ctx, ((u_int8_t *)secbits) + off,
-	    SYNCOOKIE_SECRET_SIZE * sizeof(*secbits) - off);
-	MD5Update(&ctx, secbits, off);
-	MD5Update(&ctx, inc, sizeof(*inc));
-	MD5Update(&ctx, &seq, sizeof(seq));
-	MD5Update(&ctx, &flags, sizeof(flags));
-	MD5Final((u_int8_t *)&md5_buffer, &ctx);
+	/* Which of the two secrets to use. */
+	secbits = sch->sch_sc->secret.key[cookie.flags.odd_even];
 
-	/* Does the digest part of or ACK'ed ISS match? */
-	if ((ack & (~0x7f)) != (md5_buffer[0] << 7))
-		return (NULL);
+	hash = syncookie_mac(inc, seq, cookie.cookie, secbits, (uintptr_t)sch);
 
-	/* Does the digest part of our reflected timestamp match? */
-	if (to->to_flags & TOF_TS) {
-		data = md5_buffer[3] ^ to->to_tsecr;
-		if ((data & (~0x3ff)) != (md5_buffer[2] << 10))
-			return (NULL);
-	}
+	/* The recomputed hash matches the ACK if this was a genuine cookie. */
+	if ((ack & ~0xff) != (hash & ~0xff))
+		return (NULL);
 
 	/* Fill in the syncache values. */
+	sc->sc_flags = 0;
 	bcopy(inc, &sc->sc_inc, sizeof(struct in_conninfo));
 	sc->sc_ipopts = NULL;
 	
 	sc->sc_irs = seq;
 	sc->sc_iss = ack;
 
+	switch (inc->inc_flags & INC_ISIPV6) {
+#ifdef INET
+	case 0:
+		sc->sc_ip_ttl = sotoinpcb(lso)->inp_ip_ttl;
+		sc->sc_ip_tos = sotoinpcb(lso)->inp_ip_tos;
+		break;
+#endif
 #ifdef INET6
-	if (inc->inc_flags & INC_ISIPV6) {
-		if (sotoinpcb(so)->inp_flags & IN6P_AUTOFLOWLABEL)
-			sc->sc_flowlabel = md5_buffer[1] & IPV6_FLOWLABEL_MASK;
-	} else
+	case INC_ISIPV6:
+		if (sotoinpcb(lso)->inp_flags & IN6P_AUTOFLOWLABEL)
+			sc->sc_flowlabel = sc->sc_iss & IPV6_FLOWLABEL_MASK;
+		break;
 #endif
-	{
-		sc->sc_ip_ttl = sotoinpcb(so)->inp_ip_ttl;
-		sc->sc_ip_tos = sotoinpcb(so)->inp_ip_tos;
 	}
 
-	/* Additional parameters that were encoded in the timestamp. */
-	if (data) {
+	sc->sc_peer_mss = tcp_sc_msstab[cookie.flags.mss_idx];
+
+	/* We can simply recompute receive window scale we sent earlier. */
+	while (wscale < TCP_MAX_WINSHIFT && (TCP_MAXWIN << wscale) < sb_max)
+		wscale++;
+
+	/* Only use wscale if it was enabled in the orignal SYN. */
+	if (cookie.flags.wscale_idx > 0) {
+		sc->sc_requested_r_scale = wscale;
+		sc->sc_requested_s_scale = tcp_sc_wstab[cookie.flags.wscale_idx];
+		sc->sc_flags |= SCF_WINSCALE;
+	}
+
+	wnd = sbspace(&lso->so_rcv);
+	wnd = imax(wnd, 0);
+	wnd = imin(wnd, TCP_MAXWIN);
+	sc->sc_wnd = wnd;
+
+	if (cookie.flags.sack_ok)
+		sc->sc_flags |= SCF_SACK;
+
+	if (to->to_flags & TOF_TS) {
 		sc->sc_flags |= SCF_TIMESTAMP;
 		sc->sc_tsreflect = to->to_tsval;
 		sc->sc_ts = to->to_tsecr;
 		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,
-		    TCP_MAX_WINSHIFT);
-		sc->sc_requested_r_scale = min((data >> 6) & 0xf,
-		    TCP_MAX_WINSHIFT);
-		if (sc->sc_requested_s_scale || sc->sc_requested_r_scale)
-			sc->sc_flags |= SCF_WINSCALE;
-	} else
-		sc->sc_flags |= SCF_NOOPT;
+	}
 
-	wnd = sbspace(&so->so_rcv);
-	wnd = imax(wnd, 0);
-	wnd = imin(wnd, TCP_MAXWIN);
-	sc->sc_wnd = wnd;
+	if (to->to_flags & TOF_SIGNATURE)
+		sc->sc_flags |= SCF_SIGNATURE;
 
 	sc->sc_rxmits = 0;
-	sc->sc_peer_mss = tcp_sc_msstab[mss];
 
 	TCPSTAT_INC(tcps_sc_recvcookie);
 	return (sc);
 }
 
+#ifdef INVARIANTS
+static int
+syncookie_cmp(struct in_conninfo *inc, struct syncache_head *sch,
+    struct syncache *sc, struct tcphdr *th, struct tcpopt *to,
+    struct socket *lso)
+{
+	struct syncache scs, *scx;
+	char *s;
+
+	bzero(&scs, sizeof(scs));
+	scx = syncookie_lookup(inc, sch, &scs, th, to, lso);
+
+	if ((s = tcp_log_addrs(inc, th, NULL, NULL)) == NULL)
+		return (0);
+
+	if (scx != NULL) {
+		if (sc->sc_peer_mss != scx->sc_peer_mss)
+			log(LOG_DEBUG, "%s; %s: mss different %i vs %i\n",
+			    s, __func__, sc->sc_peer_mss, scx->sc_peer_mss);
+
+		if (sc->sc_requested_r_scale != scx->sc_requested_r_scale)
+			log(LOG_DEBUG, "%s; %s: rwscale different %i vs %i\n",
+			    s, __func__, sc->sc_requested_r_scale,
+			    scx->sc_requested_r_scale);
+
+		if (sc->sc_requested_s_scale != scx->sc_requested_s_scale)
+			log(LOG_DEBUG, "%s; %s: swscale different %i vs %i\n",
+			    s, __func__, sc->sc_requested_s_scale,
+			    scx->sc_requested_s_scale);
+
+		if ((sc->sc_flags & SCF_SACK) != (scx->sc_flags & SCF_SACK))
+			log(LOG_DEBUG, "%s; %s: SACK different\n", s, __func__);
+	}
+
+	if (s != NULL)
+		free(s, M_TCPLOG);
+	return (0);
+}
+#endif /* INVARIANTS */
+
+static void
+syncookie_reseed(void *arg)
+{
+	struct tcp_syncache *sc = arg;
+	uint8_t *secbits;
+	int secbit;
+
+	/*
+	 * Reseeding the secret doesn't have to be protected by a lock.
+	 * It only must be ensured that the new random values are visible
+	 * to all CPUs in a SMP environment.  The atomic with release
+	 * semantics ensures that.
+	 */
+	secbit = (sc->secret.oddeven & 0x1) ? 0 : 1;
+	secbits = sc->secret.key[secbit];
+	arc4rand(secbits, SYNCOOKIE_SECRET_SIZE, 0);
+	atomic_add_rel_int(&sc->secret.oddeven, 1);
+
+	/* Reschedule ourself. */
+	callout_schedule(&sc->secret.reseed, SYNCOOKIE_LIFETIME * hz);
+}
+
 /*
  * Returns the current number of syncache entries.  This number
  * will probably change before you get around to calling 
  * syncache_pcblist.
  */
-
 int
 syncache_pcbcount(void)
 {

Modified: head/sys/netinet/tcp_syncache.h
==============================================================================
--- head/sys/netinet/tcp_syncache.h	Thu Jul 11 15:02:38 2013	(r253209)
+++ head/sys/netinet/tcp_syncache.h	Thu Jul 11 15:29:25 2013	(r253210)
@@ -90,20 +90,23 @@ struct syncache {
 #define SCF_SACK	0x80			/* send SACK option */
 #define SCF_ECN		0x100			/* send ECN setup packet */
 
-#define	SYNCOOKIE_SECRET_SIZE	8	/* dwords */
-#define	SYNCOOKIE_LIFETIME	16	/* seconds */
-
 struct syncache_head {
-	struct vnet	*sch_vnet;
 	struct mtx	sch_mtx;
 	TAILQ_HEAD(sch_head, syncache)	sch_bucket;
 	struct callout	sch_timer;
 	int		sch_nextc;
 	u_int		sch_length;
-	u_int		sch_oddeven;
-	u_int32_t	sch_secbits_odd[SYNCOOKIE_SECRET_SIZE];
-	u_int32_t	sch_secbits_even[SYNCOOKIE_SECRET_SIZE];
-	u_int		sch_reseed;		/* time_uptime, seconds */
+	struct tcp_syncache *sch_sc;
+};
+
+#define	SYNCOOKIE_SECRET_SIZE	16
+#define	SYNCOOKIE_LIFETIME	15		/* seconds */
+
+struct syncookie_secret {
+	volatile u_int oddeven;
+	uint8_t key[2][SYNCOOKIE_SECRET_SIZE];
+	struct callout reseed;
+	u_int lifetime;
 };
 
 struct tcp_syncache {
@@ -115,6 +118,19 @@ struct tcp_syncache {
 	u_int	cache_limit;
 	u_int	rexmt_limit;
 	u_int	hash_secret;
+	struct vnet *sch_vnet;
+	struct syncookie_secret secret;
+};
+
+/* Internal use for the syncookie functions. */
+union syncookie {
+	uint8_t cookie;
+	struct {
+		uint8_t odd_even:1,
+			sack_ok:1,
+			wscale_idx:3,
+			mss_idx:3;
+	} flags;
 };
 
 #endif /* _KERNEL */

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 15:45:52 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 597078FD;
 Thu, 11 Jul 2013 15:45:52 +0000 (UTC)
 (envelope-from wblock@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 48C1B1685;
 Thu, 11 Jul 2013 15:45:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BFjqdd022502;
 Thu, 11 Jul 2013 15:45:52 GMT (envelope-from wblock@svn.freebsd.org)
Received: (from wblock@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BFjpWO022498;
 Thu, 11 Jul 2013 15:45:51 GMT (envelope-from wblock@svn.freebsd.org)
Message-Id: <201307111545.r6BFjpWO022498@svn.freebsd.org>
From: Warren Block 
Date: Thu, 11 Jul 2013 15:45:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253211 - in stable/9: sbin/geom/class/part sbin/reboot
 sys/boot/i386/gptboot
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 15:45:52 -0000

Author: wblock (doc committer)
Date: Thu Jul 11 15:45:51 2013
New Revision: 253211
URL: http://svnweb.freebsd.org/changeset/base/253211

Log:
  MFC r245910,r247370,r249371,r252492,r252586:
  
  r252586:
  
  Add descriptions to the FILES list, fix some mdoc complaints, move the
  "neither" entry out of the table in BOOTING.
  
  r252492:
  
  Add a new gptboot(8) man page.  Factor out the redundant information
  in gpart(8) and boot(8), adding references to gptboot(8) in both.
  
  r249371:
  
  Remove kernel options from the SYNOPSIS. They are already documented in the
  geom(4) manual page SYNOPSIS.
  
  r247370:
  
  Fix typo in EFI GPT GUID.
  
  r245910:
  
  Expand description of how gptboot and gptzfsboot choose a partition for
  booting.

Added:
  stable/9/sys/boot/i386/gptboot/gptboot.8
     - copied, changed from r252492, head/sys/boot/i386/gptboot/gptboot.8
Modified:
  stable/9/sbin/geom/class/part/gpart.8
  stable/9/sbin/reboot/boot_i386.8
  stable/9/sys/boot/i386/gptboot/Makefile
Directory Properties:
  stable/9/sbin/geom/class/part/   (props changed)
  stable/9/sbin/reboot/   (props changed)
  stable/9/sys/boot/i386/gptboot/   (props changed)

Modified: stable/9/sbin/geom/class/part/gpart.8
==============================================================================
--- stable/9/sbin/geom/class/part/gpart.8	Thu Jul 11 15:29:25 2013	(r253210)
+++ stable/9/sbin/geom/class/part/gpart.8	Thu Jul 11 15:45:51 2013	(r253211)
@@ -24,40 +24,13 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 3, 2013
+.Dd July 1, 2013
 .Dt GPART 8
 .Os
 .Sh NAME
 .Nm gpart
 .Nd "control utility for the disk partitioning GEOM class"
 .Sh SYNOPSIS
-To add support for the disk partitioning GEOM class,
-place one or more of the following
-lines in the kernel configuration file:
-.Bd -ragged -offset indent
-.Cd "options GEOM_PART_APM"
-.Cd "options GEOM_PART_BSD"
-.Cd "options GEOM_PART_GPT"
-.Cd "options GEOM_PART_LDM"
-.Cd "options GEOM_PART_MBR"
-.Cd "options GEOM_PART_EBR"
-.Cd "options GEOM_PART_EBR_COMPAT"
-.Cd "options GEOM_PART_PC98"
-.Cd "options GEOM_PART_VTOC8"
-.Ed
-.Pp
-These options provide support for the various types of partitioning
-schemes supported by the
-.Ns Nm
-utility.
-See
-.Sx "PARTITIONING SCHEMES"
-below for more details.
-.Pp
-Usage of the
-.Ns Nm
-utility:
-.Pp
 .\" ==== ADD ====
 .Nm
 .Cm add
@@ -583,7 +556,7 @@ The system partition for computers that 
 Interface (EFI).
 In such cases, the GPT partitioning scheme is used and the
 actual partition type for the system partition can also be specified as
-.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab" .
+.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b" .
 .It Cm freebsd
 A
 .Fx
@@ -672,14 +645,12 @@ The scheme-specific attributes for GPT:
 When set, the
 .Nm gptboot
 stage 1 boot loader will try to boot the system from this partition.
-Multiple partitions might be marked with the
+Multiple partitions can be marked with the
 .Cm bootme
 attribute.
-In such scenario the
-.Nm gptboot
-will try all
-.Cm bootme
-partitions one by one, until the next boot stage is successfully entered.
+See
+.Xr gptboot 8
+for more details.
 .It Cm bootonce
 Setting this attribute automatically sets the
 .Cm bootme
@@ -687,49 +658,14 @@ attribute.
 When set, the
 .Nm gptboot
 stage 1 boot loader will try to boot the system from this partition only once.
-Partitions with both
-.Cm bootonce
-and
-.Cm bootme
-attributes are tried before partitions with only the
-.Cm bootme
-attribute.
-Before
-.Cm bootonce
-partition is tried, the
-.Nm gptboot
-removes the
-.Cm bootme
-attribute and tries to execute the next boot stage.
-If it fails, the
-.Cm bootonce
-attribute that is now alone is replaced with the
-.Cm bootfailed
-attribute.
-If the execution of the next boot stage succeeds, but the system is not fully
-booted, the
-.Nm gptboot
-will look for
-.Cm bootonce
-attributes alone (without the
-.Cm bootme
-attribute) on the next system boot and will replace those with the
-.Cm bootfailed
-attribute.
-If the system is fully booted, the
-.Pa /etc/rc.d/gptboot
-start-up script will look for partition with the
-.Cm bootonce
-attribute alone, will remove the attribute and log that the system was
-successfully booted from this partition.
-There should be at most one
-.Cm bootonce
-partition when system is successfully booted.
-Multiple partitions might be marked with the
+Multiple partitions can be marked with the
 .Cm bootonce
 and
 .Cm bootme
 attribute pairs.
+See
+.Xr gptboot 8
+for more details.
 .It Cm bootfailed
 This attribute should not be manually managed.
 It is managed by the
@@ -737,14 +673,9 @@ It is managed by the
 stage 1 boot loader and the
 .Pa /etc/rc.d/gptboot
 start-up script.
-This attribute is used to mark partitions that had the
-.Cm bootonce
-attribute set, but we failed to boot from them.
-Once we successfully boot, the
-.Pa /etc/rc.d/gptboot
-script will log all the partitions we failed to boot from and will remove the
-.Cm bootfailed
-attributes.
+See
+.Xr gptboot 8
+for more details.
 .El
 .Pp
 The scheme-specific attributes for MBR:
@@ -807,34 +738,52 @@ Both types of bootstrap code are used to
 First, a protective MBR is embedded into the first disk sector from the
 .Pa /boot/pmbr
 image.
-It searches the GPT
+It searches through the GPT for a
 .Cm freebsd-boot
 partition (see the
 .Sx "PARTITION TYPES"
-section) in the GPT and runs the next bootstrap stage from it.
+section) and runs the next bootstrap stage from it.
 The
 .Cm freebsd-boot
 partition should be smaller than 545 KB.
+It can be located either before or after other
+.Fx
+partitions on the disk.
 There are two variants of bootstrap code to write to this partition:
 .Pa /boot/gptboot
 and
 .Pa /boot/gptzfsboot .
+.Pp
+.Pa /boot/gptboot
+is used to boot from UFS partitions.
+.Cm gptboot
+searches through
+.Cm freebsd-ufs
+partitions in the GPT and selects one to boot based on the
+.Cm bootonce
+and
+.Cm bootme
+attributes.
+If neither attribute is found,
 .Pa /boot/gptboot
-is used to boot from UFS.
-It searches
+boots from the first
 .Cm freebsd-ufs
-GPT partitions and starts
+partition.
 .Pa /boot/loader
 .Pq the third bootstrap stage
-if found.
-The
+is loaded from the first partition that matches these conditions.
+See
+.Xr gptboot 8
+for more information.
+.Pp
 .Pa /boot/gptzfsboot
 is used to boot from ZFS.
-It searches
+It searches through the GPT for
 .Cm freebsd-zfs
-GPT partitions and starts
+partitions, trying to detect ZFS pools.
+After all pools are detected,
 .Pa /boot/zfsloader
-if found.
+is started from the first one found.
 .Pp
 The VTOC8 scheme does not support embedding bootstrap code.
 Instead, the 8 KBytes bootstrap code image
@@ -945,7 +894,7 @@ The GEOM PART class can detect the same 
 different GEOM providers, and some of them will be marked as corrupt.
 Be careful when choosing a provider for recovery.
 If you choose incorrectly you can destroy the metadata of another GEOM class,
-e.g.\& GEOM MIRROR or GEOM LABEL.
+e.g.,\& GEOM MIRROR or GEOM LABEL.
 .Sh SYSCTL VARIABLES
 The following
 .Xr sysctl 8
@@ -1115,7 +1064,8 @@ and
 .Xr dd 1 ,
 .Xr geom 4 ,
 .Xr boot0cfg 8 ,
-.Xr geom 8
+.Xr geom 8 ,
+.Xr gptboot 8
 .Sh HISTORY
 The
 .Nm

Modified: stable/9/sbin/reboot/boot_i386.8
==============================================================================
--- stable/9/sbin/reboot/boot_i386.8	Thu Jul 11 15:29:25 2013	(r253210)
+++ stable/9/sbin/reboot/boot_i386.8	Thu Jul 11 15:45:51 2013	(r253211)
@@ -36,7 +36,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 4, 2010
+.Dd July 1, 2013
 .Dt BOOT 8 i386
 .Os
 .Sh NAME
@@ -352,6 +352,7 @@ requirement has not been adhered to.
 .Xr bsdlabel 8 ,
 .Xr btxld 8 ,
 .Xr config 8 ,
+.Xr gptboot 8 ,
 .Xr halt 8 ,
 .Xr loader 8 ,
 .Xr nextboot 8 ,

Modified: stable/9/sys/boot/i386/gptboot/Makefile
==============================================================================
--- stable/9/sys/boot/i386/gptboot/Makefile	Thu Jul 11 15:29:25 2013	(r253210)
+++ stable/9/sys/boot/i386/gptboot/Makefile	Thu Jul 11 15:45:51 2013	(r253211)
@@ -3,6 +3,7 @@
 .PATH:		${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common
 
 FILES=		gptboot
+MAN=		gptboot.8
 
 NM?=		nm
 

Copied and modified: stable/9/sys/boot/i386/gptboot/gptboot.8 (from r252492, head/sys/boot/i386/gptboot/gptboot.8)
==============================================================================
--- head/sys/boot/i386/gptboot/gptboot.8	Mon Jul  1 22:38:36 2013	(r252492, copy source)
+++ stable/9/sys/boot/i386/gptboot/gptboot.8	Thu Jul 11 15:45:51 2013	(r253211)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 1, 2013
+.Dd July 3, 2013
 .Dt GPTBOOT 8
 .Os
 .Sh NAME
@@ -147,7 +147,8 @@ Middle priority: booting is attempted fr
 partitions with the
 .Cm bootme
 attribute.
-.It neither
+.El
+.Pp
 If neither
 .Cm bootonce
 nor
@@ -156,7 +157,6 @@ attributes are found on any partitions, 
 first
 .Cm freebsd-ufs
 partition on the disk.
-.El
 .Sh POST-BOOT ACTIONS
 The startup script
 .Pa /etc/rc.d/gptboot
@@ -181,9 +181,12 @@ The
 attribute is cleared from the partition that successfully booted.
 There is normally only one of these.
 .Sh FILES
-.Bl -tag -width /boot/loader -compact
+.Bl -tag -width /boot/gptboot -compact
 .It Pa /boot/gptboot
+bootcode binary
 .It Pa /boot.config
+parameters for the boot blocks
+.Pq optional
 .El
 .Sh EXAMPLES
 .Nm
@@ -223,7 +226,6 @@ attribute:
 .Bd -literal -offset indent
 gpart set -a bootonce -i 2 ada0
 .Ed
-.Pp
 .Sh SEE ALSO
 .Xr boot.config 5 ,
 .Xr rc.conf 5 ,

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 15:53:20 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 82826E73;
 Thu, 11 Jul 2013 15:53:20 +0000 (UTC)
 (envelope-from wblock@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 5AD7016F6;
 Thu, 11 Jul 2013 15:53:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BFrKra025020;
 Thu, 11 Jul 2013 15:53:20 GMT (envelope-from wblock@svn.freebsd.org)
Received: (from wblock@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BFrK5J025019;
 Thu, 11 Jul 2013 15:53:20 GMT (envelope-from wblock@svn.freebsd.org)
Message-Id: <201307111553.r6BFrK5J025019@svn.freebsd.org>
From: Warren Block 
Date: Thu, 11 Jul 2013 15:53:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253212 - stable/9/usr.sbin/powerd
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 15:53:20 -0000

Author: wblock (doc committer)
Date: Thu Jul 11 15:53:19 2013
New Revision: 253212
URL: http://svnweb.freebsd.org/changeset/base/253212

Log:
  MFC r252696:
  
  Put the power modes in a list to make them easier to find.

Modified:
  stable/9/usr.sbin/powerd/powerd.8
Directory Properties:
  stable/9/usr.sbin/powerd/   (props changed)

Modified: stable/9/usr.sbin/powerd/powerd.8
==============================================================================
--- stable/9/usr.sbin/powerd/powerd.8	Thu Jul 11 15:45:51 2013	(r253211)
+++ stable/9/usr.sbin/powerd/powerd.8	Thu Jul 11 15:53:19 2013	(r253212)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 21, 2009
+.Dd July 4, 2013
 .Dt POWERD 8
 .Os
 .Sh NAME
@@ -47,27 +47,43 @@ The
 .Nm
 utility monitors the system state and sets various power control options
 accordingly.
-It offers four modes (maximum, minimum, adaptive and hiadaptive) that can be
-individually selected while on AC power or batteries.
-The modes maximum, minimum, adaptive and hiadaptive may be abbreviated
-max, min, adp, hadp.
-.Pp
-Maximum mode chooses the highest performance values.
-Minimum mode selects the lowest performance values to get the most power
-savings.
-Adaptive mode attempts to strike a balance by degrading performance when
-the system appears idle and increasing it when the system is busy.
+It offers power-saving modes that can be
+individually selected for operation on AC power or batteries.
+.Bl -tag -width ".Ar hiadaptive"
+.It Ar maximum
+Choose the highest performance values.
+May be abbreviated as
+.Ar max .
+.It Ar minimum
+Choose the lowest performance values to get the most power savings.
+May be abbreviated as
+.Ar min .
+.It Ar adaptive
+Attempt to strike a balance by degrading performance when the system
+appears idle and increasing it when the system is busy.
 It offers a good balance between a small performance loss for greatly
 increased power savings.
-Hiadaptive mode is like adaptive mode, but tuned for systems where
-performance and interactivity are more important than power consumption.
-It increases frequency faster, reduces the frequency less aggressively and
+May be abbreviated as
+.Ar adp .
+.It Ar hiadaptive
+Like
+.Ar adaptive
+mode, but tuned for systems where performance and interactivity are
+more important than power consumption.
+It increases frequency faster, reduces frequency less aggressively, and
 will maintain full frequency for longer.
-The default mode is adaptive for battery power and hiadaptive for the rest.
+May be abbreviated as
+.Ar hadp .
+.El
+.Pp
+The default mode is
+.Ar adaptive
+for battery power and
+.Ar hiadaptive
+for the rest.
 .Pp
-The
 .Nm
-utility recognizes the following runtime options:
+recognizes these runtime options:
 .Bl -tag -width ".Fl r Ar percent"
 .It Fl a Ar mode
 Selects the

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 15:55:58 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 5FCACFD8;
 Thu, 11 Jul 2013 15:55:58 +0000 (UTC)
 (envelope-from wblock@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 39CCE1715;
 Thu, 11 Jul 2013 15:55:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BFtw4C025468;
 Thu, 11 Jul 2013 15:55:58 GMT (envelope-from wblock@svn.freebsd.org)
Received: (from wblock@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BFtwUD025467;
 Thu, 11 Jul 2013 15:55:58 GMT (envelope-from wblock@svn.freebsd.org)
Message-Id: <201307111555.r6BFtwUD025467@svn.freebsd.org>
From: Warren Block 
Date: Thu, 11 Jul 2013 15:55:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253213 - stable/9/usr.sbin/powerd
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 15:55:58 -0000

Author: wblock (doc committer)
Date: Thu Jul 11 15:55:57 2013
New Revision: 253213
URL: http://svnweb.freebsd.org/changeset/base/253213

Log:
  MFC r252713:
  
  Whitespace fixes: remove tabs on blank links, spaces following content,
  tabs after spaces.

Modified:
  stable/9/usr.sbin/powerd/powerd.c
Directory Properties:
  stable/9/usr.sbin/powerd/   (props changed)

Modified: stable/9/usr.sbin/powerd/powerd.c
==============================================================================
--- stable/9/usr.sbin/powerd/powerd.c	Thu Jul 11 15:53:19 2013	(r253212)
+++ stable/9/usr.sbin/powerd/powerd.c	Thu Jul 11 15:55:57 2013	(r253213)
@@ -153,7 +153,7 @@ read_usage_times(int *load)
 	error = sysctl(cp_times_mib, 2, cp_times, &cp_times_len, NULL, 0);
 	if (error)
 		return (error);
-		
+
 	if (load) {
 		*load = 0;
 		for (cpu = 0; cpu < ncpus; cpu++) {
@@ -164,7 +164,7 @@ read_usage_times(int *load)
 			}
 			if (total == 0)
 				continue;
-			*load += 100 - (cp_times[cpu * CPUSTATES + CP_IDLE] - 
+			*load += 100 - (cp_times[cpu * CPUSTATES + CP_IDLE] -
 			    cp_times_old[cpu * CPUSTATES + CP_IDLE]) * 100 / total;
 		}
 	}
@@ -235,7 +235,7 @@ get_freq(void)
 {
 	size_t len;
 	int curfreq;
-	
+
 	len = sizeof(curfreq);
 	if (sysctl(freq_mib, 4, &curfreq, &len, NULL, 0) != 0) {
 		if (vflag)
@@ -261,7 +261,7 @@ static int
 get_freq_id(int freq, int *freqs, int numfreqs)
 {
 	int i = 1;
-	
+
 	while (i < numfreqs) {
 		if (freqs[i] < freq)
 			break;
@@ -716,7 +716,7 @@ main(int argc, char * argv[])
 				idle = 0;
 				if (set_freq(freq) != 0) {
 					warn("error setting CPU freq %d",
-				    	    freq);
+					    freq);
 					continue;
 				}
 			}
@@ -729,7 +729,7 @@ main(int argc, char * argv[])
 				warn("read_usage_times() failed");
 			continue;
 		}
-		
+
 		if (mode == MODE_ADAPTIVE) {
 			if (load > cpu_running_mark) {
 				if (load > 95 || load > cpu_running_mark * 2)
@@ -740,7 +740,7 @@ main(int argc, char * argv[])
 					freq = freqs[0];
 			} else if (load < cpu_idle_mark &&
 			    curfreq * load < freqs[get_freq_id(
-			    freq * 7 / 8, freqs, numfreqs)] * 
+			    freq * 7 / 8, freqs, numfreqs)] *
 			    cpu_running_mark) {
 				freq = freq * 7 / 8;
 				if (freq < freqs[numfreqs - 1])
@@ -756,7 +756,7 @@ main(int argc, char * argv[])
 					freq = freqs[0] * 2;
 			} else if (load < cpu_idle_mark / 2 &&
 			    curfreq * load < freqs[get_freq_id(
-			    freq * 31 / 32, freqs, numfreqs)] * 
+			    freq * 31 / 32, freqs, numfreqs)] *
 			    cpu_running_mark / 2) {
 				freq = freq * 31 / 32;
 				if (freq < freqs[numfreqs - 1])

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 16:11:20 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 44CF7A08
 for ; Thu, 11 Jul 2013 16:11:20 +0000 (UTC)
 (envelope-from andre@freebsd.org)
Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2])
 by mx1.freebsd.org (Postfix) with ESMTP id AC60917DA
 for ; Thu, 11 Jul 2013 16:11:19 +0000 (UTC)
Received: (qmail 89975 invoked from network); 11 Jul 2013 17:01:52 -0000
Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2])
 (envelope-sender )
 by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP
 for ; 11 Jul 2013 17:01:52 -0000
Message-ID: <51DED921.9030505@freebsd.org>
Date: Thu, 11 Jul 2013 18:11:13 +0200
From: Andre Oppermann 
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
 rv:17.0) Gecko/20130509 Thunderbird/17.0.6
MIME-Version: 1.0
To: Andre Oppermann 
Subject: Re: svn commit: r253208 - head/sys/crypto/siphash
References: <201307111418.r6BEIdIo094917@svn.freebsd.org>
In-Reply-To: <201307111418.r6BEIdIo094917@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
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 16:11:20 -0000

On 11.07.2013 16:18, Andre Oppermann wrote:
> Author: andre
> Date: Thu Jul 11 14:18:38 2013
> New Revision: 253208
> URL: http://svnweb.freebsd.org/changeset/base/253208
>
> Log:
>    SipHash is a cryptographically strong pseudo-random function (a.k.a. keyed
>    hash function) optimized for speed on short messages returning a 64bit hash/
>    digest value.
...
>    The number of update/finalization rounds is defined during initialization:
>
>     SipHash24_Init() for the fast and reasonable strong version.
>     SipHash48_Init() for the strong version (half as fast).
>
>    SipHash usage is similar to other hash functions:
>
>     struct SIPHASH_CTX ctx;
>     char *k = "16bytes long key"
>     char *s = "string";
>     uint64_t h = 0;
>     SipHash24_Init(&ctx);
>     SipHash_SetKey(&ctx, k);
>     SipHash_Update(&ctx, s, strlen(s));
>     SipHash_Final(&h, &ctx);  /* or */
>     h = SipHash_End(&ctx);    /* or */
>     h = SipHash24(&ctx, k, s, strlen(s));

Looking for a man page whiz to hack one up. :)

-- 
Andre


From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 16:27:11 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id DD71DF50;
 Thu, 11 Jul 2013 16:27:11 +0000 (UTC)
 (envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id D0069188C;
 Thu, 11 Jul 2013 16:27:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BGRB8t037943;
 Thu, 11 Jul 2013 16:27:11 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BGRBUa037942;
 Thu, 11 Jul 2013 16:27:11 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201307111627.r6BGRBUa037942@svn.freebsd.org>
From: Andre Oppermann 
Date: Thu, 11 Jul 2013 16:27:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253214 - head/sys/crypto/siphash
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 16:27:11 -0000

Author: andre
Date: Thu Jul 11 16:27:11 2013
New Revision: 253214
URL: http://svnweb.freebsd.org/changeset/base/253214

Log:
  Fix const propagation issues to make GCC happy.
  
  Submitted by:	Michael Butler 

Modified:
  head/sys/crypto/siphash/siphash.c

Modified: head/sys/crypto/siphash/siphash.c
==============================================================================
--- head/sys/crypto/siphash/siphash.c	Thu Jul 11 15:55:57 2013	(r253213)
+++ head/sys/crypto/siphash/siphash.c	Thu Jul 11 16:27:11 2013	(r253214)
@@ -119,7 +119,8 @@ SipBuf(SIPHASH_CTX *ctx, const uint8_t *
 void
 SipHash_Update(SIPHASH_CTX *ctx, const void *src, size_t len)
 {
-	uint64_t m, *p;
+	uint64_t m;
+	const uint64_t *p;
 	const uint8_t *s;
 	size_t rem;
 
@@ -144,13 +145,13 @@ SipHash_Update(SIPHASH_CTX *ctx, const v
 
 	/* Optimze for 64bit aligned/unaligned access. */
 	if (((uintptr_t)s & 0x7) == 0) {
-		for (p = (uint64_t *)s; len > 0; len--, p++) {
+		for (p = (const uint64_t *)s; len > 0; len--, p++) {
 			m = le64toh(*p);
 			ctx->v[3] ^= m;
 			SipRounds(ctx, 0);
 			ctx->v[0] ^= m;
 		}
-		s = (uint8_t *)p;
+		s = (const uint8_t *)p;
 	} else {
 		for (; len > 0; len--, s += 8) {
 			m = le64dec(s);

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 17:41:05 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 4233B656;
 Thu, 11 Jul 2013 17:41:05 +0000 (UTC)
 (envelope-from theraven@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 33A821C26;
 Thu, 11 Jul 2013 17:41:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BHf5Lo060845;
 Thu, 11 Jul 2013 17:41:05 GMT
 (envelope-from theraven@svn.freebsd.org)
Received: (from theraven@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BHf5gQ060844;
 Thu, 11 Jul 2013 17:41:05 GMT
 (envelope-from theraven@svn.freebsd.org)
Message-Id: <201307111741.r6BHf5gQ060844@svn.freebsd.org>
From: David Chisnall 
Date: Thu, 11 Jul 2013 17:41:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253215 - head/lib/msun/src
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 17:41:05 -0000

Author: theraven
Date: Thu Jul 11 17:41:04 2013
New Revision: 253215
URL: http://svnweb.freebsd.org/changeset/base/253215

Log:
  Cleanups to math.h that prevent namespace conflicts with C++.
  
  Reviewed by:	bde
  MFC after:	3 days

Modified:
  head/lib/msun/src/math.h

Modified: head/lib/msun/src/math.h
==============================================================================
--- head/lib/msun/src/math.h	Thu Jul 11 16:27:11 2013	(r253214)
+++ head/lib/msun/src/math.h	Thu Jul 11 17:41:04 2013	(r253215)
@@ -80,27 +80,33 @@ extern const union __nan_un {
 #define	FP_NORMAL	0x04
 #define	FP_SUBNORMAL	0x08
 #define	FP_ZERO		0x10
+
+#if __STDC_VERSION__ >= 201112L
+#define	__fp_type_select(x, f, d, ld) _Generic((x),     \
+	float: f(x),                                    \
+	double: d(x),                                   \
+	long double: ld(x))
+#elif __GNUC_PREREQ__(5, 1)
+#define	__fp_type_select(x, f, d, ld) __builtin_choose_expr(              \
+	__builtin_types_compatible_p(__typeof(x), long double), ld(x),    \
+	__builtin_choose_expr(                                            \
+	__builtin_types_compatible_p(__typeof(x), double), d(x),          \
+	__builtin_choose_expr(                                            \
+	__builtin_types_compatible_p(__typeof(x), float), f(x), (void)0)))
+#else
+#define	 __fp_type_select(x, f, d, ld)                         \
+	((sizeof(x) == sizeof(float)) ? f(x)                   \
+	: (sizeof(x) == sizeof(double)) ? d(x)                 \
+	: ld(x))
+#endif
+
 #define	fpclassify(x) \
-    ((sizeof (x) == sizeof (float)) ? __fpclassifyf(x) \
-    : (sizeof (x) == sizeof (double)) ? __fpclassifyd(x) \
-    : __fpclassifyl(x))
-
-#define	isfinite(x)					\
-    ((sizeof (x) == sizeof (float)) ? __isfinitef(x)	\
-    : (sizeof (x) == sizeof (double)) ? __isfinite(x)	\
-    : __isfinitel(x))
-#define	isinf(x)					\
-    ((sizeof (x) == sizeof (float)) ? __isinff(x)	\
-    : (sizeof (x) == sizeof (double)) ? isinf(x)	\
-    : __isinfl(x))
-#define	isnan(x)					\
-    ((sizeof (x) == sizeof (float)) ? __isnanf(x)	\
-    : (sizeof (x) == sizeof (double)) ? isnan(x)	\
-    : __isnanl(x))
-#define	isnormal(x)					\
-    ((sizeof (x) == sizeof (float)) ? __isnormalf(x)	\
-    : (sizeof (x) == sizeof (double)) ? __isnormal(x)	\
-    : __isnormall(x))
+	__fp_type_select(x, __fpclassifyf, __fpclassifyd, __fpclassifyd)
+#define	isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel)
+#define	isinf(x) __fp_type_select(x, __isinff, __isinf, __isinfl)
+#define	isnan(x) \
+	__fp_type_select(x, __inline_isnanf, __inline_isnan, __inline_isnanl)
+#define	isnormal(x) __fp_type_select(x, __isnormalf, __isnormal, __isnormall)
 
 #ifdef __MATH_BUILTIN_RELOPS
 #define	isgreater(x, y)		__builtin_isgreater((x), (y))
@@ -119,10 +125,7 @@ extern const union __nan_un {
 #define	isunordered(x, y)	(isnan(x) || isnan(y))
 #endif /* __MATH_BUILTIN_RELOPS */
 
-#define	signbit(x)					\
-    ((sizeof (x) == sizeof (float)) ? __signbitf(x)	\
-    : (sizeof (x) == sizeof (double)) ? __signbit(x)	\
-    : __signbitl(x))
+#define	signbit(x) __fp_type_select(x, __signbitf, __signbit, __signbitl)
 
 typedef	__double_t	double_t;
 typedef	__float_t	float_t;
@@ -175,9 +178,8 @@ int	__isfinitef(float) __pure2;
 int	__isfinite(double) __pure2;
 int	__isfinitel(long double) __pure2;
 int	__isinff(float) __pure2;
+int	__isinf(double) __pure2;
 int	__isinfl(long double) __pure2;
-int	__isnanf(float) __pure2;
-int	__isnanl(long double) __pure2;
 int	__isnormalf(float) __pure2;
 int	__isnormal(double) __pure2;
 int	__isnormall(long double) __pure2;
@@ -185,6 +187,27 @@ int	__signbit(double) __pure2;
 int	__signbitf(float) __pure2;
 int	__signbitl(long double) __pure2;
 
+static __inline int
+__inline_isnan(double __x)
+{
+
+	return (__x != __x);
+}
+
+static __inline int
+__inline_isnanf(float __x)
+{
+
+	return (__x != __x);
+}
+
+static __inline int
+__inline_isnanl(long double __x)
+{
+
+	return (__x != __x);
+}
+
 double	acos(double);
 double	asin(double);
 double	atan(double);
@@ -227,8 +250,6 @@ double	expm1(double);
 double	fma(double, double, double);
 double	hypot(double, double);
 int	ilogb(double) __pure2;
-int	(isinf)(double) __pure2;
-int	(isnan)(double) __pure2;
 double	lgamma(double);
 long long llrint(double);
 long long llround(double);

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 17:41:18 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 711F4786;
 Thu, 11 Jul 2013 17:41:18 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 by mx1.freebsd.org (Postfix) with ESMTP id 4D4A81C28;
 Thu, 11 Jul 2013 17:41:18 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
 by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6268BB953;
 Thu, 11 Jul 2013 13:41:17 -0400 (EDT)
From: John Baldwin 
To: Marcel Moolenaar 
Subject: Re: svn commit: r253161 - head/sys/dev/uart
Date: Thu, 11 Jul 2013 09:41:34 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; )
References: <201307101742.r6AHgKOm024113@svn.freebsd.org>
 <201307101409.42228.jhb@freebsd.org>
 
In-Reply-To: 
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201307110941.34400.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
 (bigwig.baldwin.cx); Thu, 11 Jul 2013 13:41:17 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 Marcel Moolenaar , src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 17:41:18 -0000

On Wednesday, July 10, 2013 3:59:40 pm Marcel Moolenaar wrote:
> 
> On Jul 10, 2013, at 11:09 AM, John Baldwin  wrote:
> 
> > On Wednesday, July 10, 2013 2:05:43 pm John Baldwin wrote:
> >> On Wednesday, July 10, 2013 1:42:20 pm Marcel Moolenaar wrote:
> >>> Author: marcel
> >>> Date: Wed Jul 10 17:42:20 2013
> >>> New Revision: 253161
> >>> URL: http://svnweb.freebsd.org/changeset/base/253161
> >>> 
> >>> Log:
> >>>  Protect against broken hardware. In this particular case, protect against
> >>>  H/W not de-asserting the interrupt at all. On x86, and because of the
> >>>  following conditions, this results in a hard hang with interrupts disabled:
> >>>  1.  The uart(4) driver uses a spin lock to protect against concurrent
> >>>      access to the H/W. Spin locks disable and restore interrupts.
> >>>  2.  Restoring the interrupt on x86 always writes the flags register. Even
> >>>      if we're restoring the interrupt from disabled to disabled.
> >>>  3.  The x86 CPU has a short window in which interrupts are enabled when the
> >>>      flags register is written.
> >> 
> >> Do you have proof of this?
> 
> No. I only have proof of a hard hang during auto configuration that
> cannot be fixed in any other way than not to setup the interrupt at
> all.

Ok.  I think what is happening is that you are just spinning in the interrupt
handler forever due to the hardware being stuck in that case in the old code.
I assume you tried just using the count first but it still hung?  (Perhaps the
interrupt was for a PCI device and level-triggered and so it kept reasserting
anyway?)

I think your change is correct for a uart that is stuck in this way regardless,
I just think the hang isn't related to weirdness with x86 temporarily
re-enabling interrupts.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 18:52:54 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 40148C02;
 Thu, 11 Jul 2013 18:52:54 +0000 (UTC)
 (envelope-from tijl@coosemans.org)
Received: from mailrelay010.isp.belgacom.be (mailrelay010.isp.belgacom.be
 [195.238.6.177])
 by mx1.freebsd.org (Postfix) with ESMTP id 59A3B1F5E;
 Thu, 11 Jul 2013 18:52:53 +0000 (UTC)
X-Belgacom-Dynamic: yes
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AmIGAJid3lFR8aPm/2dsb2JhbABagwkyg1O+SoEFF3SCIwEBBSMzIgEQCw4GBAkWCwICCQMCAQIBJx4GDQEHAQGIDwildpE+j1ARB4JWgR8DkA6BLYdIkCGDEzo
Received: from 230.163-241-81.adsl-dyn.isp.belgacom.be (HELO
 kalimero.tijl.coosemans.org) ([81.241.163.230])
 by relay.skynet.be with ESMTP; 11 Jul 2013 20:52:45 +0200
Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org
 [127.0.0.1])
 by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r6BIqiom029168;
 Thu, 11 Jul 2013 20:52:45 +0200 (CEST)
 (envelope-from tijl@coosemans.org)
Message-ID: <51DEFEF7.4080709@coosemans.org>
Date: Thu, 11 Jul 2013 20:52:39 +0200
From: Tijl Coosemans 
User-Agent: Mozilla/5.0 (X11; FreeBSD i386;
 rv:17.0) Gecko/20130701 Thunderbird/17.0.7
MIME-Version: 1.0
To: David Chisnall 
Subject: Re: svn commit: r253215 - head/lib/msun/src
References: <201307111741.r6BHf5gQ060844@svn.freebsd.org>
In-Reply-To: <201307111741.r6BHf5gQ060844@svn.freebsd.org>
X-Enigmail-Version: 1.5.1
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="----enig2ARPGUAAVSEBRLNCGTWEH"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 18:52:54 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
------enig2ARPGUAAVSEBRLNCGTWEH
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 2013-07-11 19:41, David Chisnall wrote:
> Author: theraven
> Date: Thu Jul 11 17:41:04 2013
> New Revision: 253215
> URL: http://svnweb.freebsd.org/changeset/base/253215
>=20
> Log:
>   Cleanups to math.h that prevent namespace conflicts with C++.
>  =20
>   Reviewed by:	bde
>   MFC after:	3 days
>=20
> Modified:
>   head/lib/msun/src/math.h
>=20
> Modified: head/lib/msun/src/math.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/lib/msun/src/math.h	Thu Jul 11 16:27:11 2013	(r253214)
> +++ head/lib/msun/src/math.h	Thu Jul 11 17:41:04 2013	(r253215)
> @@ -80,27 +80,33 @@ extern const union __nan_un {
>  #define	FP_NORMAL	0x04
>  #define	FP_SUBNORMAL	0x08
>  #define	FP_ZERO		0x10
> +
> +#if __STDC_VERSION__ >=3D 201112L
> +#define	__fp_type_select(x, f, d, ld) _Generic((x),     \
> +	float: f(x),                                    \
> +	double: d(x),                                   \
> +	long double: ld(x))

GCC doesn't support _Generic yet for -std=3Dc11.

> +#elif __GNUC_PREREQ__(5, 1)

GCC 3.1?

> +#define	__fp_type_select(x, f, d, ld) __builtin_choose_expr(          =
    \
> +	__builtin_types_compatible_p(__typeof(x), long double), ld(x),    \
> +	__builtin_choose_expr(                                            \
> +	__builtin_types_compatible_p(__typeof(x), double), d(x),          \
> +	__builtin_choose_expr(                                            \
> +	__builtin_types_compatible_p(__typeof(x), float), f(x), (void)0)))
> +#else
> +#define	 __fp_type_select(x, f, d, ld)                         \
> +	((sizeof(x) =3D=3D sizeof(float)) ? f(x)                   \
> +	: (sizeof(x) =3D=3D sizeof(double)) ? d(x)                 \
> +	: ld(x))
> +#endif
> +
>  #define	fpclassify(x) \
> -    ((sizeof (x) =3D=3D sizeof (float)) ? __fpclassifyf(x) \
> -    : (sizeof (x) =3D=3D sizeof (double)) ? __fpclassifyd(x) \
> -    : __fpclassifyl(x))
> -
> -#define	isfinite(x)					\
> -    ((sizeof (x) =3D=3D sizeof (float)) ? __isfinitef(x)	\
> -    : (sizeof (x) =3D=3D sizeof (double)) ? __isfinite(x)	\
> -    : __isfinitel(x))
> -#define	isinf(x)					\
> -    ((sizeof (x) =3D=3D sizeof (float)) ? __isinff(x)	\
> -    : (sizeof (x) =3D=3D sizeof (double)) ? isinf(x)	\
> -    : __isinfl(x))
> -#define	isnan(x)					\
> -    ((sizeof (x) =3D=3D sizeof (float)) ? __isnanf(x)	\
> -    : (sizeof (x) =3D=3D sizeof (double)) ? isnan(x)	\
> -    : __isnanl(x))
> -#define	isnormal(x)					\
> -    ((sizeof (x) =3D=3D sizeof (float)) ? __isnormalf(x)	\
> -    : (sizeof (x) =3D=3D sizeof (double)) ? __isnormal(x)	\
> -    : __isnormall(x))
> +	__fp_type_select(x, __fpclassifyf, __fpclassifyd, __fpclassifyd)

Last __fpclassifyd should be __fpclassifyl.

> @@ -227,8 +250,6 @@ double	expm1(double);
>  double	fma(double, double, double);
>  double	hypot(double, double);
>  int	ilogb(double) __pure2;
> -int	(isinf)(double) __pure2;
> -int	(isnan)(double) __pure2;

I think they should stay for the C90 case.


------enig2ARPGUAAVSEBRLNCGTWEH
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

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

iF4EAREIAAYFAlHe/vwACgkQfoCS2CCgtiv3QwD/USQ3ZRmBJDOZVM/rLceqnkT3
RdTlc2V1NOw0jIiQuQgA/1fZCdFTdAlEmewAxjjPNQDf2iKMBS1Hyu69iBPBszPG
=NRg+
-----END PGP SIGNATURE-----

------enig2ARPGUAAVSEBRLNCGTWEH--

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 19:04:20 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 3B54BEF0;
 Thu, 11 Jul 2013 19:04:20 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 2A0641FBD;
 Thu, 11 Jul 2013 19:04:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BJ4JVt084599;
 Thu, 11 Jul 2013 19:04:19 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BJ4Jd4084596;
 Thu, 11 Jul 2013 19:04:19 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201307111904.r6BJ4Jd4084596@svn.freebsd.org>
From: Glen Barber 
Date: Thu, 11 Jul 2013 19:04:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253216 - in stable/9: gnu/usr.bin/groff/tmac sys/conf
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 19:04:20 -0000

Author: gjb
Date: Thu Jul 11 19:04:19 2013
New Revision: 253216
URL: http://svnweb.freebsd.org/changeset/base/253216

Log:
  - Set stable/9 branch to -PRERELEASE status.
  - Add 9.2 mdoc(7) macro.
  
  Approved by:	re (implicit)
  Approved by:	kib (mentor)

Modified:
  stable/9/gnu/usr.bin/groff/tmac/mdoc.local
  stable/9/sys/conf/newvers.sh

Modified: stable/9/gnu/usr.bin/groff/tmac/mdoc.local
==============================================================================
--- stable/9/gnu/usr.bin/groff/tmac/mdoc.local	Thu Jul 11 17:41:04 2013	(r253215)
+++ stable/9/gnu/usr.bin/groff/tmac/mdoc.local	Thu Jul 11 19:04:19 2013	(r253216)
@@ -44,13 +44,14 @@
 .ds doc-str-Lb-librtld_db  Run-time Linker Debugging Library (librtld_db, \-lrtld_db)
 .
 .\" Default .Os value
-.ds doc-default-operating-system FreeBSD\~9.1
+.ds doc-default-operating-system FreeBSD\~9.2
 .
 .\" FreeBSD releases not found in doc-common
 .ds doc-operating-system-FreeBSD-7.4    7.4
 .ds doc-operating-system-FreeBSD-8.3    8.3
 .ds doc-operating-system-FreeBSD-8.4    8.4
 .ds doc-operating-system-FreeBSD-9.1    9.1
+.ds doc-operating-system-FreeBSD-9.2    9.2
 .ds doc-operating-system-FreeBSD-10.0   10.0
 .
 .\" Definitions not (yet) in doc-syms

Modified: stable/9/sys/conf/newvers.sh
==============================================================================
--- stable/9/sys/conf/newvers.sh	Thu Jul 11 17:41:04 2013	(r253215)
+++ stable/9/sys/conf/newvers.sh	Thu Jul 11 19:04:19 2013	(r253216)
@@ -31,8 +31,8 @@
 # $FreeBSD$
 
 TYPE="FreeBSD"
-REVISION="9.1"
-BRANCH="STABLE"
+REVISION="9.2"
+BRANCH="PRERELEASE"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
 	BRANCH=${BRANCH_OVERRIDE}
 fi

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 19:09:31 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id EA3442F1;
 Thu, 11 Jul 2013 19:09:31 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id DCE381FF8;
 Thu, 11 Jul 2013 19:09:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BJ9VJj085492;
 Thu, 11 Jul 2013 19:09:31 GMT (envelope-from np@svn.freebsd.org)
Received: (from np@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BJ9VXa085490;
 Thu, 11 Jul 2013 19:09:31 GMT (envelope-from np@svn.freebsd.org)
Message-Id: <201307111909.r6BJ9VXa085490@svn.freebsd.org>
From: Navdeep Parhar 
Date: Thu, 11 Jul 2013 19:09:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253217 - head/sys/dev/cxgbe
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 19:09:32 -0000

Author: np
Date: Thu Jul 11 19:09:31 2013
New Revision: 253217
URL: http://svnweb.freebsd.org/changeset/base/253217

Log:
  Attach to the 4x10G T540-CR card.

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Thu Jul 11 19:04:19 2013	(r253216)
+++ head/sys/dev/cxgbe/t4_main.c	Thu Jul 11 19:09:31 2013	(r253217)
@@ -448,13 +448,13 @@ struct {
 	{0xb000, "Chelsio Terminator 5 FPGA"},
 	{0x5400, "Chelsio T580-dbg"},
 	{0x5401,  "Chelsio T520-CR"},
+	{0x5403,  "Chelsio T540-CR"},		/* 4 x 10G */
 	{0x5407,  "Chelsio T520-SO"},
 	{0x5408,  "Chelsio T520-CX"},
 	{0x5410,  "Chelsio T580-LP-CR"},	/* 2 x 40G */
 	{0x5411,  "Chelsio T520-LL-CR"},
 #ifdef notyet
 	{0x5402,  "Chelsio T522-CR"},
-	{0x5403,  "Chelsio T540-CR"},
 	{0x5404,  "Chelsio T520-BCH"},
 	{0x5405,  "Chelsio T540-BCH"},
 	{0x5406,  "Chelsio T540-CH"},

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 19:18:13 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id E4C4157D;
 Thu, 11 Jul 2013 19:18:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id BAE201043;
 Thu, 11 Jul 2013 19:18:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BJIDiS088389;
 Thu, 11 Jul 2013 19:18:13 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BJIDR7088388;
 Thu, 11 Jul 2013 19:18:13 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201307111918.r6BJIDR7088388@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Thu, 11 Jul 2013 19:18:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253218 - stable/9/sys/fs/ext2fs
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 19:18:14 -0000

Author: pfg
Date: Thu Jul 11 19:18:13 2013
New Revision: 253218
URL: http://svnweb.freebsd.org/changeset/base/253218

Log:
  MFC	r253050:
  
  Enhancement when writing an entire block of a file (from UFS r231313).
  
  This change first attempts the uiomove() to the newly allocated
  (and dirty) buffer and only zeros it if the uiomove() fails. The
  effect is to eliminate the gratuitous zeroing of the buffer in
  the usual case where the uiomove() successfully fills it.

Modified:
  stable/9/sys/fs/ext2fs/ext2_vnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_vnops.c	Thu Jul 11 19:09:31 2013	(r253217)
+++ stable/9/sys/fs/ext2fs/ext2_vnops.c	Thu Jul 11 19:18:13 2013	(r253218)
@@ -1817,15 +1817,6 @@ ext2_write(struct vop_write_args *ap)
 		if (error != 0)
 			break;
 
-		/*
-		 * If the buffer is not valid and we did not clear garbage
-		 * out above, we have to do so here even though the write
-		 * covers the entire buffer in order to avoid a mmap()/write
-		 * race where another process may see the garbage prior to
-		 * the uiomove() for a write replacing it.
-		 */
-		if ((bp->b_flags & B_CACHE) == 0 && fs->e2fs_bsize <= xfersize)
-			vfs_bio_clrbuf(bp);
 		if ((ioflag & (IO_SYNC|IO_INVAL)) == (IO_SYNC|IO_INVAL))
 			bp->b_flags |= B_NOCACHE;
 		if (uio->uio_offset + xfersize > ip->i_size)
@@ -1836,6 +1827,26 @@ ext2_write(struct vop_write_args *ap)
 
 		error =
 		    uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio);
+		/*
+		 * If the buffer is not already filled and we encounter an
+		 * error while trying to fill it, we have to clear out any
+		 * garbage data from the pages instantiated for the buffer.
+		 * If we do not, a failed uiomove() during a write can leave
+		 * the prior contents of the pages exposed to a userland mmap.
+		 *
+		 * Note that we need only clear buffers with a transfer size
+		 * equal to the block size because buffers with a shorter
+		 * transfer size were cleared above by the call to ext2_balloc()
+		 * with the BA_CLRBUF flag set.
+		 *
+		 * If the source region for uiomove identically mmaps the
+		 * buffer, uiomove() performed the NOP copy, and the buffer
+		 * content remains valid because the page fault handler
+		 * validated the pages.
+		 */
+		if (error != 0 && (bp->b_flags & B_CACHE) == 0 &&
+		    fs->e2fs_bsize == xfersize)
+			vfs_bio_clrbuf(bp);
 		if (ioflag & (IO_VMIO|IO_DIRECT)) {
 			bp->b_flags |= B_RELBUF;
 		}

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 19:34:16 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id CE4658E1;
 Thu, 11 Jul 2013 19:34:16 +0000 (UTC)
 (envelope-from theraven@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id BFBAB10B7;
 Thu, 11 Jul 2013 19:34:16 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BJYG4S093698;
 Thu, 11 Jul 2013 19:34:16 GMT
 (envelope-from theraven@svn.freebsd.org)
Received: (from theraven@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BJYGNv093697;
 Thu, 11 Jul 2013 19:34:16 GMT
 (envelope-from theraven@svn.freebsd.org)
Message-Id: <201307111934.r6BJYGNv093697@svn.freebsd.org>
From: David Chisnall 
Date: Thu, 11 Jul 2013 19:34:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253219 - head/lib/msun/src
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 19:34:16 -0000

Author: theraven
Date: Thu Jul 11 19:34:16 2013
New Revision: 253219
URL: http://svnweb.freebsd.org/changeset/base/253219

Log:
  Fix some typoes in math.h cleanup.

Modified:
  head/lib/msun/src/math.h

Modified: head/lib/msun/src/math.h
==============================================================================
--- head/lib/msun/src/math.h	Thu Jul 11 19:18:13 2013	(r253218)
+++ head/lib/msun/src/math.h	Thu Jul 11 19:34:16 2013	(r253219)
@@ -81,12 +81,12 @@ extern const union __nan_un {
 #define	FP_SUBNORMAL	0x08
 #define	FP_ZERO		0x10
 
-#if __STDC_VERSION__ >= 201112L
+#if __STDC_VERSION__ >= 201112L && defined(__clang__)
 #define	__fp_type_select(x, f, d, ld) _Generic((x),     \
 	float: f(x),                                    \
 	double: d(x),                                   \
 	long double: ld(x))
-#elif __GNUC_PREREQ__(5, 1)
+#elif __GNUC_PREREQ__(3, 1)
 #define	__fp_type_select(x, f, d, ld) __builtin_choose_expr(              \
 	__builtin_types_compatible_p(__typeof(x), long double), ld(x),    \
 	__builtin_choose_expr(                                            \
@@ -101,7 +101,7 @@ extern const union __nan_un {
 #endif
 
 #define	fpclassify(x) \
-	__fp_type_select(x, __fpclassifyf, __fpclassifyd, __fpclassifyd)
+	__fp_type_select(x, __fpclassifyf, __fpclassifyd, __fpclassifyl)
 #define	isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel)
 #define	isinf(x) __fp_type_select(x, __isinff, __isinf, __isinfl)
 #define	isnan(x) \

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 19:37:10 2013
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 0D490A41;
 Thu, 11 Jul 2013 19:37:10 +0000 (UTC)
 (envelope-from theraven@FreeBSD.org)
Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27])
 by mx1.freebsd.org (Postfix) with ESMTP id B787710CF;
 Thu, 11 Jul 2013 19:37:08 +0000 (UTC)
Received: from [192.168.0.2]
 (cpc27-cmbg15-2-0-cust235.5-4.cable.virginmedia.com [86.27.188.236])
 (authenticated bits=0)
 by theravensnest.org (8.14.5/8.14.5) with ESMTP id r6BJb4Cs058535
 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO);
 Thu, 11 Jul 2013 19:37:05 GMT (envelope-from theraven@FreeBSD.org)
Content-Type: multipart/signed;
 boundary="Apple-Mail=_32F89FA4-D090-45FF-AA2C-83F200615C97";
 protocol="application/pgp-signature"; micalg=pgp-sha1
Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\))
Subject: Re: svn commit: r253215 - head/lib/msun/src
From: David Chisnall 
In-Reply-To: <51DEFEF7.4080709@coosemans.org>
Date: Thu, 11 Jul 2013 20:36:58 +0100
Message-Id: <7D521907-4802-4141-9A5E-40EB157A5AEF@FreeBSD.org>
References: <201307111741.r6BHf5gQ060844@svn.freebsd.org>
 <51DEFEF7.4080709@coosemans.org>
To: Tijl Coosemans 
X-Mailer: Apple Mail (2.1503)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
 src-committers@FreeBSD.org, David Chisnall 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 19:37:10 -0000


--Apple-Mail=_32F89FA4-D090-45FF-AA2C-83F200615C97
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

On 11 Jul 2013, at 19:52, Tijl Coosemans  wrote:

> GCC doesn't support _Generic yet for -std=3Dc11.

Ugh.  Given that they also lack a fine-grained feature check mechanism, =
they really should not advertise support for a language dialect if they =
don't support it.

>=20
>> +#elif __GNUC_PREREQ__(5, 1)
>=20
> GCC 3.1?

Ooops, I changed this to 5.1 to test the other code path and forgot to =
revert it.

> Last __fpclassifyd should be __fpclassifyl.

Fixed.

>> @@ -227,8 +250,6 @@ double	expm1(double);
>> double	fma(double, double, double);
>> double	hypot(double, double);
>> int	ilogb(double) __pure2;
>> -int	(isinf)(double) __pure2;
>> -int	(isnan)(double) __pure2;
>=20
> I think they should stay for the C90 case.

That would completely defeat the point of this entire exercise and be =
redundant unless we aim to support a compiler that only supports C90 and =
no GNU extensions, in which case you'll hit errors in cdefs.h, long =
before you get to this point in an include. =20

David



--Apple-Mail=_32F89FA4-D090-45FF-AA2C-83F200615C97
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
Comment: GPGTools - http://gpgtools.org

iQIcBAEBAgAGBQJR3wlaAAoJEKx65DEEsqIdV+gP/jHKkH9K6qTYWJyVj4qLTWE0
1IecE8rEF+mgo53VKFtzcZyO6IAHAvfPkQDk57FjWMmykzkL1hQGFc0w8ncdbiUG
1ETknOrzNO4H4biCZQN/9nvL6UGQB2RAPgJ1eBTypMaes2uIIEx1iy1tl1OyEfRd
ohSltgdafnaAnCkM6MSEX3N77Zj5vT7SkzYb3BePkl+fPy/cb1Rdy94w2wUqXWo6
VSDqN0VP0ecWqinNJw58uEV5NAcnN1f1kDxDWCAEBfFWbTOf8V+4r+BO8jQlZG7u
Yv52V4pSY592HIJPjlmGIQ+wvzEbuf6jRnjVdZdqGqjziz9gIpUNHRn92p4il7vc
bfdljT5nY19RyEzes+7ZIeQlfzzy1GSWcgdnzAyNbpgoGBszMN+ZbsWXQxWShCcN
xM7HerErkWcj4E2P4iz5SsNY6Uz9JOhNPtfVu9Zvb359VV3VfDYLf/6MVejTMRGb
WaO9O2jPe1RQ9tOH7k7/P6O9u5/sGczK2j3l/Z+UmC8GsoEI9kjTYLOQAKoDTdAx
mO6tfc2FEFCVvOZ+WdjWI+7cF0Y3aABAaNKIA47WUP9JBfqCJjPna/82dWknU3iK
bvhj3h8puoF2FBoD8/g0K6/3OM+m8W+6veNTwklnV7COvPDMlGCRMCc9GCwLJkzy
l5RLiXUcpQcD/qk6mB1D
=NvnX
-----END PGP SIGNATURE-----

--Apple-Mail=_32F89FA4-D090-45FF-AA2C-83F200615C97--

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 20:05:07 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 96D94328;
 Thu, 11 Jul 2013 20:05:07 +0000 (UTC)
 (envelope-from tijl@coosemans.org)
Received: from mailrelay005.isp.belgacom.be (mailrelay005.isp.belgacom.be
 [195.238.6.171])
 by mx1.freebsd.org (Postfix) with ESMTP id AF29A11DA;
 Thu, 11 Jul 2013 20:05:06 +0000 (UTC)
X-Belgacom-Dynamic: yes
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AuwGAEAP31FR8aPm/2dsb2JhbABagwmDPr8VgQYXdIIjAQEFViIBEAsOCgkWDwkDAgECASceBgEMAQUCAQGID7dbj2EHg3UDkA6BLZdpgxM6
Received: from 230.163-241-81.adsl-dyn.isp.belgacom.be (HELO
 kalimero.tijl.coosemans.org) ([81.241.163.230])
 by relay.skynet.be with ESMTP; 11 Jul 2013 22:03:56 +0200
Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org
 [127.0.0.1])
 by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r6BK3sr0029504;
 Thu, 11 Jul 2013 22:03:54 +0200 (CEST)
 (envelope-from tijl@coosemans.org)
Message-ID: <51DF0FA5.4050106@coosemans.org>
Date: Thu, 11 Jul 2013 22:03:49 +0200
From: Tijl Coosemans 
User-Agent: Mozilla/5.0 (X11; FreeBSD i386;
 rv:17.0) Gecko/20130701 Thunderbird/17.0.7
MIME-Version: 1.0
To: David Chisnall , Bruce Evans 
Subject: Re: svn commit: r253215 - head/lib/msun/src
References: <201307111741.r6BHf5gQ060844@svn.freebsd.org>
 <51DEFEF7.4080709@coosemans.org>
 <7D521907-4802-4141-9A5E-40EB157A5AEF@FreeBSD.org>
In-Reply-To: <7D521907-4802-4141-9A5E-40EB157A5AEF@FreeBSD.org>
X-Enigmail-Version: 1.5.1
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="----enig2JFRNAHPSRCEWMEIXBBSG"
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
 src-committers@FreeBSD.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 20:05:07 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
------enig2JFRNAHPSRCEWMEIXBBSG
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 2013-07-11 21:36, David Chisnall wrote:
> On 11 Jul 2013, at 19:52, Tijl Coosemans  wrote:
>>> @@ -227,8 +250,6 @@ double	expm1(double);
>>> double	fma(double, double, double);
>>> double	hypot(double, double);
>>> int	ilogb(double) __pure2;
>>> -int	(isinf)(double) __pure2;
>>> -int	(isnan)(double) __pure2;
>>
>> I think they should stay for the C90 case.
>=20
> That would completely defeat the point of this entire exercise and be
> redundant unless we aim to support a compiler that only supports C90
> and no GNU extensions, in which case you'll hit errors in cdefs.h,
> long before you get to this point in an include.

isnan(double) is part of SUSv2. It should be visible when compiling with
-D_XOPEN_SOURCE=3D500. I think you need something like this:

#if (__BSD_VISIBLE || __XSI_VISIBLE <=3D 500) && __ISO_C_VISIBLE < 1999
int	isinf(double) __pure2;
int	isnan(double) __pure2;
#endif


------enig2JFRNAHPSRCEWMEIXBBSG
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

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

iF4EAREIAAYFAlHfD6oACgkQfoCS2CCgtitHbAD9FmMy9FG+6k9abgI2j5xP9LOD
wYatLfRjnD/UGDjnPT0A/ihVf5GqJXKFCHvH2R163dYmnny3q0qlzQfk/B3wJKU/
=N4xj
-----END PGP SIGNATURE-----

------enig2JFRNAHPSRCEWMEIXBBSG--

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 20:09:47 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 4EBAE6A3;
 Thu, 11 Jul 2013 20:09:47 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 261991222;
 Thu, 11 Jul 2013 20:09:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BK9l7x003675;
 Thu, 11 Jul 2013 20:09:47 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BK9kD0003673;
 Thu, 11 Jul 2013 20:09:46 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201307112009.r6BK9kD0003673@svn.freebsd.org>
From: Dimitry Andric 
Date: Thu, 11 Jul 2013 20:09:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253220 - stable/9/share/mk
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 20:09:47 -0000

Author: dim
Date: Thu Jul 11 20:09:46 2013
New Revision: 253220
URL: http://svnweb.freebsd.org/changeset/base/253220

Log:
  MFC r240966 (by brooks)
  
  Add a COMPILER_FEATURES variable that is set in bsd.compiler.mk.
  
  When the compiler is clang add c++11 to COMPILER_FEATURES.
  
  When the compiler supports c++11, default to building libc++.  This will
  not impact the compliation of programs, but will make it easier for
  users with clang compiled systems to test libc++ by passing -stdlib=libc++
  to their c++ compliations.

Modified:
  stable/9/share/mk/bsd.compiler.mk
  stable/9/share/mk/bsd.own.mk
Directory Properties:
  stable/9/share/   (props changed)
  stable/9/share/mk/   (props changed)

Modified: stable/9/share/mk/bsd.compiler.mk
==============================================================================
--- stable/9/share/mk/bsd.compiler.mk	Thu Jul 11 19:34:16 2013	(r253219)
+++ stable/9/share/mk/bsd.compiler.mk	Thu Jul 11 20:09:46 2013	(r253220)
@@ -19,3 +19,9 @@ COMPILER_TYPE:=	clang
 .  undef _COMPILER_VERSION
 . endif
 .endif
+
+.if ${COMPILER_TYPE} == "clang"
+COMPILER_FEATURES=	c++11
+.else
+COMPILER_FEATURES=
+.endif

Modified: stable/9/share/mk/bsd.own.mk
==============================================================================
--- stable/9/share/mk/bsd.own.mk	Thu Jul 11 19:34:16 2013	(r253219)
+++ stable/9/share/mk/bsd.own.mk	Thu Jul 11 20:09:46 2013	(r253220)
@@ -447,7 +447,6 @@ __DEFAULT_NO_OPTIONS = \
     HESIOD \
     ICONV \
     IDEA \
-    LIBCPLUSPLUS \
     NMTREE \
     OFED \
     OPENSSH_NONE_CIPHER \
@@ -603,10 +602,6 @@ MK_CLANG_FULL:= no
 MK_CLANG_IS_CC:= no
 .endif
 
-MK_LIBCPLUSPLUS?= no
-
-MK_LIBCPLUSPLUS?= no
-
 #
 # Set defaults for the MK_*_SUPPORT variables.
 #
@@ -660,6 +655,33 @@ MK_${vv:H}:=	${MK_${vv:T}}
 .endif
 .endfor
 
+#
+# MK_* options that default to "yes" if the compiler is a C++11 compiler.
+#
+.include 
+.for var in \
+    LIBCPLUSPLUS
+.if defined(WITH_${var}) && defined(WITHOUT_${var})
+.error WITH_${var} and WITHOUT_${var} can't both be set.
+.endif
+.if defined(MK_${var})
+.error MK_${var} can't be set by a user.
+.endif
+.if ${COMPILER_FEATURES:Mc++11}
+.if defined(WITHOUT_${var})
+MK_${var}:=	no
+.else
+MK_${var}:=	yes
+.endif
+.else
+.if defined(WITH_${var})
+MK_${var}:=	yes
+.else
+MK_${var}:=	no
+.endif
+.endif
+.endfor
+
 .if ${MK_CTF} != "no"
 CTFCONVERT_CMD=	${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
 .elif defined(.PARSEDIR) || ${MAKE_VERSION} >= 9201210220

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 20:27:50 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 92D0ACAF;
 Thu, 11 Jul 2013 20:27:50 +0000 (UTC)
 (envelope-from tijl@coosemans.org)
Received: from mailrelay009.isp.belgacom.be (mailrelay009.isp.belgacom.be
 [195.238.6.176])
 by mx1.freebsd.org (Postfix) with ESMTP id A479D1344;
 Thu, 11 Jul 2013 20:27:49 +0000 (UTC)
X-Belgacom-Dynamic: yes
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Al4GADsU31FR8aPm/2dsb2JhbABagwnCVIEGF3SCIwEBBVYjEAsOCgklDwIoHgYBDAEFAgEBiA+3ZY9hB4N1A5AOgS2XaYMTOg
Received: from 230.163-241-81.adsl-dyn.isp.belgacom.be (HELO
 kalimero.tijl.coosemans.org) ([81.241.163.230])
 by relay.skynet.be with ESMTP; 11 Jul 2013 22:26:39 +0200
Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org
 [127.0.0.1])
 by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r6BKQcQU029608;
 Thu, 11 Jul 2013 22:26:38 +0200 (CEST)
 (envelope-from tijl@coosemans.org)
Message-ID: <51DF14F9.50001@coosemans.org>
Date: Thu, 11 Jul 2013 22:26:33 +0200
From: Tijl Coosemans 
User-Agent: Mozilla/5.0 (X11; FreeBSD i386;
 rv:17.0) Gecko/20130701 Thunderbird/17.0.7
MIME-Version: 1.0
To: David Chisnall , Bruce Evans 
Subject: Re: svn commit: r253215 - head/lib/msun/src
References: <201307111741.r6BHf5gQ060844@svn.freebsd.org>
 <51DEFEF7.4080709@coosemans.org>
 <7D521907-4802-4141-9A5E-40EB157A5AEF@FreeBSD.org>
 <51DF0FA5.4050106@coosemans.org>
In-Reply-To: <51DF0FA5.4050106@coosemans.org>
X-Enigmail-Version: 1.5.1
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="----enig2PCBEHFJOSCTIFNHTVUBT"
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
 src-committers@FreeBSD.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 20:27:50 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
------enig2PCBEHFJOSCTIFNHTVUBT
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 2013-07-11 22:03, Tijl Coosemans wrote:
> On 2013-07-11 21:36, David Chisnall wrote:
>> On 11 Jul 2013, at 19:52, Tijl Coosemans  wrote:
>>>> @@ -227,8 +250,6 @@ double	expm1(double);
>>>> double	fma(double, double, double);
>>>> double	hypot(double, double);
>>>> int	ilogb(double) __pure2;
>>>> -int	(isinf)(double) __pure2;
>>>> -int	(isnan)(double) __pure2;
>>>
>>> I think they should stay for the C90 case.
>>
>> That would completely defeat the point of this entire exercise and be
>> redundant unless we aim to support a compiler that only supports C90
>> and no GNU extensions, in which case you'll hit errors in cdefs.h,
>> long before you get to this point in an include.
>=20
> isnan(double) is part of SUSv2. It should be visible when compiling wit=
h
> -D_XOPEN_SOURCE=3D500. I think you need something like this:
>=20
> #if (__BSD_VISIBLE || __XSI_VISIBLE <=3D 500) && __ISO_C_VISIBLE < 1999=

> int	isinf(double) __pure2;
> int	isnan(double) __pure2;
> #endif

Actually this:

#if (__BSD_VISIBLE || (defined(__XSI_VISIBLE) && __XSI_VISIBLE <=3D 500))=
 && __ISO_C_VISIBLE < 1999




------enig2PCBEHFJOSCTIFNHTVUBT
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

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

iF4EAREIAAYFAlHfFP4ACgkQfoCS2CCgtitdoAD+OXfe70zo9LnLZ7pWOL3fWj2h
e4JB/MtzTPBIAjgV6uIA/ilsgIqqgBMo3Ml/9qXL02hXpFFNXG477yXNlNJr3RGW
=xmqp
-----END PGP SIGNATURE-----

------enig2PCBEHFJOSCTIFNHTVUBT--

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 20:33:58 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 1BC0FE62;
 Thu, 11 Jul 2013 20:33:58 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 0E091136C;
 Thu, 11 Jul 2013 20:33:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BKXvsM012005;
 Thu, 11 Jul 2013 20:33:57 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BKXvFf012004;
 Thu, 11 Jul 2013 20:33:57 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307112033.r6BKXvFf012004@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 11 Jul 2013 20:33:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253221 - head/sys/vm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 20:33:58 -0000

Author: kib
Date: Thu Jul 11 20:33:57 2013
New Revision: 253221
URL: http://svnweb.freebsd.org/changeset/base/253221

Log:
  When swap pager allocates metadata in the pagedaemon context, allow it
  to drain the reserve.  This was broken in r243040, causing deadlock.
  Note that VM_WAIT call in case of uma_zalloc() failure from pagedaemon
  would only wait for the v_pageout_free_min anyway.
  
  Reported and tested by:	pho
  Reviewed by:	alc
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c	Thu Jul 11 20:09:46 2013	(r253220)
+++ head/sys/vm/swap_pager.c	Thu Jul 11 20:33:57 2013	(r253221)
@@ -1855,7 +1855,8 @@ retry:
 		if (swapblk == SWAPBLK_NONE)
 			goto done;
 
-		swap = *pswap = uma_zalloc(swap_zone, M_NOWAIT);
+		swap = *pswap = uma_zalloc(swap_zone, M_NOWAIT |
+		    (curproc == pageproc ? M_USE_RESERVE : 0));
 		if (swap == NULL) {
 			mtx_unlock(&swhash_mtx);
 			VM_OBJECT_WUNLOCK(object);

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 20:36:25 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 976671A5;
 Thu, 11 Jul 2013 20:36:25 +0000 (UTC)
 (envelope-from to.my.trociny@gmail.com)
Received: from mail-ee0-x232.google.com (mail-ee0-x232.google.com
 [IPv6:2a00:1450:4013:c00::232])
 by mx1.freebsd.org (Postfix) with ESMTP id AB0571380;
 Thu, 11 Jul 2013 20:36:24 +0000 (UTC)
Received: by mail-ee0-f50.google.com with SMTP id d49so5699719eek.23
 for ; Thu, 11 Jul 2013 13:36:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=vXdiPiBRWFzcmTCNPjXfW5uWpmjN5WukkXxzWOvCFrY=;
 b=kQIlHdt0zIbY1/TinQDMFkCGLHx79JE5mbgSSW56dnDMn1CfgbmErLV7lmXz8H4Bio
 LXkhKnCaazvVRer6hnDggwgLXPoUQ4OK1wtNXOgsuILybby08u2/Sj6ThLh0PoXNrflr
 +HvRyDF8EPUndhConEnlADLq3oLuTQP1mONsjv1TGCWS9OyB6HoB3jH8dG4wW2E0w9OH
 T06LZWlyB/Rk0VgSG7c/YWAx7kFTzx7XBTDK6RAr9wtecE5gGpyDpfFgdVOh6Z4JJdIg
 uMjK+CYMWNnW9tE4Bxd1DjLy1a4D3IDIgDVr777a7mBhMnyQujcWbCDR5nRymYUxfi/P
 gpMQ==
X-Received: by 10.15.42.72 with SMTP id t48mr43466247eev.105.1373574983257;
 Thu, 11 Jul 2013 13:36:23 -0700 (PDT)
Received: from localhost ([178.150.115.244])
 by mx.google.com with ESMTPSA id n45sm72155822eew.1.2013.07.11.13.36.21
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Thu, 11 Jul 2013 13:36:22 -0700 (PDT)
Sender: Mikolaj Golub 
Date: Thu, 11 Jul 2013 23:36:19 +0300
From: Mikolaj Golub 
To: Andre Oppermann 
Subject: Re: svn commit: r253210 - in head/sys: conf netinet
Message-ID: <20130711203617.GA7506@gmail.com>
References: <201307111529.r6BFTPSf016809@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201307111529.r6BFTPSf016809@svn.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
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 20:36:25 -0000

Hi, Andre

On Thu, Jul 11, 2013 at 03:29:25PM +0000, Andre Oppermann wrote:
> Author: andre
> Date: Thu Jul 11 15:29:25 2013
> New Revision: 253210
> URL: http://svnweb.freebsd.org/changeset/base/253210
> 
> Log:
>   Improve SYN cookies by encoding the MSS, WSCALE (window scaling) and SACK
>   information into the ISN (initial sequence number) without the additional
>   use of timestamp bits and switching to the very fast and cryptographically
>   strong SipHash-2-4 MAC hash algorithm to protect the SYN cookie against
>   forgeries.

It fails to build with VIMAGE:

cc  -c -O2 -pipe -fno-strict-aliasing  -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality  -nostdinc  -I. -I/home/golub/freebsd/base/head/sys -I/home/golub/freebsd/base/head/sys/contrib/altq -I/home/golub/freebsd/base/head/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror  /home/golub/freebsd/base/head/sys/netinet/tcp_syncache.c
/home/golub/freebsd/base/head/sys/netinet/tcp_syncache.c:266:17: error: no member named 'vnet' in
      'struct tcp_syncache'
        V_tcp_syncache.vnet = curvnet;
        ~~~~~~~~~~~~~~ ^
/home/golub/freebsd/base/head/sys/netinet/tcp_syncache.c:438:27: error: no member named 'vnet' in
      'struct tcp_syncache'
        CURVNET_SET(sch->sch_sc->vnet);
                    ~~~~~~~~~~~  ^

> Modified: head/sys/netinet/tcp_syncache.h
> ==============================================================================
...
>  struct tcp_syncache {
> @@ -115,6 +118,19 @@ struct tcp_syncache {
>  	u_int	cache_limit;
>  	u_int	rexmt_limit;
>  	u_int	hash_secret;
> +	struct vnet *sch_vnet;

I think you meant here:

+	struct vnet *vnet;

-- 
Mikolaj Golub

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 20:53:40 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 2F52F52A;
 Thu, 11 Jul 2013 20:53:40 +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 C05A71480;
 Thu, 11 Jul 2013 20:53:39 +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 r6BKrXlE026127;
 Thu, 11 Jul 2013 14:53:33 -0600 (MDT)
 (envelope-from ken@nargothrond.kdm.org)
Received: (from ken@localhost)
 by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r6BKrWHN026126;
 Thu, 11 Jul 2013 14:53:32 -0600 (MDT) (envelope-from ken)
Date: Thu, 11 Jul 2013 14:53:32 -0600
From: "Kenneth D. Merry" 
To: Andre Albsmeier 
Subject: Re: svn commit: r252214 - in stable/9: bin/chio sys/cam/scsi sys/sys
Message-ID: <20130711205332.GA26100@nargothrond.kdm.org>
References: <201306252143.r5PLhoM0064338@svn.freebsd.org>
 <20130702055333.GA2729@bali> <20130703052236.GA65730@nargothrond.kdm.org>
 <20130703054349.GA13656@bali> <20130710184915.GA28790@nargothrond.kdm.org>
 <20130710185833.GA83135@bali>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20130710185833.GA83135@bali>
User-Agent: Mutt/1.4.2i
Cc: "src-committers@freebsd.org" ,
 "asomers@freebsd.org" ,
 "svn-src-stable@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "svn-src-stable-9@freebsd.org" ,
 "gibbs@freebsd.org" 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 20:53:40 -0000

On Wed, Jul 10, 2013 at 20:58:33 +0200, Andre Albsmeier wrote:
> On Wed, 10-Jul-2013 at 20:49:15 +0200, Kenneth D. Merry wrote:
> > On Wed, Jul 03, 2013 at 07:43:49 +0200, Andre Albsmeier wrote:
> > > On Wed, 03-Jul-2013 at 07:22:36 +0200, Kenneth D. Merry wrote:
> > > > On Tue, Jul 02, 2013 at 07:53:33 +0200, Andre Albsmeier wrote:
> > > > > On Tue, 25-Jun-2013 at 23:43:50 +0200, Kenneth D. Merry wrote:
> > > > > > Author: ken
> > > > > > Date: Tue Jun 25 21:43:49 2013
> > > > > > New Revision: 252214
> > > > > > URL: http://svnweb.freebsd.org/changeset/base/252214
> > > > > 
> > > > > Hi Ken,
> > > > > 
> > > > > > Log:
> > > > > >   MFC: 249658, 249701
> > > > > > 
> > > > > >   Update chio(1) and ch(4) to support reporting element designators.
> > > > > > 
> > > > > >   This allows mapping a tape drive in a changer (as reported by
> > > > > >   'chio status') to a sa(4) driver instance by comparing the
> > > > > >   serial numbers.
> > > > > > 
> > > > > >   The designators can be ASCII (which is printed out directly), binary
> > > > > >   (which is printed in hex format) or UTF-8, which is printed in either
> > > > > >   native UTF-8 format if the terminal can support it, or in %XX notation
> > > > > >   for non-ASCII characters.  Thanks to Hiroki Sato  for the
> > > > > >   explanation and example UTF-8 printing code.
> > > > > > 
> > > > > >   chio.h:               Modify the changer_element_status structure to add new
> > > > > >                 fields and definitions from the SMC3r16 spec.
> > > > > > 
> > > > > >                 Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and
> > > > > >                 define a new CHIOGSTATUS ioctl.
> > > > > > 
> > > > > >                 Clean up some tab/space issues.
> > > > > > 
> > > > > >   chio.c:       For the 'status' subcommand, print the designator field
> > > > > >                 if it is supplied by a device.
> > > > > > 
> > > > > >   scsi_ch.h:    Add new flags for DVCID and CURDATA to the READ
> > > > > >                 ELEMENT STATUS command structure.
> > > > > > 
> > > > > >                 Add a read_element_status_device_id structure
> > > > > >                 for the data fields in the new standard. Add new
> > > > > >                 unions, dt_or_obsolete and voltage_devid, to hold
> > > > > >                 and address data from either SCSI-2 or newer devices.
> > > > > > 
> > > > > >   scsi_ch.c:    Implement support for fetching device IDs with READ
> > > > > >                 ELEMENT STATUS data.
> > > > > > 
> > > > > >                 Add new arguments to scsi_read_element_status() to
> > > > > >                 allow the user to request the DVCID and CURDATA bits.
> > > > > 
> > > > > This broke "chio status" when talking to my QUALSTAR TLS-8211 library:
> > > > > 
> > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): READ ELEMENT STATUS. CDB: b8 10 fd e8 00 01 03 00 04 00 00 00
> > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): CAM status: SCSI Status Error
> > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): SCSI status: Check Condition
> > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
> > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): Command byte 6 is invalid
> > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): Error 22, Unretryable error
> > > > > 
> > > > > scsi_cmd->flags (Byte 6) must be zero for this library so I had to use
> > > > > this workaround to make it work again until a better solution is available:
> > > > > 
> > > > > --- sys/cam/scsi/scsi_ch.c.ORI	2013-06-26 13:38:54.000000000 +0200
> > > > > +++ sys/cam/scsi/scsi_ch.c	2013-07-02 07:42:24.000000000 +0200
> > > > > @@ -1245,8 +1245,8 @@
> > > > >  				 /* tag_action */ MSG_SIMPLE_Q_TAG,
> > > > >  				 /* voltag */ want_voltags,
> > > > >  				 /* sea */ softc->sc_firsts[chet],
> > > > > -				 /* dvcid */ 1,
> > > > > -				 /* curdata */ 1,
> > > > > +				 /* dvcid */ 0,
> > > > > +				 /* curdata */ 0,
> > > > >  				 /* count */ 1,
> > > > >  				 /* data_ptr */ data,
> > > > >  				 /* dxfer_len */ 1024,
> > > > > @@ -1284,8 +1284,8 @@
> > > > >  				 /* voltag */ want_voltags,
> > > > >  				 /* sea */ softc->sc_firsts[chet]
> > > > >  				 + cesr->cesr_element_base,
> > > > > -				 /* dvcid */ 1,
> > > > > -				 /* curdata */ 1,
> > > > > +				 /* dvcid */ 0,
> > > > > +				 /* curdata */ 0,
> > > > >  				 /* count */ cesr->cesr_element_count,
> > > > >  				 /* data_ptr */ data,
> > > > >  				 /* dxfer_len */ size,
> > > > > 
> > > > > 	-Andre
> > > > 
> > > > Oops, sorry.
> > > > 
> > > > We need to check the SCSI version to see whether to set those bits, and
> > > > also fall back in case it doesn't work.
> > > > 
> > > > I am on vacation and have very spotty net access.  I can't do anything
> > > > about it until I get back next week.
> > > > 
> > > > Justin and Alan (CCed) can work on the fix, though.
> > > 
> > > Take your time, for me it's working right now
> > > with the above patch...
> > 
> > Okay, I'm back and can take a look at this.
> 
> Welcome back ;-)
> 
> > 
> > Can you send me:
> 
> Sure, I am happy to help.
> 
> > 
> > camcontrol inquiry ch0 -v
> 
> pass17:  Removable Changer SCSI-2 device 
> pass17: Serial Number 0021009613
> pass17: 3.300MB/s transfers
> 
> > camcontrol cmd ch0 -v -c "12 0 0 0 ff 0" -i 255 "s58 i2 i2 i2 i2 i2 i2 i2 i2"
> 
> 0 0 0 0 0 0 0 0 

Okay, that was helpful, thanks!

> > 
> > I want to see what SCSI version this changer reports.  The second command
> > will print out the SCSI version descriptors, if any, that the changer
> > reports.
> 
> In case you need more info just drop me a note.
> 
> Thanks for looking into this.

Can you try the attached patch, and see how it works for you?

It defaults to not setting those bits for changers that claim to be SCSI-2
or below.  And if a SCSI-3 or higher changer returns an Illegal Request
type error, it will retry with the bits cleared to see whether that works.

I also bumped the read element status timeout after some testing with a
Spectra T-380.

The patch is against head, but stable/9 shouldn't be much different.

Ken
-- 
Kenneth Merry
ken@FreeBSD.ORG

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 21:33:05 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 3B5B9D51;
 Thu, 11 Jul 2013 21:33:05 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 2BE3C1728;
 Thu, 11 Jul 2013 21:33:05 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BLX5xC029462;
 Thu, 11 Jul 2013 21:33:05 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BLX3DC029448;
 Thu, 11 Jul 2013 21:33:03 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201307112133.r6BLX3DC029448@svn.freebsd.org>
From: Dimitry Andric 
Date: Thu, 11 Jul 2013 21:33:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253222 - in stable/9/contrib: libc++/include libc++/src
 libcxxrt
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 21:33:05 -0000

Author: dim
Date: Thu Jul 11 21:33:03 2013
New Revision: 253222
URL: http://svnweb.freebsd.org/changeset/base/253222

Log:
  MFC r253159 (by theraven):
  
  Import new libcxxrt / libc++.  This brings some bug fixes, including a
  potential race condition for static initialisers.

Modified:
  stable/9/contrib/libc++/include/__bit_reference
  stable/9/contrib/libc++/include/__config
  stable/9/contrib/libc++/include/__functional_base
  stable/9/contrib/libc++/include/__hash_table
  stable/9/contrib/libc++/include/__locale
  stable/9/contrib/libc++/include/__split_buffer
  stable/9/contrib/libc++/include/__std_stream
  stable/9/contrib/libc++/include/__tree
  stable/9/contrib/libc++/include/algorithm
  stable/9/contrib/libc++/include/atomic
  stable/9/contrib/libc++/include/deque
  stable/9/contrib/libc++/include/forward_list
  stable/9/contrib/libc++/include/functional
  stable/9/contrib/libc++/include/future
  stable/9/contrib/libc++/include/istream
  stable/9/contrib/libc++/include/iterator
  stable/9/contrib/libc++/include/list
  stable/9/contrib/libc++/include/locale
  stable/9/contrib/libc++/include/map
  stable/9/contrib/libc++/include/memory
  stable/9/contrib/libc++/include/random
  stable/9/contrib/libc++/include/regex
  stable/9/contrib/libc++/include/string
  stable/9/contrib/libc++/include/type_traits
  stable/9/contrib/libc++/include/unordered_map
  stable/9/contrib/libc++/include/utility
  stable/9/contrib/libc++/include/vector
  stable/9/contrib/libc++/src/debug.cpp
  stable/9/contrib/libc++/src/hash.cpp
  stable/9/contrib/libc++/src/iostream.cpp
  stable/9/contrib/libc++/src/locale.cpp
  stable/9/contrib/libc++/src/stdexcept.cpp
  stable/9/contrib/libc++/src/string.cpp
  stable/9/contrib/libc++/src/thread.cpp
  stable/9/contrib/libcxxrt/atomic.h
  stable/9/contrib/libcxxrt/auxhelper.cc
  stable/9/contrib/libcxxrt/cxxabi.h
  stable/9/contrib/libcxxrt/dwarf_eh.h
  stable/9/contrib/libcxxrt/exception.cc
  stable/9/contrib/libcxxrt/guard.cc
  stable/9/contrib/libcxxrt/memory.cc
Directory Properties:
  stable/9/contrib/libc++/   (props changed)
  stable/9/contrib/libcxxrt/   (props changed)

Modified: stable/9/contrib/libc++/include/__bit_reference
==============================================================================
--- stable/9/contrib/libc++/include/__bit_reference	Thu Jul 11 20:33:57 2013	(r253221)
+++ stable/9/contrib/libc++/include/__bit_reference	Thu Jul 11 21:33:03 2013	(r253222)
@@ -333,7 +333,7 @@ __fill_n_false(__bit_iterator<_Cp, false
     }
     // do middle whole words
     __storage_type __nw = __n / __bits_per_word;
-    _VSTD::memset(__first.__seg_, 0, __nw * sizeof(__storage_type));
+    _VSTD::memset(_VSTD::__to_raw_pointer(__first.__seg_), 0, __nw * sizeof(__storage_type));
     __n -= __nw * __bits_per_word;
     // do last partial word
     if (__n > 0)
@@ -363,7 +363,7 @@ __fill_n_true(__bit_iterator<_Cp, false>
     }
     // do middle whole words
     __storage_type __nw = __n / __bits_per_word;
-    _VSTD::memset(__first.__seg_, -1, __nw * sizeof(__storage_type));
+    _VSTD::memset(_VSTD::__to_raw_pointer(__first.__seg_), -1, __nw * sizeof(__storage_type));
     __n -= __nw * __bits_per_word;
     // do last partial word
     if (__n > 0)
@@ -430,7 +430,9 @@ __copy_aligned(__bit_iterator<_Cp, _IsCo
         // __first.__ctz_ == 0;
         // do middle words
         __storage_type __nw = __n / __bits_per_word;
-        _VSTD::memmove(__result.__seg_, __first.__seg_, __nw * sizeof(__storage_type));
+        _VSTD::memmove(_VSTD::__to_raw_pointer(__result.__seg_),
+                       _VSTD::__to_raw_pointer(__first.__seg_),
+                       __nw * sizeof(__storage_type));
         __n -= __nw * __bits_per_word;
         __result.__seg_ += __nw;
         // do last word
@@ -569,7 +571,9 @@ __copy_backward_aligned(__bit_iterator<_
         __storage_type __nw = __n / __bits_per_word;
         __result.__seg_ -= __nw;
         __last.__seg_ -= __nw;
-        _VSTD::memmove(__result.__seg_, __last.__seg_, __nw * sizeof(__storage_type));
+        _VSTD::memmove(_VSTD::__to_raw_pointer(__result.__seg_),
+                       _VSTD::__to_raw_pointer(__last.__seg_),
+                       __nw * sizeof(__storage_type));
         __n -= __nw * __bits_per_word;
         // do last word
         if (__n > 0)
@@ -870,6 +874,7 @@ struct __bit_array
 {
     typedef typename _Cp::difference_type difference_type;
     typedef typename _Cp::__storage_type  __storage_type;
+    typedef typename _Cp::__storage_pointer __storage_pointer;
     typedef typename _Cp::iterator        iterator;
     static const unsigned __bits_per_word = _Cp::__bits_per_word;
     static const unsigned _Np = 4;
@@ -880,9 +885,15 @@ struct __bit_array
     _LIBCPP_INLINE_VISIBILITY static difference_type capacity()
         {return static_cast(_Np * __bits_per_word);}
     _LIBCPP_INLINE_VISIBILITY explicit __bit_array(difference_type __s) : __size_(__s) {}
-    _LIBCPP_INLINE_VISIBILITY iterator begin() {return iterator(__word_, 0);}
-    _LIBCPP_INLINE_VISIBILITY iterator end()   {return iterator(__word_ + __size_ / __bits_per_word,
-                                                  static_cast(__size_ % __bits_per_word));}
+    _LIBCPP_INLINE_VISIBILITY iterator begin()
+    {
+        return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]), 0);
+    }
+    _LIBCPP_INLINE_VISIBILITY iterator end()
+    {
+        return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]) + __size_ / __bits_per_word,
+                                                  static_cast(__size_ % __bits_per_word));
+    }
 };
 
 template 

Modified: stable/9/contrib/libc++/include/__config
==============================================================================
--- stable/9/contrib/libc++/include/__config	Thu Jul 11 20:33:57 2013	(r253221)
+++ stable/9/contrib/libc++/include/__config	Thu Jul 11 21:33:03 2013	(r253222)
@@ -56,6 +56,18 @@
 # endif  // __LONG_LONG_SUPPORTED
 #endif  // __FreeBSD__
 
+#ifdef __NetBSD__
+# include 
+#  if _BYTE_ORDER == _LITTLE_ENDIAN
+#   define _LIBCPP_LITTLE_ENDIAN 1
+#   define _LIBCPP_BIG_ENDIAN    0
+# else  // _BYTE_ORDER == _LITTLE_ENDIAN
+#   define _LIBCPP_LITTLE_ENDIAN 0
+#   define _LIBCPP_BIG_ENDIAN    1
+# endif  // _BYTE_ORDER == _LITTLE_ENDIAN
+# define _LIBCPP_HAS_QUICK_EXIT
+#endif  // __NetBSD__
+
 #ifdef _WIN32
 #  define _LIBCPP_LITTLE_ENDIAN 1
 #  define _LIBCPP_BIG_ENDIAN    0
@@ -135,6 +147,10 @@
 
 #endif // _WIN32
 
+#ifndef __has_attribute
+#define __has_attribute(__x) 0
+#endif
+
 #ifndef _LIBCPP_HIDDEN
 #define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
 #endif
@@ -212,7 +228,9 @@ typedef __char32_t char32_t;
 #  define _LIBCPP_NORETURN __attribute__ ((noreturn))
 #endif
 
+#if !(__has_feature(cxx_defaulted_functions))
 #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#endif  // !(__has_feature(cxx_defaulted_functions))
 
 #if !(__has_feature(cxx_deleted_functions))
 #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
@@ -272,10 +290,20 @@ typedef __char32_t char32_t;
 #define _LIBCPP_HAS_NO_CONSTEXPR
 #endif
 
-#if defined(__FreeBSD__) && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L)
+#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
+#if defined(__FreeBSD__)
+#define _LIBCPP_HAS_QUICK_EXIT
+#define _LIBCPP_HAS_C11_FEATURES
+#elif defined(__linux__)
+#include 
+#if __GLIBC_PREREQ(2, 15)
 #define _LIBCPP_HAS_QUICK_EXIT
+#endif
+#if __GLIBC_PREREQ(2, 17)
 #define _LIBCPP_HAS_C11_FEATURES
 #endif
+#endif
+#endif
 
 #if (__has_feature(cxx_noexcept))
 #  define _NOEXCEPT noexcept
@@ -418,8 +446,14 @@ template  struct __static_asse
 #define _LIBCPP_CONSTEXPR constexpr
 #endif
 
+#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
+#define _LIBCPP_DEFAULT {}
+#else
+#define _LIBCPP_DEFAULT = default;
+#endif
+
 #ifdef __GNUC__
-#define _NOALIAS __attribute__((malloc))
+#define _NOALIAS __attribute__((__malloc__))
 #else
 #define _NOALIAS
 #endif
@@ -451,7 +485,7 @@ template  struct __static_asse
 #define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
 #endif
 
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__)
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__) || defined(__NetBSD__)
 #define _LIBCPP_LOCALE__L_EXTENSIONS 1
 #endif
 #ifdef __FreeBSD__
@@ -476,6 +510,14 @@ template  struct __static_asse
 #   endif
 #endif
 
+#ifndef _LIBCPP_STD_VER
+#  if  __cplusplus <= 201103L
+#    define _LIBCPP_STD_VER 11
+#  else
+#    define _LIBCPP_STD_VER 13  // current year, or date of c++14 ratification
+#  endif
+#endif  // _LIBCPP_STD_VER
+
 #ifdef _LIBCPP_DEBUG2
 #   include <__debug>
 #else

Modified: stable/9/contrib/libc++/include/__functional_base
==============================================================================
--- stable/9/contrib/libc++/include/__functional_base	Thu Jul 11 20:33:57 2013	(r253221)
+++ stable/9/contrib/libc++/include/__functional_base	Thu Jul 11 21:33:03 2013	(r253222)
@@ -292,7 +292,8 @@ struct __weak_result_type<_Rp (_Cp::*)(_
 
 // bullets 1 and 2
 
-template 
+template 
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
@@ -301,7 +302,8 @@ __invoke(_Fp&& __f, _A0&& __a0, _Args&& 
     return (_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...);
 }
 
-template 
+template 
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
@@ -312,7 +314,8 @@ __invoke(_Fp&& __f, _A0&& __a0, _Args&& 
 
 // bullets 3 and 4
 
-template 
+template 
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_Fp&& __f, _A0&& __a0)
@@ -321,7 +324,8 @@ __invoke(_Fp&& __f, _A0&& __a0)
     return _VSTD::forward<_A0>(__a0).*__f;
 }
 
-template 
+template 
 inline _LIBCPP_INLINE_VISIBILITY
 auto
 __invoke(_Fp&& __f, _A0&& __a0)

Modified: stable/9/contrib/libc++/include/__hash_table
==============================================================================
--- stable/9/contrib/libc++/include/__hash_table	Thu Jul 11 20:33:57 2013	(r253221)
+++ stable/9/contrib/libc++/include/__hash_table	Thu Jul 11 21:33:03 2013	(r253222)
@@ -33,7 +33,6 @@ template 
 struct __hash_node_base
 {
     typedef __hash_node_base __first_node;
- //   typedef _NodePtr pointer;
 
     _NodePtr    __next_;
 
@@ -111,7 +110,7 @@ public:
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return _VSTD::addressof(__node_->__value_);}
+        pointer operator->() const {return pointer_traits::pointer_to(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_iterator& operator++()
@@ -189,7 +188,7 @@ public:
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return _VSTD::addressof(__node_->__value_);}
+        pointer operator->() const {return pointer_traits::pointer_to(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_const_iterator& operator++()
@@ -255,7 +254,7 @@ public:
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return &__node_->__value_;}
+        pointer operator->() const {return pointer_traits::pointer_to(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_local_iterator& operator++()
@@ -345,7 +344,7 @@ public:
     _LIBCPP_INLINE_VISIBILITY
         reference operator*() const {return __node_->__value_;}
     _LIBCPP_INLINE_VISIBILITY
-        pointer operator->() const {return &__node_->__value_;}
+        pointer operator->() const {return pointer_traits::pointer_to(__node_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __hash_const_local_iterator& operator++()
@@ -505,8 +504,15 @@ public:
                                                      __node_allocator;
     typedef allocator_traits<__node_allocator>       __node_traits;
     typedef typename __node_traits::pointer          __node_pointer;
-    typedef typename __node_traits::const_pointer    __node_const_pointer;
+    typedef typename __node_traits::pointer          __node_const_pointer;
     typedef __hash_node_base<__node_pointer>         __first_node;
+    typedef typename pointer_traits<__node_pointer>::template
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+            rebind<__first_node>
+#else
+            rebind<__first_node>::other
+#endif
+                                                     __node_base_pointer;
 
 private:
 
@@ -558,9 +564,9 @@ public:
 
 public:
     typedef __hash_iterator<__node_pointer>                   iterator;
-    typedef __hash_const_iterator<__node_const_pointer>       const_iterator;
+    typedef __hash_const_iterator<__node_pointer>             const_iterator;
     typedef __hash_local_iterator<__node_pointer>             local_iterator;
-    typedef __hash_const_local_iterator<__node_const_pointer> const_local_iterator;
+    typedef __hash_const_local_iterator<__node_pointer>       const_local_iterator;
 
     __hash_table()
         _NOEXCEPT_(
@@ -706,7 +712,7 @@ public:
 
     _LIBCPP_INLINE_VISIBILITY
     size_type max_bucket_count() const _NOEXCEPT
-        {return __bucket_list_.get_deleter().__alloc().max_size();}
+        {return __pointer_alloc_traits::max_size(__bucket_list_.get_deleter().__alloc());}
     size_type bucket_size(size_type __n) const;
     _LIBCPP_INLINE_VISIBILITY float load_factor() const _NOEXCEPT
     {
@@ -807,6 +813,9 @@ private:
 
     void __deallocate(__node_pointer __np) _NOEXCEPT;
     __node_pointer __detach() _NOEXCEPT;
+
+    template  friend class _LIBCPP_TYPE_VIS unordered_map;
+    template  friend class _LIBCPP_TYPE_VIS unordered_multimap;
 };
 
 template 
@@ -893,7 +902,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     if (size() > 0)
     {
         __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
-            static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
         __u.__p1_.first().__next_ = nullptr;
         __u.size() = 0;
     }
@@ -917,7 +926,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
             __p1_.first().__next_ = __u.__p1_.first().__next_;
             __u.__p1_.first().__next_ = nullptr;
             __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
-                static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+                static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
             size() = __u.size();
             __u.size() = 0;
         }
@@ -1014,7 +1023,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     if (size() > 0)
     {
         __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
-            static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
         __u.__p1_.first().__next_ = nullptr;
         __u.size() = 0;
     }
@@ -1236,7 +1245,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
         __node_pointer __pn = __bucket_list_[__chash];
         if (__pn == nullptr)
         {
-            __pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
             __nd->__next_ = __pn->__next_;
             __pn->__next_ = __nd;
             // fix up __bucket_list_
@@ -1274,7 +1283,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     __node_pointer __pn = __bucket_list_[__chash];
     if (__pn == nullptr)
     {
-        __pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+        __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
         __cp->__next_ = __pn->__next_;
         __pn->__next_ = __cp;
         // fix up __bucket_list_
@@ -1322,7 +1331,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
 {
     if (__p != end() && key_eq()(*__p, __cp->__value_))
     {
-        __node_pointer __np = const_cast<__node_pointer>(__p.__node_);
+        __node_pointer __np = __p.__node_;
         __cp->__hash_ = __np->__hash_;
         size_type __bc = bucket_count();
         if (size()+1 > __bc * max_load_factor() || __bc == 0)
@@ -1380,7 +1389,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
         __node_pointer __pn = __bucket_list_[__chash];
         if (__pn == nullptr)
         {
-            __pn = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
             __h->__next_ = __pn->__next_;
             __pn->__next_ = __h.get();
             // fix up __bucket_list_
@@ -1542,7 +1551,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     {
         for (size_type __i = 0; __i < __nbc; ++__i)
             __bucket_list_[__i] = nullptr;
-        __node_pointer __pp(static_cast<__node_pointer>(_VSTD::addressof(__p1_.first())));
+        __node_pointer __pp(static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first())));
         __node_pointer __cp = __pp->__next_;
         if (__cp != nullptr)
         {
@@ -1700,7 +1709,7 @@ template ::iterator
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p)
 {
-    __node_pointer __np = const_cast<__node_pointer>(__p.__node_);
+    __node_pointer __np = __p.__node_;
     iterator __r(__np);
     ++__r;
     remove(__p);
@@ -1717,7 +1726,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
         ++__first;
         erase(__p);
     }
-    __node_pointer __np = const_cast<__node_pointer>(__last.__node_);
+    __node_pointer __np = __last.__node_;
     return iterator (__np);
 }
 
@@ -1757,7 +1766,7 @@ typename __hash_table<_Tp, _Hash, _Equal
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
 {
     // current node
-    __node_pointer __cn = const_cast<__node_pointer>(__p.__node_);
+    __node_pointer __cn = __p.__node_;
     size_type __bc = bucket_count();
     size_t __chash = __constrain_hash(__cn->__hash_, __bc);
     // find previous node
@@ -1767,7 +1776,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     // Fix up __bucket_list_
         // if __pn is not in same bucket (before begin is not in same bucket) &&
         //    if __cn->__next_ is not in same bucket (nullptr is not in same bucket)
-    if (__pn == _VSTD::addressof(__p1_.first()) || __constrain_hash(__pn->__hash_, __bc) != __chash)
+    if (__pn == static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()))
+                            || __constrain_hash(__pn->__hash_, __bc) != __chash)
     {
         if (__cn->__next_ == nullptr || __constrain_hash(__cn->__next_->__hash_, __bc) != __chash)
             __bucket_list_[__chash] = nullptr;
@@ -1907,10 +1917,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
     __p3_.swap(__u.__p3_);
     if (size() > 0)
         __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
-            static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
+            static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
     if (__u.size() > 0)
         __u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash_, __u.bucket_count())] =
-            static_cast<__node_pointer>(_VSTD::addressof(__u.__p1_.first()));
+            static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__u.__p1_.first()));
 }
 
 template 

Modified: stable/9/contrib/libc++/include/__locale
==============================================================================
--- stable/9/contrib/libc++/include/__locale	Thu Jul 11 20:33:57 2013	(r253221)
+++ stable/9/contrib/libc++/include/__locale	Thu Jul 11 21:33:03 2013	(r253222)
@@ -339,12 +339,12 @@ public:
     static const mask punct  = _PUNCT;
     static const mask xdigit = _HEX;
     static const mask blank  = _BLANK;
-#elif (defined(__APPLE__) || defined(__FreeBSD__)) || defined(EMSCRIPTEN)
+#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(EMSCRIPTEN) || defined(__NetBSD__)
 #ifdef __APPLE__
     typedef __uint32_t mask;
 #elif defined(__FreeBSD__)
     typedef unsigned long mask;
-#elif defined(EMSCRIPTEN)
+#elif defined(EMSCRIPTEN) ||  defined(__NetBSD__)
     typedef unsigned short mask;
 #endif
     static const mask space  = _CTYPE_S;
@@ -356,7 +356,11 @@ public:
     static const mask digit  = _CTYPE_D;
     static const mask punct  = _CTYPE_P;
     static const mask xdigit = _CTYPE_X;
+# if defined(__NetBSD__)
+    static const mask blank  = _CTYPE_BL;
+# else
     static const mask blank  = _CTYPE_B;
+# endif
 #elif defined(__sun__)
     typedef unsigned int mask;
     static const mask space  = _ISSPACE;
@@ -596,6 +600,10 @@ public:
     static const int* __classic_upper_table() _NOEXCEPT;
     static const int* __classic_lower_table() _NOEXCEPT;
 #endif
+#if defined(__NetBSD__)
+    static const short* __classic_upper_table() _NOEXCEPT;
+    static const short* __classic_lower_table() _NOEXCEPT;
+#endif
 
 protected:
     ~ctype();

Modified: stable/9/contrib/libc++/include/__split_buffer
==============================================================================
--- stable/9/contrib/libc++/include/__split_buffer	Thu Jul 11 20:33:57 2013	(r253221)
+++ stable/9/contrib/libc++/include/__split_buffer	Thu Jul 11 21:33:03 2013	(r253222)
@@ -290,7 +290,7 @@ void
 __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type)
 {
     while (__begin_ != __new_begin)
-        __alloc_traits::destroy(__alloc(), __begin_++);
+        __alloc_traits::destroy(__alloc(), __to_raw_pointer(__begin_++));
 }
 
 template 
@@ -307,7 +307,7 @@ void
 __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT
 {
     while (__new_last != __end_)
-        __alloc_traits::destroy(__alloc(), --__end_);
+        __alloc_traits::destroy(__alloc(), __to_raw_pointer(--__end_));
 }
 
 template 
@@ -320,7 +320,7 @@ __split_buffer<_Tp, _Allocator>::__destr
 
 template 
 __split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a)
-    : __end_cap_(0, __a)
+    : __end_cap_(nullptr, __a)
 {
     __first_ = __cap != 0 ? __alloc_traits::allocate(__alloc(), __cap) : nullptr;
     __begin_ = __end_ = __first_ + __start;
@@ -331,21 +331,21 @@ template 
 _LIBCPP_INLINE_VISIBILITY inline
 __split_buffer<_Tp, _Allocator>::__split_buffer()
     _NOEXCEPT_(is_nothrow_default_constructible::value)
-    : __first_(0), __begin_(0), __end_(0), __end_cap_(0)
+    : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr)
 {
 }
 
 template 
 _LIBCPP_INLINE_VISIBILITY inline
 __split_buffer<_Tp, _Allocator>::__split_buffer(__alloc_rr& __a)
-    : __first_(0), __begin_(0), __end_(0), __end_cap_(0, __a)
+    : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
 {
 }
 
 template 
 _LIBCPP_INLINE_VISIBILITY inline
 __split_buffer<_Tp, _Allocator>::__split_buffer(const __alloc_rr& __a)
-    : __first_(0), __begin_(0), __end_(0), __end_cap_(0, __a)
+    : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
 {
 }
 

Modified: stable/9/contrib/libc++/include/__std_stream
==============================================================================
--- stable/9/contrib/libc++/include/__std_stream	Thu Jul 11 20:33:57 2013	(r253221)
+++ stable/9/contrib/libc++/include/__std_stream	Thu Jul 11 21:33:03 2013	(r253222)
@@ -55,6 +55,8 @@ private:
     const codecvt* __cv_;
     state_type* __st_;
     int __encoding_;
+    int_type __last_consumed_;
+    bool __last_consumed_is_next_;
     bool __always_noconv_;
 
     __stdinbuf(const __stdinbuf&);
@@ -66,7 +68,9 @@ private:
 template 
 __stdinbuf<_CharT>::__stdinbuf(FILE* __fp, state_type* __st)
     : __file_(__fp),
-      __st_(__st)
+      __st_(__st),
+      __last_consumed_(traits_type::eof()),
+      __last_consumed_is_next_(false)
 {
     imbue(this->getloc());
 }
@@ -100,6 +104,16 @@ template 
 typename __stdinbuf<_CharT>::int_type
 __stdinbuf<_CharT>::__getchar(bool __consume)
 {
+    if (__last_consumed_is_next_)
+    {
+        int_type __result = __last_consumed_;
+        if (__consume)
+        {
+            __last_consumed_ = traits_type::eof();
+            __last_consumed_is_next_ = false;
+        }
+        return __result;
+    }
     char __extbuf[__limit];
     int __nread = _VSTD::max(1, __encoding_);
     for (int __i = 0; __i < __nread; ++__i)
@@ -154,6 +168,8 @@ __stdinbuf<_CharT>::__getchar(bool __con
                 return traits_type::eof();
         }
     }
+    else
+        __last_consumed_ = traits_type::to_int_type(__1buf);
     return traits_type::to_int_type(__1buf);
 }
 
@@ -162,28 +178,41 @@ typename __stdinbuf<_CharT>::int_type
 __stdinbuf<_CharT>::pbackfail(int_type __c)
 {
     if (traits_type::eq_int_type(__c, traits_type::eof()))
-        return __c;
-    char __extbuf[__limit];
-    char* __enxt;
-    const char_type __ci = traits_type::to_char_type(__c);
-    const char_type* __inxt;
-    switch (__cv_->out(*__st_, &__ci, &__ci + 1, __inxt,
-                              __extbuf, __extbuf + sizeof(__extbuf), __enxt))
     {
-    case _VSTD::codecvt_base::ok:
-        break;
-    case _VSTD::codecvt_base::noconv:
-        __extbuf[0] = static_cast(__c);
-        __enxt = __extbuf + 1;
-        break;
-    case codecvt_base::partial:
-    case codecvt_base::error:
-        return traits_type::eof();
+        if (!__last_consumed_is_next_)
+        {
+            __c = __last_consumed_;
+            __last_consumed_is_next_ = !traits_type::eq_int_type(__last_consumed_,
+                                                                 traits_type::eof());
+        }
+        return __c;
     }
-    while (__enxt > __extbuf)
-        if (ungetc(*--__enxt, __file_) == EOF)
+    if (__last_consumed_is_next_)
+    {
+        char __extbuf[__limit];
+        char* __enxt;
+        const char_type __ci = traits_type::to_char_type(__last_consumed_);
+        const char_type* __inxt;
+        switch (__cv_->out(*__st_, &__ci, &__ci + 1, __inxt,
+                                  __extbuf, __extbuf + sizeof(__extbuf), __enxt))
+        {
+        case _VSTD::codecvt_base::ok:
+            break;
+        case _VSTD::codecvt_base::noconv:
+            __extbuf[0] = static_cast(__last_consumed_);
+            __enxt = __extbuf + 1;
+            break;
+        case codecvt_base::partial:
+        case codecvt_base::error:
             return traits_type::eof();
- return traits_type::not_eof(__c);
+        }
+        while (__enxt > __extbuf)
+            if (ungetc(*--__enxt, __file_) == EOF)
+                return traits_type::eof();
+    }
+    __last_consumed_ = __c;
+    __last_consumed_is_next_ = true;
+    return __c;
 }
 
 // __stdoutbuf
@@ -234,30 +263,31 @@ __stdoutbuf<_CharT>::overflow(int_type _
     char_type __1buf;
     if (!traits_type::eq_int_type(__c, traits_type::eof()))
     {
-        this->setp(&__1buf, &__1buf+1);
-        *this->pptr() = traits_type::to_char_type(__c);
-        this->pbump(1);
+        __1buf = traits_type::to_char_type(__c);
         if (__always_noconv_)
         {
-            if (fwrite(this->pbase(), sizeof(char_type), 1, __file_) != 1)
+            if (fwrite(&__1buf, sizeof(char_type), 1, __file_) != 1)
                 return traits_type::eof();
         }
         else
         {
             char* __extbe = __extbuf;
             codecvt_base::result __r;
+            char_type* pbase = &__1buf;
+            char_type* pptr = pbase + 1;
+            char_type* epptr = pptr;
             do
             {
                 const char_type* __e;
-                __r = __cv_->out(*__st_, this->pbase(), this->pptr(), __e,
+                __r = __cv_->out(*__st_, pbase, pptr, __e,
                                         __extbuf,
                                         __extbuf + sizeof(__extbuf),
                                         __extbe);
-                if (__e == this->pbase())
+                if (__e == pbase)
                     return traits_type::eof();
                 if (__r == codecvt_base::noconv)
                 {
-                    if (fwrite(this->pbase(), 1, 1, __file_) != 1)
+                    if (fwrite(pbase, 1, 1, __file_) != 1)
                         return traits_type::eof();
                 }
                 else if (__r == codecvt_base::ok || __r == codecvt_base::partial)
@@ -267,15 +297,13 @@ __stdoutbuf<_CharT>::overflow(int_type _
                         return traits_type::eof();
                     if (__r == codecvt_base::partial)
                     {
-                        this->setp((char_type*)__e, this->pptr());
-                        this->pbump(static_cast(this->epptr() - this->pbase()));
+                        pbase = (char_type*)__e;
                     }
                 }
                 else
                     return traits_type::eof();
             } while (__r == codecvt_base::partial);
         }
-        this->setp(0, 0);
     }
     return traits_type::not_eof(__c);
 }

Modified: stable/9/contrib/libc++/include/__tree
==============================================================================
--- stable/9/contrib/libc++/include/__tree	Thu Jul 11 20:33:57 2013	(r253221)
+++ stable/9/contrib/libc++/include/__tree	Thu Jul 11 21:33:03 2013	(r253222)
@@ -644,7 +644,8 @@ public:
     _LIBCPP_INLINE_VISIBILITY __tree_iterator() _NOEXCEPT {}
 
     _LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;}
-    _LIBCPP_INLINE_VISIBILITY pointer operator->() const {return &__ptr_->__value_;}
+    _LIBCPP_INLINE_VISIBILITY pointer operator->() const
+        {return pointer_traits::pointer_to(__ptr_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __tree_iterator& operator++()
@@ -686,7 +687,7 @@ class _LIBCPP_TYPE_VIS __tree_const_iter
 {
     typedef _ConstNodePtr                                         __node_pointer;
     typedef typename pointer_traits<__node_pointer>::element_type __node;
-    typedef const typename __node::base                           __node_base;
+    typedef typename __node::base                                 __node_base;
     typedef typename pointer_traits<__node_pointer>::template
 #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
             rebind<__node_base>
@@ -729,7 +730,8 @@ public:
         : __ptr_(__p.__ptr_) {}
 
     _LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;}
-    _LIBCPP_INLINE_VISIBILITY pointer operator->() const {return &__ptr_->__value_;}
+    _LIBCPP_INLINE_VISIBILITY pointer operator->() const
+        {return pointer_traits::pointer_to(__ptr_->__value_);}
 
     _LIBCPP_INLINE_VISIBILITY
     __tree_const_iterator& operator++()
@@ -779,8 +781,10 @@ public:
     typedef typename __alloc_traits::size_type       size_type;
     typedef typename __alloc_traits::difference_type difference_type;
 
-    typedef __tree_node __node;
-    typedef __tree_node_base __node_base;
+    typedef typename __alloc_traits::void_pointer  __void_pointer;
+
+    typedef __tree_node __node;
+    typedef __tree_node_base<__void_pointer>        __node_base;
     typedef typename __alloc_traits::template
 #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
             rebind_alloc<__node>
@@ -790,9 +794,9 @@ public:
                                                      __node_allocator;
     typedef allocator_traits<__node_allocator>       __node_traits;
     typedef typename __node_traits::pointer          __node_pointer;
-    typedef typename __node_traits::const_pointer    __node_const_pointer;
+    typedef typename __node_traits::pointer          __node_const_pointer;
     typedef typename __node_base::pointer            __node_base_pointer;
-    typedef typename __node_base::const_pointer      __node_base_const_pointer;
+    typedef typename __node_base::pointer            __node_base_const_pointer;
 private:
     typedef typename __node_base::base __end_node_t;
     typedef typename pointer_traits<__node_pointer>::template
@@ -804,9 +808,9 @@ private:
                                                      __end_node_ptr;
     typedef typename pointer_traits<__node_pointer>::template
 #ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
-            rebind
+            rebind<__end_node_t>
 #else
-            rebind::other
+            rebind<__end_node_t>::other
 #endif
                                                      __end_node_const_ptr;
 
@@ -828,7 +832,7 @@ public:
     {
         return static_cast<__node_const_pointer>
                (
-                   pointer_traits<__end_node_const_ptr>::pointer_to(__pair1_.first())
+                   pointer_traits<__end_node_const_ptr>::pointer_to(const_cast<__end_node_t&>(__pair1_.first()))
                );
     }
     _LIBCPP_INLINE_VISIBILITY
@@ -865,7 +869,7 @@ public:
         {return static_cast<__node_const_pointer>(__end_node()->__left_);}
 
     typedef __tree_iterator             iterator;
-    typedef __tree_const_iterator const_iterator;
+    typedef __tree_const_iterator const_iterator;
 
     explicit __tree(const value_compare& __comp)
         _NOEXCEPT_(
@@ -1102,6 +1106,9 @@ private:
 
     __node_pointer __detach();
     static __node_pointer __detach(__node_pointer);
+
+    template  friend class _LIBCPP_TYPE_VIS map;
+    template  friend class _LIBCPP_TYPE_VIS multimap;
 };
 
 template 
@@ -1161,7 +1168,7 @@ __tree<_Tp, _Compare, _Allocator>::__det
 {
     if (__cache->__parent_ == nullptr)
         return nullptr;
-    if (__tree_is_left_child(__cache))
+    if (__tree_is_left_child(static_cast<__node_base_pointer>(__cache)))
     {
         __cache->__parent_->__left_ = nullptr;
         __cache = static_cast<__node_pointer>(__cache->__parent_);
@@ -1294,7 +1301,7 @@ __tree<_Tp, _Compare, _Allocator>::__tre
         __begin_node() = __end_node();
     else
     {
-        __end_node()->__left_->__parent_ = __end_node();
+        __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
         __t.__begin_node() = __t.__end_node();
         __t.__end_node()->__left_ = nullptr;
         __t.size() = 0;
@@ -1314,7 +1321,7 @@ __tree<_Tp, _Compare, _Allocator>::__tre
         {
             __begin_node() = __t.__begin_node();
             __end_node()->__left_ = __t.__end_node()->__left_;
-            __end_node()->__left_->__parent_ = __end_node();
+            __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
             size() = __t.size();
             __t.__begin_node() = __t.__end_node();
             __t.__end_node()->__left_ = nullptr;
@@ -1342,7 +1349,7 @@ __tree<_Tp, _Compare, _Allocator>::__mov
         __begin_node() = __end_node();
     else
     {
-        __end_node()->__left_->__parent_ = __end_node();
+        __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
         __t.__begin_node() = __t.__end_node();
         __t.__end_node()->__left_ = nullptr;
         __t.size() = 0;
@@ -1447,11 +1454,11 @@ __tree<_Tp, _Compare, _Allocator>::swap(
     if (size() == 0)
         __begin_node() = __end_node();
     else
-        __end_node()->__left_->__parent_ = __end_node();
+        __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
     if (__t.size() == 0)
         __t.__begin_node() = __t.__end_node();
     else
-        __t.__end_node()->__left_->__parent_ = __t.__end_node();
+        __t.__end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__t.__end_node());
 }
 
 template 
@@ -1483,7 +1490,7 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__right_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__right_;
                 }
             }
@@ -1493,13 +1500,13 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__left_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__left_;
                 }
             }
         }
     }
-    __parent = __end_node();
+    __parent = static_cast<__node_base_pointer>(__end_node());
     return __parent->__left_;
 }
 
@@ -1522,7 +1529,7 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__left_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__left_;
                 }
             }
@@ -1532,13 +1539,13 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__right_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__right_;
                 }
             }
         }
     }
-    __parent = __end_node();
+    __parent = static_cast<__node_base_pointer>(__end_node());
     return __parent->__left_;
 }
 
@@ -1563,12 +1570,12 @@ __tree<_Tp, _Compare, _Allocator>::__fin
             // *prev(__hint) <= __v <= *__hint
             if (__hint.__ptr_->__left_ == nullptr)
             {
-                __parent = const_cast<__node_pointer&>(__hint.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
                 return __parent->__left_;
             }
             else
             {
-                __parent = const_cast<__node_pointer&>(__prior.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__prior.__ptr_);
                 return __parent->__right_;
             }
         }
@@ -1600,7 +1607,7 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__left_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__left_;
                 }
             }
@@ -1610,18 +1617,18 @@ __tree<_Tp, _Compare, _Allocator>::__fin
                     __nd = static_cast<__node_pointer>(__nd->__right_);
                 else
                 {
-                    __parent = __nd;
+                    __parent = static_cast<__node_base_pointer>(__nd);
                     return __parent->__right_;
                 }
             }
             else
             {
-                __parent = __nd;
+                __parent = static_cast<__node_base_pointer>(__nd);
                 return __parent;
             }
         }
     }
-    __parent = __end_node();
+    __parent = static_cast<__node_base_pointer>(__end_node());
     return __parent->__left_;
 }
 
@@ -1648,12 +1655,12 @@ __tree<_Tp, _Compare, _Allocator>::__fin
             // *prev(__hint) < __v < *__hint
             if (__hint.__ptr_->__left_ == nullptr)
             {
-                __parent = const_cast<__node_pointer&>(__hint.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
                 return __parent->__left_;
             }
             else
             {
-                __parent = const_cast<__node_pointer&>(__prior.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__prior.__ptr_);
                 return __parent->__right_;
             }
         }
@@ -1669,12 +1676,12 @@ __tree<_Tp, _Compare, _Allocator>::__fin
             // *__hint < __v < *_VSTD::next(__hint)
             if (__hint.__ptr_->__right_ == nullptr)
             {
-                __parent = const_cast<__node_pointer&>(__hint.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
                 return __parent->__right_;
             }
             else
             {
-                __parent = const_cast<__node_pointer&>(__next.__ptr_);
+                __parent = static_cast<__node_base_pointer>(__next.__ptr_);
                 return __parent->__left_;
             }
         }
@@ -1682,7 +1689,7 @@ __tree<_Tp, _Compare, _Allocator>::__fin
         return __find_equal(__parent, __v);
     }
     // else __v == *__hint
-    __parent = const_cast<__node_pointer&>(__hint.__ptr_);
+    __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
     return __parent;
 }
 
@@ -1729,7 +1736,7 @@ __tree<_Tp, _Compare, _Allocator>::__emp
     bool __inserted = false;
     if (__child == nullptr)
     {
-        __insert_node_at(__parent, __child, __h.get());
+        __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
         __r = __h.release();
         __inserted = true;
     }
@@ -1747,7 +1754,7 @@ __tree<_Tp, _Compare, _Allocator>::__emp
     __node_pointer __r = static_cast<__node_pointer>(__child);
     if (__child == nullptr)
     {
-        __insert_node_at(__parent, __child, __h.get());
+        __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
         __r = __h.release();
     }
     return iterator(__r);
@@ -1761,7 +1768,7 @@ __tree<_Tp, _Compare, _Allocator>::__emp
     __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
     __node_base_pointer __parent;
     __node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_);
-    __insert_node_at(__parent, __child, __h.get());
+    __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
     return iterator(static_cast<__node_pointer>(__h.release()));
 }
 
@@ -1774,7 +1781,7 @@ __tree<_Tp, _Compare, _Allocator>::__emp
     __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);

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

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 21:42:03 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id E953AFE9;
 Thu, 11 Jul 2013 21:42:03 +0000 (UTC)
 (envelope-from marcel@xcllnt.net)
Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214])
 by mx1.freebsd.org (Postfix) with ESMTP id AA4AD176F;
 Thu, 11 Jul 2013 21:42:03 +0000 (UTC)
Received: from amoroson-sslvpn-nc.jnpr.net (natint3.juniper.net
 [66.129.224.36]) (authenticated bits=0)
 by mail.xcllnt.net (8.14.7/8.14.7) with ESMTP id r6BLft2B066233
 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO);
 Thu, 11 Jul 2013 14:41:57 -0700 (PDT)
 (envelope-from marcel@xcllnt.net)
Content-Type: text/plain; charset=iso-8859-1
Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\))
Subject: Re: svn commit: r253161 - head/sys/dev/uart
From: Marcel Moolenaar 
In-Reply-To: <201307110941.34400.jhb@freebsd.org>
Date: Thu, 11 Jul 2013 14:41:50 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <84AC1620-BD44-4A55-B580-02F3D50C546B@xcllnt.net>
References: <201307101742.r6AHgKOm024113@svn.freebsd.org>
 <201307101409.42228.jhb@freebsd.org>
 
 <201307110941.34400.jhb@freebsd.org>
To: John Baldwin 
X-Mailer: Apple Mail (2.1508)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 Marcel Moolenaar , src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 21:42:04 -0000


On Jul 11, 2013, at 6:41 AM, John Baldwin  wrote:

> On Wednesday, July 10, 2013 3:59:40 pm Marcel Moolenaar wrote:
>>=20
>> On Jul 10, 2013, at 11:09 AM, John Baldwin  wrote:
>>=20
>>> On Wednesday, July 10, 2013 2:05:43 pm John Baldwin wrote:
>>>> On Wednesday, July 10, 2013 1:42:20 pm Marcel Moolenaar wrote:
>>>>> Author: marcel
>>>>> Date: Wed Jul 10 17:42:20 2013
>>>>> New Revision: 253161
>>>>> URL: http://svnweb.freebsd.org/changeset/base/253161
>>>>>=20
>>>>> Log:
>>>>> Protect against broken hardware. In this particular case, protect =
against
>>>>> H/W not de-asserting the interrupt at all. On x86, and because of =
the
>>>>> following conditions, this results in a hard hang with interrupts =
disabled:
>>>>> 1.  The uart(4) driver uses a spin lock to protect against =
concurrent
>>>>>     access to the H/W. Spin locks disable and restore interrupts.
>>>>> 2.  Restoring the interrupt on x86 always writes the flags =
register. Even
>>>>>     if we're restoring the interrupt from disabled to disabled.
>>>>> 3.  The x86 CPU has a short window in which interrupts are enabled =
when the
>>>>>     flags register is written.
>>>>=20
>>>> Do you have proof of this?
>>=20
>> No. I only have proof of a hard hang during auto configuration that
>> cannot be fixed in any other way than not to setup the interrupt at
>> all.
>=20
> Ok.  I think what is happening is that you are just spinning in the =
interrupt
> handler forever due to the hardware being stuck in that case in the =
old code.
> I assume you tried just using the count first but it still hung?  =
(Perhaps the
> interrupt was for a PCI device and level-triggered and so it kept =
reasserting
> anyway?)

Yes, the count alone didn't do the trick. It's really a H/W
problem. I suspect a floating line to an FPGA. The condition
is cleared by means that go beyond FreeBSD, let me put it
that way :-)

> I think your change is correct for a uart that is stuck in this way =
regardless,
> I just think the hang isn't related to weirdness with x86 temporarily
> re-enabling interrupts.

You're right. I looked at configure() this time and it
starts with enable_intr(). For some reason I had it in
my head that we auto-configure with interrupts disabled.
We do on most platforms, just not on x86...

--=20
Marcel Moolenaar
marcel@xcllnt.net



From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 22:02:13 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id E3A5F5E3;
 Thu, 11 Jul 2013 22:02:13 +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 7CF851861;
 Thu, 11 Jul 2013 22:02:13 +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 r6BM2C22030411;
 Thu, 11 Jul 2013 16:02:12 -0600 (MDT)
 (envelope-from ken@nargothrond.kdm.org)
Received: (from ken@localhost)
 by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r6BM2B7W030410;
 Thu, 11 Jul 2013 16:02:11 -0600 (MDT) (envelope-from ken)
Date: Thu, 11 Jul 2013 16:02:11 -0600
From: "Kenneth D. Merry" 
To: Andre Albsmeier 
Subject: Re: svn commit: r252214 - in stable/9: bin/chio sys/cam/scsi sys/sys
Message-ID: <20130711220211.GA30392@nargothrond.kdm.org>
References: <201306252143.r5PLhoM0064338@svn.freebsd.org>
 <20130702055333.GA2729@bali> <20130703052236.GA65730@nargothrond.kdm.org>
 <20130703054349.GA13656@bali> <20130710184915.GA28790@nargothrond.kdm.org>
 <20130710185833.GA83135@bali> <20130711205332.GA26100@nargothrond.kdm.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="9amGYk9869ThD9tj"
Content-Disposition: inline
In-Reply-To: <20130711205332.GA26100@nargothrond.kdm.org>
User-Agent: Mutt/1.4.2i
Cc: "src-committers@freebsd.org" ,
 "asomers@freebsd.org" ,
 "svn-src-stable@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "svn-src-stable-9@freebsd.org" ,
 "gibbs@freebsd.org" 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 22:02:14 -0000


--9amGYk9869ThD9tj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Jul 11, 2013 at 14:53:32 -0600, Kenneth D. Merry wrote:
> On Wed, Jul 10, 2013 at 20:58:33 +0200, Andre Albsmeier wrote:
> > On Wed, 10-Jul-2013 at 20:49:15 +0200, Kenneth D. Merry wrote:
> > > On Wed, Jul 03, 2013 at 07:43:49 +0200, Andre Albsmeier wrote:
> > > > On Wed, 03-Jul-2013 at 07:22:36 +0200, Kenneth D. Merry wrote:
> > > > > On Tue, Jul 02, 2013 at 07:53:33 +0200, Andre Albsmeier wrote:
> > > > > > On Tue, 25-Jun-2013 at 23:43:50 +0200, Kenneth D. Merry wrote:
> > > > > > > Author: ken
> > > > > > > Date: Tue Jun 25 21:43:49 2013
> > > > > > > New Revision: 252214
> > > > > > > URL: http://svnweb.freebsd.org/changeset/base/252214
> > > > > > 
> > > > > > Hi Ken,
> > > > > > 
> > > > > > > Log:
> > > > > > >   MFC: 249658, 249701
> > > > > > > 
> > > > > > >   Update chio(1) and ch(4) to support reporting element designators.
> > > > > > > 
> > > > > > >   This allows mapping a tape drive in a changer (as reported by
> > > > > > >   'chio status') to a sa(4) driver instance by comparing the
> > > > > > >   serial numbers.
> > > > > > > 
> > > > > > >   The designators can be ASCII (which is printed out directly), binary
> > > > > > >   (which is printed in hex format) or UTF-8, which is printed in either
> > > > > > >   native UTF-8 format if the terminal can support it, or in %XX notation
> > > > > > >   for non-ASCII characters.  Thanks to Hiroki Sato  for the
> > > > > > >   explanation and example UTF-8 printing code.
> > > > > > > 
> > > > > > >   chio.h:               Modify the changer_element_status structure to add new
> > > > > > >                 fields and definitions from the SMC3r16 spec.
> > > > > > > 
> > > > > > >                 Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and
> > > > > > >                 define a new CHIOGSTATUS ioctl.
> > > > > > > 
> > > > > > >                 Clean up some tab/space issues.
> > > > > > > 
> > > > > > >   chio.c:       For the 'status' subcommand, print the designator field
> > > > > > >                 if it is supplied by a device.
> > > > > > > 
> > > > > > >   scsi_ch.h:    Add new flags for DVCID and CURDATA to the READ
> > > > > > >                 ELEMENT STATUS command structure.
> > > > > > > 
> > > > > > >                 Add a read_element_status_device_id structure
> > > > > > >                 for the data fields in the new standard. Add new
> > > > > > >                 unions, dt_or_obsolete and voltage_devid, to hold
> > > > > > >                 and address data from either SCSI-2 or newer devices.
> > > > > > > 
> > > > > > >   scsi_ch.c:    Implement support for fetching device IDs with READ
> > > > > > >                 ELEMENT STATUS data.
> > > > > > > 
> > > > > > >                 Add new arguments to scsi_read_element_status() to
> > > > > > >                 allow the user to request the DVCID and CURDATA bits.
> > > > > > 
> > > > > > This broke "chio status" when talking to my QUALSTAR TLS-8211 library:
> > > > > > 
> > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): READ ELEMENT STATUS. CDB: b8 10 fd e8 00 01 03 00 04 00 00 00
> > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): CAM status: SCSI Status Error
> > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): SCSI status: Check Condition
> > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
> > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): Command byte 6 is invalid
> > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): Error 22, Unretryable error
> > > > > > 
> > > > > > scsi_cmd->flags (Byte 6) must be zero for this library so I had to use
> > > > > > this workaround to make it work again until a better solution is available:
> > > > > > 
> > > > > > --- sys/cam/scsi/scsi_ch.c.ORI	2013-06-26 13:38:54.000000000 +0200
> > > > > > +++ sys/cam/scsi/scsi_ch.c	2013-07-02 07:42:24.000000000 +0200
> > > > > > @@ -1245,8 +1245,8 @@
> > > > > >  				 /* tag_action */ MSG_SIMPLE_Q_TAG,
> > > > > >  				 /* voltag */ want_voltags,
> > > > > >  				 /* sea */ softc->sc_firsts[chet],
> > > > > > -				 /* dvcid */ 1,
> > > > > > -				 /* curdata */ 1,
> > > > > > +				 /* dvcid */ 0,
> > > > > > +				 /* curdata */ 0,
> > > > > >  				 /* count */ 1,
> > > > > >  				 /* data_ptr */ data,
> > > > > >  				 /* dxfer_len */ 1024,
> > > > > > @@ -1284,8 +1284,8 @@
> > > > > >  				 /* voltag */ want_voltags,
> > > > > >  				 /* sea */ softc->sc_firsts[chet]
> > > > > >  				 + cesr->cesr_element_base,
> > > > > > -				 /* dvcid */ 1,
> > > > > > -				 /* curdata */ 1,
> > > > > > +				 /* dvcid */ 0,
> > > > > > +				 /* curdata */ 0,
> > > > > >  				 /* count */ cesr->cesr_element_count,
> > > > > >  				 /* data_ptr */ data,
> > > > > >  				 /* dxfer_len */ size,
> > > > > > 
> > > > > > 	-Andre
> > > > > 
> > > > > Oops, sorry.
> > > > > 
> > > > > We need to check the SCSI version to see whether to set those bits, and
> > > > > also fall back in case it doesn't work.
> > > > > 
> > > > > I am on vacation and have very spotty net access.  I can't do anything
> > > > > about it until I get back next week.
> > > > > 
> > > > > Justin and Alan (CCed) can work on the fix, though.
> > > > 
> > > > Take your time, for me it's working right now
> > > > with the above patch...
> > > 
> > > Okay, I'm back and can take a look at this.
> > 
> > Welcome back ;-)
> > 
> > > 
> > > Can you send me:
> > 
> > Sure, I am happy to help.
> > 
> > > 
> > > camcontrol inquiry ch0 -v
> > 
> > pass17:  Removable Changer SCSI-2 device 
> > pass17: Serial Number 0021009613
> > pass17: 3.300MB/s transfers
> > 
> > > camcontrol cmd ch0 -v -c "12 0 0 0 ff 0" -i 255 "s58 i2 i2 i2 i2 i2 i2 i2 i2"
> > 
> > 0 0 0 0 0 0 0 0 
> 
> Okay, that was helpful, thanks!
> 
> > > 
> > > I want to see what SCSI version this changer reports.  The second command
> > > will print out the SCSI version descriptors, if any, that the changer
> > > reports.
> > 
> > In case you need more info just drop me a note.
> > 
> > Thanks for looking into this.
> 
> Can you try the attached patch, and see how it works for you?
> 
> It defaults to not setting those bits for changers that claim to be SCSI-2
> or below.  And if a SCSI-3 or higher changer returns an Illegal Request
> type error, it will retry with the bits cleared to see whether that works.
> 
> I also bumped the read element status timeout after some testing with a
> Spectra T-380.
> 
> The patch is against head, but stable/9 shouldn't be much different.

Oops, here is the patch.

Ken
-- 
Kenneth Merry
ken@FreeBSD.ORG

--9amGYk9869ThD9tj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="scsi_ch.c.read_element_status.20130711.txt"

==== //depot/users/kenm/FreeBSD-test4/sys/cam/scsi/scsi_ch.c#6 - /usr/home/kenm/perforce4/kenm/FreeBSD-test4/sys/cam/scsi/scsi_ch.c ====
*** /tmp/tmp.49464.18	Thu Jul 11 14:45:15 2013
--- /usr/home/kenm/perforce4/kenm/FreeBSD-test4/sys/cam/scsi/scsi_ch.c	Thu Jul 11 14:43:14 2013
***************
*** 102,108 ****
  static const u_int32_t	CH_TIMEOUT_MOVE_MEDIUM               = 100000;
  static const u_int32_t	CH_TIMEOUT_EXCHANGE_MEDIUM           = 100000;
  static const u_int32_t	CH_TIMEOUT_POSITION_TO_ELEMENT       = 100000;
! static const u_int32_t	CH_TIMEOUT_READ_ELEMENT_STATUS       = 10000;
  static const u_int32_t	CH_TIMEOUT_SEND_VOLTAG		     = 10000;
  static const u_int32_t	CH_TIMEOUT_INITIALIZE_ELEMENT_STATUS = 500000;
  
--- 102,108 ----
  static const u_int32_t	CH_TIMEOUT_MOVE_MEDIUM               = 100000;
  static const u_int32_t	CH_TIMEOUT_EXCHANGE_MEDIUM           = 100000;
  static const u_int32_t	CH_TIMEOUT_POSITION_TO_ELEMENT       = 100000;
! static const u_int32_t	CH_TIMEOUT_READ_ELEMENT_STATUS       = 60000;
  static const u_int32_t	CH_TIMEOUT_SEND_VOLTAG		     = 10000;
  static const u_int32_t	CH_TIMEOUT_INITIALIZE_ELEMENT_STATUS = 500000;
  
***************
*** 122,133 ****
  
  typedef enum {
  	CH_Q_NONE	= 0x00,
! 	CH_Q_NO_DBD	= 0x01
  } ch_quirks;
  
  #define CH_Q_BIT_STRING	\
  	"\020"		\
! 	"\001NO_DBD"
  
  #define ccb_state	ppriv_field0
  #define ccb_bp		ppriv_ptr1
--- 122,135 ----
  
  typedef enum {
  	CH_Q_NONE	= 0x00,
! 	CH_Q_NO_DBD	= 0x01,
! 	CH_Q_NO_DVCID	= 0x02
  } ch_quirks;
  
  #define CH_Q_BIT_STRING	\
  	"\020"		\
! 	"\001NO_DBD"	\
! 	"\002NO_DVCID"
  
  #define ccb_state	ppriv_field0
  #define ccb_bp		ppriv_ptr1
***************
*** 396,401 ****
--- 398,411 ----
  	periph->softc = softc;
  	softc->quirks = CH_Q_NONE;
  
+ 	/*
+ 	 * The DVCID and CURDATA bits were not introduced until the SMC
+ 	 * spec.  If this device claims SCSI-2 or earlier support, then it
+ 	 * very likely does not support these bits.
+ 	 */
+ 	if (cgd->inq_data.version <= SCSI_REV_2)
+ 		softc->quirks |= CH_Q_NO_DVCID;
+ 
  	bzero(&cpi, sizeof(cpi));
  	xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
  	cpi.ccb_h.func_code = XPT_PATH_INQ;
***************
*** 1208,1213 ****
--- 1218,1225 ----
  	caddr_t data = NULL;
  	size_t size, desclen;
  	int avail, i, error = 0;
+ 	int curdata, dvcid, sense_flags;
+ 	int try_no_dvcid = 0;
  	struct changer_element_status *user_data = NULL;
  	struct ch_softc *softc;
  	union ccb *ccb;
***************
*** 1239,1252 ****
  	cam_periph_lock(periph);
  	ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
  
  	scsi_read_element_status(&ccb->csio,
  				 /* retries */ 1,
  				 /* cbfcnp */ chdone,
  				 /* tag_action */ MSG_SIMPLE_Q_TAG,
  				 /* voltag */ want_voltags,
  				 /* sea */ softc->sc_firsts[chet],
! 				 /* dvcid */ 1,
! 				 /* curdata */ 1,
  				 /* count */ 1,
  				 /* data_ptr */ data,
  				 /* dxfer_len */ 1024,
--- 1251,1281 ----
  	cam_periph_lock(periph);
  	ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
  
+ 	sense_flags = SF_RETRY_UA;
+ 	if (softc->quirks & CH_Q_NO_DVCID) {
+ 		dvcid = 0;
+ 		curdata = 0;
+ 	} else {
+ 		dvcid = 1;
+ 		curdata = 1;
+ 		/*
+ 		 * Don't print anything for an Illegal Request, because
+ 		 * these flags can cause some changers to complain.  We'll
+ 		 * retry without them if we get an error.
+ 		 */
+ 		sense_flags |= SF_QUIET_IR;
+ 	}
+ 
+ retry_einval:
+ 
  	scsi_read_element_status(&ccb->csio,
  				 /* retries */ 1,
  				 /* cbfcnp */ chdone,
  				 /* tag_action */ MSG_SIMPLE_Q_TAG,
  				 /* voltag */ want_voltags,
  				 /* sea */ softc->sc_firsts[chet],
! 				 /* dvcid */ dvcid,
! 				 /* curdata */ curdata,
  				 /* count */ 1,
  				 /* data_ptr */ data,
  				 /* dxfer_len */ 1024,
***************
*** 1254,1262 ****
  				 /* timeout */ CH_TIMEOUT_READ_ELEMENT_STATUS);
  
  	error = cam_periph_runccb(ccb, cherror, /*cam_flags*/ CAM_RETRY_SELTO,
! 				  /*sense_flags*/ SF_RETRY_UA,
  				  softc->device_stats);
  
  	if (error)
  		goto done;
  	cam_periph_unlock(periph);
--- 1283,1320 ----
  				 /* timeout */ CH_TIMEOUT_READ_ELEMENT_STATUS);
  
  	error = cam_periph_runccb(ccb, cherror, /*cam_flags*/ CAM_RETRY_SELTO,
! 				  /*sense_flags*/ sense_flags,
  				  softc->device_stats);
  
+ 	/*
+ 	 * An Illegal Request sense key (only used if there is no asc/ascq)
+ 	 * or 0x24,0x00 for an ASC/ASCQ both map to EINVAL.  If dvcid or
+ 	 * curdata are set (we set both or neither), try turning them off
+ 	 * and see if the command is successful.
+ 	 */
+ 	if ((error == EINVAL)
+ 	 && (dvcid || curdata))  {
+ 		dvcid = 0;
+ 		curdata = 0;
+ 		error = 0;
+ 		/* At this point we want to report any Illegal Request */
+ 		sense_flags &= ~SF_QUIET_IR;
+ 		try_no_dvcid = 1;
+ 		goto retry_einval;
+ 	}
+ 
+ 	/*
+ 	 * In this case, we tried a read element status with dvcid and
+ 	 * curdata set, and it failed.  We retried without those bits, and
+ 	 * it succeeded.  Suggest to the user that he set a quirk, so we
+ 	 * don't go through the retry process the first time in the future.
+ 	 * This should only happen on changers that claim SCSI-3 or higher,
+ 	 * but don't support these bits.
+ 	 */
+ 	if ((try_no_dvcid != 0)
+ 	 && (error == 0))
+ 		softc->quirks |= CH_Q_NO_DVCID;
+ 
  	if (error)
  		goto done;
  	cam_periph_unlock(periph);
***************
*** 1284,1291 ****
  				 /* voltag */ want_voltags,
  				 /* sea */ softc->sc_firsts[chet]
  				 + cesr->cesr_element_base,
! 				 /* dvcid */ 1,
! 				 /* curdata */ 1,
  				 /* count */ cesr->cesr_element_count,
  				 /* data_ptr */ data,
  				 /* dxfer_len */ size,
--- 1342,1349 ----
  				 /* voltag */ want_voltags,
  				 /* sea */ softc->sc_firsts[chet]
  				 + cesr->cesr_element_base,
! 				 /* dvcid */ dvcid,
! 				 /* curdata */ curdata,
  				 /* count */ cesr->cesr_element_count,
  				 /* data_ptr */ data,
  				 /* dxfer_len */ size,

--9amGYk9869ThD9tj--

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 22:15:15 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 1FDECA5B;
 Thu, 11 Jul 2013 22:15:15 +0000 (UTC)
 (envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 1145C18FB;
 Thu, 11 Jul 2013 22:15:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BMFEfr041623;
 Thu, 11 Jul 2013 22:15:14 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BMFEjb041622;
 Thu, 11 Jul 2013 22:15:14 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201307112215.r6BMFEjb041622@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Thu, 11 Jul 2013 22:15:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253223 - stable/9/bin/test
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 22:15:15 -0000

Author: jilles
Date: Thu Jul 11 22:15:14 2013
New Revision: 253223
URL: http://svnweb.freebsd.org/changeset/base/253223

Log:
  MFC r251211: test(1): Add information about replacing -nt/-ot.

Modified:
  stable/9/bin/test/test.1
Directory Properties:
  stable/9/bin/test/   (props changed)

Modified: stable/9/bin/test/test.1
==============================================================================
--- stable/9/bin/test/test.1	Thu Jul 11 21:33:03 2013	(r253222)
+++ stable/9/bin/test/test.1	Thu Jul 11 22:15:14 2013	(r253223)
@@ -331,6 +331,20 @@ missing.
 .It >1
 An error occurred.
 .El
+.Sh EXAMPLES
+Implement
+.Li test FILE1 -nt FILE2
+using only
+.Tn POSIX
+functionality:
+.Pp
+.Dl test -n \&"$(find -L -- FILE1 -prune -newer FILE2 2>/dev/null)\&"
+.Pp
+This can be modified using non-standard
+.Xr find 1
+primaries like
+.Cm -newerca
+to compare other timestamps.
 .Sh COMPATIBILITY
 For compatibility with some other implementations,
 the
@@ -341,7 +355,9 @@ with the same meaning.
 .Sh SEE ALSO
 .Xr builtin 1 ,
 .Xr expr 1 ,
+.Xr find 1 ,
 .Xr sh 1 ,
+.Xr stat 1 ,
 .Xr symlink 7
 .Sh STANDARDS
 The

From owner-svn-src-all@FreeBSD.ORG  Thu Jul 11 22:19:18 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id CA1D3CA9;
 Thu, 11 Jul 2013 22:19:18 +0000 (UTC)
 (envelope-from cperciva@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id BAE5D1955;
 Thu, 11 Jul 2013 22:19:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6BMJIGY042097;
 Thu, 11 Jul 2013 22:19:18 GMT
 (envelope-from cperciva@svn.freebsd.org)
Received: (from cperciva@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6BMJIi8042095;
 Thu, 11 Jul 2013 22:19:18 GMT
 (envelope-from cperciva@svn.freebsd.org)
Message-Id: <201307112219.r6BMJIi8042095@svn.freebsd.org>
From: Colin Percival 
Date: Thu, 11 Jul 2013 22:19:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253224 - head/usr.sbin/portsnap/portsnap
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 11 Jul 2013 22:19:18 -0000

Author: cperciva
Date: Thu Jul 11 22:19:18 2013
New Revision: 253224
URL: http://svnweb.freebsd.org/changeset/base/253224

Log:
  Fix bug in deleting files: If two ports had the same tarball and one of
  them changed (or was removed from the tree) then portsnap would delete
  that file.  This happened earlier today when one of two empty port
  directories was removed.  Uniquifying the lists of needed files fixes
  this.
  
  9.2-RELEASE candidate.
  
  MFC after:	3 days

Modified:
  head/usr.sbin/portsnap/portsnap/portsnap.sh

Modified: head/usr.sbin/portsnap/portsnap/portsnap.sh
==============================================================================
--- head/usr.sbin/portsnap/portsnap/portsnap.sh	Thu Jul 11 22:15:14 2013	(r253223)
+++ head/usr.sbin/portsnap/portsnap/portsnap.sh	Thu Jul 11 22:19:18 2013	(r253224)
@@ -864,8 +864,8 @@ fetch_update() {
 	echo "done."
 
 # Remove files which are no longer needed
-	cut -f 2 -d '|' tINDEX INDEX | sort > oldfiles
-	cut -f 2 -d '|' tINDEX.new INDEX.new | sort | comm -13 - oldfiles |
+	cut -f 2 -d '|' tINDEX INDEX | sort -u > oldfiles
+	cut -f 2 -d '|' tINDEX.new INDEX.new | sort -u | comm -13 - oldfiles |
 	    lam -s "files/" - -s ".gz" | xargs rm -f
 	rm patchlist filelist oldfiles
 

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 00:40:50 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 6005E2D1;
 Fri, 12 Jul 2013 00:40:50 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 41CE21F6E;
 Fri, 12 Jul 2013 00:40:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C0eoqJ084379;
 Fri, 12 Jul 2013 00:40:50 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C0enbB084376;
 Fri, 12 Jul 2013 00:40:49 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120040.r6C0enbB084376@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 00:40:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253227 - in stable/9: etc etc/rc.d share/man/man5
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 00:40:50 -0000

Author: hrs
Date: Fri Jul 12 00:40:49 2013
New Revision: 253227
URL: http://svnweb.freebsd.org/changeset/base/253227

Log:
  MFC 230453, 230726, 252015, 252426:
  
  - ipv6_enable + ipv6_gateway_enable should unset ACCEPT_RTADV by default for
    backward compatibility.
  
  - Configurations in ipv6_prefix_IF should be recognized even if there is no
    ifconfig_IF_ipv6.
  
  - DAD wait should be performed at once, not on a per-interface basis, if
    possible.  This fixes an issue that a system with a lot of IPv6-capable
    interfaces takes too long for booting.
  
  - Add CIDR notation support like 192.168.1-2.10-16/24 to $ifconfig_IF_aliasN.
    This is an extended version of ipv4_addr_IF which supports both IPv4 and
    IPv6, and multiple range specifications.  To avoid to generate too many
    addresses, the maximum number of the generated addresses is currently
    limited to 31.
  
  - Add $ifconfig_IF_aliases, which accepts multiple IP aliases in a variable.
  
  - ipv6_prefix_IF now supports !/64 prefix length.  In addition to the old
    64-bit format (2001:db8:1:1), a full 128-bit format like 2001:db8:1:1::/64
    is supported.
  
  - Replace ifconfig command with $IFCONFIG_CMD variable to support
    a dry-run mode in the future.
  
  - Remove IP aliases before removing all of IPv4 addresses when doing
    "rc.d/netif down".
  
  - Add a DAD wait to network6_getladdr() because it is possible to fail to
    configure an EUI64 address when ipv6_prefix_IF is specified.

Modified:
  stable/9/etc/network.subr
  stable/9/etc/rc.d/netif
  stable/9/share/man/man5/rc.conf.5
Directory Properties:
  stable/9/etc/   (props changed)
  stable/9/etc/rc.d/   (props changed)
  stable/9/share/man/man5/   (props changed)

Modified: stable/9/etc/network.subr
==============================================================================
--- stable/9/etc/network.subr	Thu Jul 11 23:35:51 2013	(r253226)
+++ stable/9/etc/network.subr	Fri Jul 12 00:40:49 2013	(r253227)
@@ -24,6 +24,10 @@
 #
 # $FreeBSD$
 #
+IFCONFIG_CMD="/sbin/ifconfig"
+
+# Maximum number of addresses expanded from a address range specification.
+_IPEXPANDMAX=31
 
 #
 # Subroutines commonly used from network startup scripts.
@@ -94,7 +98,7 @@ ifconfig_up()
 	# ifconfig_IF
 	ifconfig_args=`ifconfig_getargs $1`
 	if [ -n "${ifconfig_args}" ]; then
-		eval ifconfig $1 ${ifconfig_args}
+		eval ${IFCONFIG_CMD} $1 ${ifconfig_args}
 		_cfg=0
 	fi
 
@@ -122,7 +126,7 @@ ifconfig_up()
 		esac
 
 		if [ -n "${_ipv6_opts}" ]; then
-			ifconfig $1 inet6 ${_ipv6_opts}
+			${IFCONFIG_CMD} $1 inet6 ${_ipv6_opts}
 		fi
 
 		# ifconfig_IF_ipv6
@@ -136,24 +140,35 @@ ifconfig_up()
 				ifconfig_args="inet6 ${ifconfig_args}"
 			;;
 			esac
-			ifconfig $1 inet6 -ifdisabled
-			eval ifconfig $1 ${ifconfig_args}
+			${IFCONFIG_CMD} $1 inet6 -ifdisabled
+			eval ${IFCONFIG_CMD} $1 ${ifconfig_args}
+			_cfg=0
+		fi
+
+		# $ipv6_prefix_IF will be handled in
+		# ipv6_prefix_hostid_addr_common().
+		ifconfig_args=`get_if_var $1 ipv6_prefix_IF`
+		if [ -n "${ifconfig_args}" ]; then
+			${IFCONFIG_CMD} $1 inet6 -ifdisabled
 			_cfg=0
 		fi
 
-		# backward compatiblity: $ipv6_ifconfig_IF
+		# backward compatibility: $ipv6_ifconfig_IF
 		ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF`
 		if [ -n "${ifconfig_args}" ]; then
 			warn "\$ipv6_ifconfig_$1 is obsolete." \
 			    "  Use ifconfig_$1_ipv6 instead."
-			ifconfig $1 inet6 -ifdisabled
-			eval ifconfig $1 inet6 ${ifconfig_args}
+			${IFCONFIG_CMD} $1 inet6 -ifdisabled
+			eval ${IFCONFIG_CMD} $1 inet6 ${ifconfig_args}
 			_cfg=0
 		fi
 	fi
 
+	ifalias $1 link alias
+	ifalias $1 ether alias
+
 	if [ ${_cfg} -eq 0 ]; then
-		ifconfig $1 up
+		${IFCONFIG_CMD} $1 up
 	fi
 
 	if wpaif $1; then
@@ -166,7 +181,7 @@ ifconfig_up()
 
 	if dhcpif $1; then
 		if [ $_cfg -ne 0 ] ; then
-			ifconfig $1 up
+			${IFCONFIG_CMD} $1 up
 		fi
 		if syncdhcpif $1; then
 			/etc/rc.d/dhclient start $1
@@ -200,7 +215,7 @@ ifconfig_down()
 	fi
 
 	if ifexists $1; then
-		ifconfig $1 down
+		${IFCONFIG_CMD} $1 down
 		_cfg=0
 	fi
 
@@ -420,6 +435,9 @@ afexists()
 			return 1
 		fi
 		;;
+	link|ether)
+		return 0
+		;;
 	*)
 		err 1 "afexists(): Unsupported address family: $_af"
 		;;
@@ -559,7 +577,7 @@ ipv6_autoconfif()
 ifexists()
 {
 	[ -z "$1" ] && return 1
-	ifconfig -n $1 > /dev/null 2>&1
+	${IFCONFIG_CMD} -n $1 > /dev/null 2>&1
 }
 
 # ipv4_up if
@@ -574,11 +592,10 @@ ipv4_up()
 	if [ "${_if}" = "lo0" ]; then
 		ifconfig_args=`get_if_var ${_if} ifconfig_IF`
 		if [ -z "${ifconfig_args}" ]; then
-			ifconfig ${_if} inet 127.0.0.1/8 alias
+			${IFCONFIG_CMD} ${_if} inet 127.0.0.1/8 alias
 		fi
 	fi
-	ifalias_up ${_if} inet && _ret=0
-	ipv4_addrs_common ${_if} alias && _ret=0
+	ifalias ${_if} inet alias && _ret=0
 
 	return $_ret
 }
@@ -595,7 +612,7 @@ ipv6_up()
 		return 0
 	fi
 
-	ifalias_up ${_if} inet6 && _ret=0
+	ifalias ${_if} inet6 alias && _ret=0
 	ipv6_prefix_hostid_addr_common ${_if} alias && _ret=0
 	ipv6_accept_rtadv_up ${_if} && _ret=0
 
@@ -615,7 +632,9 @@ ipv4_down()
 	_ifs="^"
 	_ret=1
 
-	inetList="`ifconfig ${_if} | grep 'inet ' | tr "\n" "$_ifs"`"
+	ifalias ${_if} inet -alias && _ret=0
+
+	inetList="`${IFCONFIG_CMD} ${_if} | grep 'inet ' | tr "\n" "$_ifs"`"
 
 	oldifs="$IFS"
 	IFS="$_ifs"
@@ -626,15 +645,12 @@ ipv4_down()
 		_inet=`expr "$_inet" : '.*\(inet \([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\).*'`
 
 		IFS="$oldifs"
-		ifconfig ${_if} ${_inet} delete
+		${IFCONFIG_CMD} ${_if} ${_inet} delete
 		IFS="$_ifs"
 		_ret=0
 	done
 	IFS="$oldifs"
 
-	ifalias_down ${_if} inet && _ret=0
-	ipv4_addrs_common ${_if} -alias && _ret=0
-
 	return $_ret
 }
 
@@ -653,9 +669,9 @@ ipv6_down()
 
 	ipv6_accept_rtadv_down ${_if} && _ret=0
 	ipv6_prefix_hostid_addr_common ${_if} -alias && _ret=0
-	ifalias_down ${_if} inet6 && _ret=0
+	ifalias ${_if} inet6 -alias && _ret=0
 
-	inetList="`ifconfig ${_if} | grep 'inet6 ' | tr "\n" "$_ifs"`"
+	inetList="`${IFCONFIG_CMD} ${_if} | grep 'inet6 ' | tr "\n" "$_ifs"`"
 
 	oldifs="$IFS"
 	IFS="$_ifs"
@@ -666,7 +682,7 @@ ipv6_down()
 		_inet6=`expr "$_inet6" : '.*\(inet6 \([0-9a-f:]*\)\).*'`
 
 		IFS="$oldifs"
-		ifconfig ${_if} ${_inet6} -alias
+		${IFCONFIG_CMD} ${_if} ${_inet6} -alias
 		IFS="$_ifs"
 		_ret=0
 	done
@@ -675,234 +691,356 @@ ipv6_down()
 	return $_ret
 }
 
-# ipv4_addrs_common if action
-#	Evaluate the ifconfig_if_ipv4 arguments for interface $if and
-#	use $action to add or remove IPv4 addresses from $if.
-ipv4_addrs_common()
-{
-	local _ret _if _action _cidr _cidr_addr
-	local _ipaddr _netmask _range _ipnet _iplow _iphigh _ipcount
-	_ret=1
-	_if=$1
-	_action=$2
-
-	# get ipv4-addresses
-	cidr_addr=`get_if_var $_if ipv4_addrs_IF`
-
-	for _cidr in ${cidr_addr}; do
-		_ipaddr=${_cidr%%/*}
-		_netmask="/"${_cidr##*/}
-		_range=${_ipaddr##*.}
-		_ipnet=${_ipaddr%.*}
-		_iplow=${_range%-*}
-		_iphigh=${_range#*-}
-
-		# clear netmask when removing aliases
-		if [ "${_action}" = "-alias" ]; then
-			_netmask=""
-		fi
-
-		_ipcount=${_iplow}
-		while [ "${_ipcount}" -le "${_iphigh}" ]; do
-			eval "ifconfig ${_if} ${_action} ${_ipnet}.${_ipcount}${_netmask}"
-			_ipcount=$((${_ipcount}+1))
-			_ret=0
-
-			# only the first ipaddr in a subnet need the real netmask
-			if [ "${_action}" != "-alias" ]; then
-				_netmask="/32"
-			fi
-		done
-	done
-
-	return $_ret
-}
-
-# ifalias_up if af
-#	Configure aliases for network interface $if.
+# ifalias if af action
+#	Configure or remove aliases for network interface $if.
 #	It returns 0 if at least one alias was configured or
-#	1 if there were none.
+#	removed, or 1 if there were none.
 #
-ifalias_up()
+ifalias()
 {
 	local _ret
 	_ret=1
 
+	afexists $2 || return $_ret
+
 	case "$2" in
-	inet)
-		_ret=`ifalias_ipv4_up "$1"`
-		;;
-	inet6)
-		_ret=`ifalias_ipv6_up "$1"`
+	inet|inet6|link|ether)
+		ifalias_af_common $1 $2 $3 && _ret=0
 		;;
 	esac
 
 	return $_ret
 }
 
-# ifalias_ipv4_up if
-#	Helper function for ifalias_up().  Handles IPv4.
+# ifalias_expand_addr af action addr
+#	Expand address range ("N-M") specification in addr.
+#	"addr" must not include an address-family keyword.
+#	The results will include an address-family keyword.
 #
-ifalias_ipv4_up()
+ifalias_expand_addr()
 {
-	local _ret alias ifconfig_args
-	_ret=1
-
-	# ifconfig_IF_aliasN which starts with "inet"
-	alias=0
-	while : ; do
-		ifconfig_args=`get_if_var $1 ifconfig_IF_alias${alias}`
-		case "${ifconfig_args}" in
-		inet\ *)
-			ifconfig $1 ${ifconfig_args} alias && _ret=0
-			;;
-		inet6\ *)
-			;;
-		"")
-			break
-			;;
-		*)
-			warn "\$ifconfig_$1_alias${alias} needs " \
-			    "\"inet\" keyword for an IPv4 address."
-			ifconfig $1 ${ifconfig_args} alias && _ret=0
-			;;
-		esac
-		alias=$((${alias} + 1))
-	done
 
-	return $_ret
+	afexists $1 || return
+	ifalias_expand_addr_$1 $2 $3
 }
 
-# ifalias_ipv6_up if
-#	Helper function for ifalias_up().  Handles IPv6.
+# ifalias_expand_addr_inet action addr
+#	Helper function for ifalias_expand_addr().  Handles IPv4.
 #
-ifalias_ipv6_up()
+ifalias_expand_addr_inet()
 {
-	local _ret alias ifconfig_args
-	_ret=1
+	local _action _arg _cidr _cidr_addr
+	local _ipaddr _plen _range _iphead _iptail _iplow _iphigh _ipcount
+	local _retstr _c
+	_action=$1
+	_arg=$2
+	_retstr=
 
-	# ifconfig_IF_aliasN which starts with "inet6"
-	alias=0
-	while : ; do
-		ifconfig_args=`get_if_var $1 ifconfig_IF_alias${alias}`
-		case "${ifconfig_args}" in
-		inet6\ *)
-			ifconfig $1 ${ifconfig_args} alias && _ret=0
-			;;
-		"")
-			break
-			;;
+	case $_action:$_arg in
+	*:*--*)		return ;;			# invalid
+	tmp:*)		echo $_arg && return ;;		# already expanded
+	tmp:*-*)	_action="alias"	;;		# to be expanded
+	*:*-*)		;;				# to be expanded
+	*:*)		echo inet $_arg && return ;;	# already expanded
+	esac
+
+	for _cidr in $_arg; do
+		_ipaddr=${_cidr%%/*}
+		_plen=${_cidr##*/}
+		# When subnet prefix length is not specified, use /32.
+		case $_plen in
+		$_ipaddr)	_plen=32 ;;	# "/" character not found
 		esac
-		alias=$((${alias} + 1))
-	done
 
-	# backward compatibility: ipv6_ifconfig_IF_aliasN.
-	alias=0
-	while : ; do
-		ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF_alias${alias}`
-		case "${ifconfig_args}" in
-		"")
-			break
+		OIFS=$IFS
+		IFS=. set -- $_ipaddr
+		_range=
+		_iphead=
+		_iptail=
+		for _c in $@; do
+			case $_range:$_c in
+			:[0-9]*-[0-9]*)
+				_range=$_c
 			;;
-		*)
-			ifconfig $1 inet6 ${ifconfig_args} alias && _ret=0
-			warn "\$ipv6_ifconfig_$1_alias${alias} is obsolete." \
-			    "  Use ifconfig_$1_aliasN instead."
+			:*)
+				_iphead="${_iphead}${_iphead:+.}${_c}"
 			;;
-		esac
-		alias=$((${alias} + 1))
+			*:*)
+				_iptail="${_iptail}${_iptail:+.}${_c}"
+			;;
+			esac
+		done
+		IFS=$OIFS
+		_iplow=${_range%-*}
+		_iphigh=${_range#*-}
+
+		# clear netmask when removing aliases
+		if [ "$_action" = "-alias" ]; then
+			_plen=""
+		fi
+
+		_ipcount=$_iplow
+		while [ "$_ipcount" -le "$_iphigh" ]; do
+			_retstr="${_retstr} ${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail}${_plen:+/}${_plen}"
+			if [ $_ipcount -gt $(($_iplow + $_IPEXPANDMAX)) ]; then
+				warn "Range specification is too large (${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_iphigh}${_iptail:+.}${_iptail}).  ${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail} was processed."
+				break
+			else
+				_ipcount=$(($_ipcount + 1))
+			fi
+			# Forcibly set /32 for remaining aliases.
+			_plen=32
+		done
 	done
 
-	return $_ret
+	for _c in $_retstr; do
+		ifalias_expand_addr_inet $_action $_c
+	done
 }
 
-# ifalias_down if af
-#	Remove aliases for network interface $if.
-#	It returns 0 if at least one alias was removed or
-#	1 if there were none.
+# ifalias_expand_addr_inet6 action addr
+#	Helper function for ifalias_expand_addr().  Handles IPv6.
 #
-ifalias_down()
-{
-	local _ret
-	_ret=1
-
-	case "$2" in
-	inet)
-		_ret=`ifalias_ipv4_down "$1"`
-		;;
-	inet6)
-		_ret=`ifalias_ipv6_down "$1"`
-		;;
+ifalias_expand_addr_inet6()
+{
+	local _action _arg _cidr _cidr_addr
+	local _ipaddr _plen _ipleft _ipright _iplow _iphigh _ipcount
+	local _ipv4part
+	local _retstr _c
+	_action=$1
+	_arg=$2
+	_retstr=
+
+	case $_action:$_arg in
+	*:*--*)		return ;;			# invalid
+	tmp:*)		echo $_arg && return ;;
+	tmp:*-*)	_action="alias"	;;
+	*:*-*)		;;
+	*:*)		echo inet6 $_arg && return ;;
 	esac
 
-	return $_ret
+	for _cidr in $_arg; do
+		_ipaddr="${_cidr%%/*}"
+		_plen="${_cidr##*/}"
+
+		case $_action:$_ipaddr:$_cidr in
+		-alias:*:*)		unset _plen ;;
+		*:$_cidr:$_ipaddr)	unset _plen ;;
+		esac
+
+		if [ "${_ipaddr%:*.*.*.*}" = "$_ipaddr" ]; then
+			# Handle !v4mapped && !v4compat addresses.
+
+			# The default prefix length is 64.
+			case $_ipaddr:$_cidr in
+			$_cidr:$_ipaddr)	_plen="64" ;;
+			esac
+			_ipleft=${_ipaddr%-*}
+			_ipright=${_ipaddr#*-}
+			_iplow=${_ipleft##*:}
+			_iphigh=${_ipright%%:*}
+			_ipleft=${_ipleft%:*}
+			_ipright=${_ipright#*:}
+
+			if [ "$_iphigh" = "$_ipright" ]; then
+				unset _ipright
+			else
+				_ipright=:$_ipright
+			fi
+
+			if [ -n "$_iplow" -a -n "$_iphigh" ]; then
+				_iplow=$((0x$_iplow))
+				_iphigh=$((0x$_iphigh))
+				_ipcount=$_iplow
+				while [ $_ipcount -le $_iphigh ]; do
+					_r=`printf "%s:%04x%s%s" \
+					    $_ipleft $_ipcount $_ipright \
+					    ${_plen:+/}$_plen`
+					_retstr="$_retstr $_r"
+					if [ $_ipcount -gt $(($_iplow + $_IPEXPANDMAX)) ]
+					then
+						warn "Range specification is too large $(printf '(%s:%04x%s-%s:%04x%s)' $_ipleft $_iplow $_ipright $_ipleft $_iphigh $_ipright). $(printf '%s:%04x%s-%s:%04x%s' $_ipleft $_iplow $_ipright $_ipleft $_ipcount $_ipright) was processed."
+						break
+					else
+						_ipcount=$(($_ipcount + 1))
+					fi
+				done
+			else
+				_retstr="${_ipaddr}${_plen:+/}${_plen}"
+			fi
+
+			for _c in $_retstr; do
+				ifalias_expand_addr_inet6 $_action $_c
+			done
+		else
+			# v4mapped/v4compat should handle as an IPv4 alias
+			_ipv4part=${_ipaddr##*:}
+
+			# Adjust prefix length if any.  If not, set the
+			# default prefix length as 32.
+			case $_ipaddr:$_cidr in
+			$_cidr:$_ipaddr)	_plen=32 ;;
+			*)			_plen=$(($_plen - 96)) ;;
+			esac
+
+			_retstr=`ifalias_expand_addr_inet \
+			    tmp ${_ipv4part}${_plen:+/}${_plen}`
+			for _c in $_retstr; do
+				ifalias_expand_addr_inet $_action $_c
+			done
+		fi
+	done
 }
 
-# ifalias_ipv4_down if
-#	Helper function for ifalias_down().  Handles IPv4.
+# ifalias_af_common_handler if af action args
+#	Helper function for ifalias_af_common().
 #
-ifalias_ipv4_down()
+ifalias_af_common_handler()
 {
-	local _ret alias ifconfig_args
+	local _ret _if _af _action _args _c _tmpargs
+
 	_ret=1
+	_if=$1
+	_af=$2
+	_action=$3
+	shift 3
+	_args=$*
+
+	case $_args in
+	${_af}\ *)	;;
+	*)	return	;;
+	esac
 
-	# ifconfig_IF_aliasN which starts with "inet"
-	alias=0
-	while : ; do
-		ifconfig_args=`get_if_var $1 ifconfig_IF_alias${alias}`
-		case "${ifconfig_args}" in
-		inet\ *)
-			ifconfig $1 ${ifconfig_args} -alias && _ret=0
+	# link(ether) does not support address removal.
+	case $_af:$_action in
+	link:-alias|ether:-alias)	return ;;
+	esac
+
+	_tmpargs=
+	for _c in $_args; do
+		case $_c in
+		${_af})
+			case $_tmpargs in
+			${_af}\ *-*)
+				ifalias_af_common_handler $_if $_af $_action \
+				`ifalias_expand_addr $_af $_action ${_tmpargs#${_af}\ }`
 			;;
-		"")
-			break
+			${_af}\ *)
+				${IFCONFIG_CMD} $_if $_tmpargs $_action && _ret=0
 			;;
+			esac
+			_tmpargs=$_af
+		;;
+		*)
+			_tmpargs="$_tmpargs $_c"
+		;;
 		esac
-		alias=$((${alias} + 1))
 	done
+	# Process the last component if any.
+	if [ -n "$_tmpargs}" ]; then
+		case $_tmpargs in
+		${_af}\ *-*)
+			ifalias_af_common_handler $_if $_af $_action \
+			`ifalias_expand_addr $_af $_action ${_tmpargs#${_af}\ }`
+		;;
+		${_af}\ *)
+			${IFCONFIG_CMD} $_if $_tmpargs $_action && _ret=0
+		;;
+		esac
+	fi
 
 	return $_ret
 }
 
-# ifalias_ipv6_down if
-#	Helper function for ifalias_down().  Handles IPv6.
+# ifalias_af_common if af action
+#	Helper function for ifalias().
 #
-ifalias_ipv6_down()
+ifalias_af_common()
 {
-	local _ret alias ifconfig_args
+	local _ret _if _af _action alias ifconfig_args _aliasn _c _tmpargs _iaf
+
 	_ret=1
+	_aliasn=
+	_if=$1
+	_af=$2
+	_action=$3
 
-	# ifconfig_IF_aliasN which starts with "inet6"
+	# ifconfig_IF_aliasN which starts with $_af
 	alias=0
 	while : ; do
-		ifconfig_args=`get_if_var $1 ifconfig_IF_alias${alias}`
-		case "${ifconfig_args}" in
-		inet6\ *)
-			ifconfig $1 ${ifconfig_args} -alias && _ret=0
+		ifconfig_args=`get_if_var $_if ifconfig_IF_alias${alias}`
+		_iaf=
+		case $ifconfig_args in
+		inet\ *)	_iaf=inet ;;
+		inet6\ *)	_iaf=inet6 ;;
+		ipx\ *)		_iaf=ipx ;;
+		link\ *)	_iaf=link ;;
+		ether\ *)	_iaf=ether ;;
+		esac
+
+		case ${_af}:${_action}:${_iaf}:"${ifconfig_args}" in
+		${_af}:*:${_af}:*)
+			_aliasn="$_aliasn $ifconfig_args"
 			;;
-		"")
+		${_af}:*:"":"")
 			break
 			;;
+		inet:alias:"":*)
+			_aliasn="$_aliasn inet $ifconfig_args"
+			warn "\$ifconfig_${_if}_alias${alias} needs " \
+			    "\"inet\" keyword for an IPv4 address."
 		esac
-		alias=$((${alias} + 1))
+		alias=$(($alias + 1))
 	done
 
 	# backward compatibility: ipv6_ifconfig_IF_aliasN.
-	alias=0
-	while : ; do
-		ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF_alias${alias}`
-		case "${ifconfig_args}" in
-		"")
-			break
+	case $_af in
+	inet6)
+		alias=0
+		while : ; do
+			ifconfig_args=`get_if_var $_if ipv6_ifconfig_IF_alias${alias}`
+			case ${_action}:"${ifconfig_args}" in
+			*:"")
+				break
+			;;
+			alias:*)
+				_aliasn="${_aliasn} inet6 ${ifconfig_args}"
+				warn "\$ipv6_ifconfig_${_if}_alias${alias} " \
+				    "is obsolete.  Use ifconfig_$1_aliasN " \
+				    "instead."
 			;;
-		*)
-			ifconfig $1 inet6 ${ifconfig_args} -alias && _ret=0
-			warn "\$ipv6_ifconfig_$1_alias${alias} is obsolete." \
-			    "  Use ifconfig_$1_aliasN instead."
+			esac
+			alias=$(($alias + 1))
+		done
+	esac
+
+	# backward compatibility: ipv4_addrs_IF.
+	for _tmpargs in `get_if_var $_if ipv4_addrs_IF`; do
+		_aliasn="$_aliasn inet $_tmpargs"
+	done
+
+	# Handle ifconfig_IF_aliases, ifconfig_IF_aliasN, and the others.
+	_tmpargs=
+	for _c in `get_if_var $_if ifconfig_IF_aliases` $_aliasn; do
+		case $_c in
+		inet|inet6|ipx|link|ether)
+			case $_tmpargs in
+			${_af}\ *)
+				eval ifalias_af_common_handler $_if $_af $_action $_tmpargs && _ret=0
 			;;
+			esac
+			_tmpargs=$_c
+		;;
+		*)
+			_tmpargs="$_tmpargs $_c"
 		esac
-		alias=$((${alias} + 1))
 	done
+	# Process the last component
+	case $_tmpargs in
+	${_af}\ *)
+		ifalias_af_common_handler $_if $_af $_action $_tmpargs && _ret=0
+	;;
+	esac
 
 	return $_ret
 }
@@ -923,14 +1061,32 @@ ipv6_prefix_hostid_addr_common()
 		hostid=${hostid%\%*}
 
 		for j in ${prefix}; do
-			address=$j\:${hostid}
-			ifconfig ${_if} inet6 ${address} prefixlen 64 ${_action}
+			# The default prefixlen is 64.
+			plen=${j#*/}
+			case $j:$plen in
+			$plen:$j)	plen=64 ;;
+			*)		j=${j%/*} ;;
+			esac
+
+			# Normalize the last part by removing ":"
+			j=${j%:*}
+			j=${j%:}
+			OIFS=$IFS; IFS=":"; set -- $j; nj=$#; IFS=$OIFS
+			OIFS=$IFS; IFS=":"; set -- $hostid; nh=$#; IFS=$OIFS
+			if [ $(($nj + $nh)) -eq 8 ]; then
+				address=$j\:$hostid
+			else
+				address=$j\::$hostid
+			fi
+
+			${IFCONFIG_CMD} ${_if} inet6 ${address} \
+				prefixlen $plen ${_action}
 
 			# if I am a router, add subnet router
 			# anycast address (RFC 2373).
 			if checkyesno ipv6_gateway_enable; then
-				ifconfig ${_if} inet6 $j:: prefixlen 64 \
-					${_action} anycast
+				${IFCONFIG_CMD} ${_if} inet6 $j:: \
+					prefixlen $plen ${_action} anycast
 			fi
 		done
 	fi
@@ -942,7 +1098,7 @@ ipv6_prefix_hostid_addr_common()
 ipv6_accept_rtadv_up()
 {
 	if ipv6_autoconfif $1; then
-		ifconfig $1 inet6 accept_rtadv up
+		${IFCONFIG_CMD} $1 inet6 accept_rtadv up
 		if ! checkyesno rtsold_enable; then
 			rtsol ${rtsol_flags} $1
 		fi
@@ -954,7 +1110,7 @@ ipv6_accept_rtadv_up()
 ipv6_accept_rtadv_down()
 {
 	if ipv6_autoconfif $1; then
-		ifconfig $1 inet6 -accept_rtadv
+		${IFCONFIG_CMD} $1 inet6 -accept_rtadv
 	fi
 }
 
@@ -999,7 +1155,7 @@ clone_up()
 
 	# create_args_IF
 	for ifn in ${cloned_interfaces}; do
-		ifconfig ${ifn} create `get_if_var ${ifn} create_args_IF`
+		${IFCONFIG_CMD} ${ifn} create `get_if_var ${ifn} create_args_IF`
 		if [ $? -eq 0 ]; then
 			_list="${_list}${_prefix}${ifn}"
 			[ -z "$_prefix" ] && _prefix=' '
@@ -1019,7 +1175,7 @@ clone_down()
 	_list=
 
 	for ifn in ${cloned_interfaces}; do
-		ifconfig -n ${ifn} destroy
+		${IFCONFIG_CMD} -n ${ifn} destroy
 		if [ $? -eq 0 ]; then
 			_list="${_list}${_prefix}${ifn}"
 			[ -z "$_prefix" ] && _prefix=' '
@@ -1046,16 +1202,16 @@ childif_create()
 		debug_flags="`get_if_var $child wlandebug_IF`"
 
 		if expr $child : 'wlan[0-9][0-9]*$' >/dev/null 2>&1; then
-			ifconfig $child create ${create_args} && cfg=0
+			${IFCONFIG_CMD} $child create ${create_args} && cfg=0
 			if [ -n "${debug_flags}" ]; then
 				wlandebug -i $child ${debug_flags}
 			fi
 		else
-			i=`ifconfig wlan create ${create_args}`
+			i=`${IFCONFIG_CMD} wlan create ${create_args}`
 			if [ -n "${debug_flags}" ]; then
 				wlandebug -i $i ${debug_flags}
 			fi
-			ifconfig $i name $child && cfg=0
+			${IFCONFIG_CMD} $i name $child && cfg=0
 		fi
 		if autoif $child; then
 			ifn_start $child
@@ -1073,14 +1229,14 @@ childif_create()
 		if expr $child : '[1-9][0-9]*$' >/dev/null 2>&1; then
 			child="${ifn}.${child}"
 			create_args=`get_if_var $child create_args_IF`
-			ifconfig $child create ${create_args} && cfg=0
+			${IFCONFIG_CMD} $child create ${create_args} && cfg=0
 		else
 			create_args="vlandev $ifn `get_if_var $child create_args_IF`"
 			if expr $child : 'vlan[0-9][0-9]*$' >/dev/null 2>&1; then
-				ifconfig $child create ${create_args} && cfg=0
+				${IFCONFIG_CMD} $child create ${create_args} && cfg=0
 			else
-				i=`ifconfig vlan create ${create_args}`
-				ifconfig $i name $child && cfg=0
+				i=`${IFCONFIG_CMD} vlan create ${create_args}`
+				${IFCONFIG_CMD} $i name $child && cfg=0
 			fi
 		fi
 		if autoif $child; then
@@ -1104,7 +1260,7 @@ childif_destroy()
 		if ! ifexists $child; then
 			continue
 		fi
-		ifconfig -n $child destroy && cfg=0
+		${IFCONFIG_CMD} -n $child destroy && cfg=0
 	done
 
 	child_vlans=`get_if_var $ifn vlans_IF`
@@ -1115,7 +1271,7 @@ childif_destroy()
 		if ! ifexists $child; then
 			continue
 		fi
-		ifconfig -n $child destroy && cfg=0
+		${IFCONFIG_CMD} -n $child destroy && cfg=0
 	done
 
 	return ${cfg}
@@ -1162,13 +1318,13 @@ gif_up()
 			;;
 		*)
 			if expr $i : 'gif[0-9][0-9]*$' >/dev/null 2>&1; then
-				ifconfig $i create >/dev/null 2>&1
+				${IFCONFIG_CMD} $i create >/dev/null 2>&1
 			else
-				gif=`ifconfig gif create`
-				ifconfig $gif name $i
+				gif=`${IFCONFIG_CMD} gif create`
+				${IFCONFIG_CMD} $gif name $i
 			fi
-			ifconfig $i tunnel ${peers}
-			ifconfig $i up
+			${IFCONFIG_CMD} $i tunnel ${peers}
+			${IFCONFIG_CMD} $i up
 			;;
 		esac
 	done
@@ -1234,7 +1390,7 @@ ipx_up()
 	# ifconfig_IF_ipx
 	ifconfig_args=`_ifconfig_getargs $ifn ipx`
 	if [ -n "${ifconfig_args}" ]; then
-		ifconfig ${ifn} ${ifconfig_args}
+		${IFCONFIG_CMD} ${ifn} ${ifconfig_args}
 		return 0
 	fi
 
@@ -1251,7 +1407,7 @@ ipx_down()
 	_if=$1
 	_ifs="^"
 	_ret=1
-	ipxList="`ifconfig ${_if} | grep 'ipx ' | tr "\n" "$_ifs"`"
+	ipxList="`${IFCONFIG_CMD} ${_if} | grep 'ipx ' | tr "\n" "$_ifs"`"
 	oldifs="$IFS"
 
 	IFS="$_ifs"
@@ -1262,7 +1418,7 @@ ipx_down()
 		_ipx=`expr "$_ipx" : '.*\(ipx [0-9a-h]\{1,8\}H*\.[0-9a-h]\{1,12\}\).*'`
 
 		IFS="$oldifs"
-		ifconfig ${_if} ${_ipx} delete
+		${IFCONFIG_CMD} ${_if} ${_ipx} delete
 		IFS="$_ifs"
 		_ret=0
 	done
@@ -1279,10 +1435,10 @@ ifnet_rename()
 	local _if _ifname
 
 	# ifconfig_IF_name
-	for _if in `ifconfig -l`; do
+	for _if in `${IFCONFIG_CMD} -l`; do
 		_ifname=`get_if_var $_if ifconfig_IF_name`
 		if [ ! -z "$_ifname" ]; then
-			ifconfig $_if name $_ifname
+			${IFCONFIG_CMD} $_if name $_ifname
 		fi
 	done
 
@@ -1314,7 +1470,7 @@ list_net_interfaces()
 	_tmplist=
 	case ${network_interfaces} in
 	[Aa][Uu][Tt][Oo])
-		_autolist="`ifconfig -l`"
+		_autolist="`${IFCONFIG_CMD} -l`"
 		_lo=
 		for _if in ${_autolist} ; do
 			if autoif $_if; then
@@ -1422,7 +1578,7 @@ is_wired_interface()
 {
 	local media
 
-	case `ifconfig $1 2>/dev/null` in
+	case `${IFCONFIG_CMD} $1 2>/dev/null` in
 	*media:?Ethernet*) media=Ethernet ;;
 	esac
 
@@ -1434,25 +1590,27 @@ is_wired_interface()
 #	If flag is defined, tentative ones will be excluded.
 network6_getladdr()
 {
-	local proto addr rest
-	ifconfig $1 2>/dev/null | while read proto addr rest; do
-		case ${proto} in
-		inet6)
-			case ${addr} in
-			fe80::*)
-				if [ -z "$2" ]; then
-					echo ${addr}
-					return
-				fi
-				case ${rest} in
-				*tentative*)
-					continue
-					;;
-				*)
-					echo ${addr}
-					return
-				esac
-			esac
+	local _if _flag proto addr rest
+	_if=$1
+	_flag=$2
+
+	${IFCONFIG_CMD} $_if 2>/dev/null | while read proto addr rest; do
+		case "${proto}/${addr}/${_flag}/${rest}" in
+		inet6/fe80::*//*)
+			echo ${addr}
+		;;
+		inet6/fe80:://*tentative*)	# w/o flag
+			sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
+			network6_getladdr $_if $_flags
+		;;
+		inet6/fe80::/*/*tentative*)	# w/ flag
+			echo ${addr}
+		;;
+		*)
+			continue
+		;;
 		esac
+
+		return
 	done
 }

Modified: stable/9/etc/rc.d/netif
==============================================================================
--- stable/9/etc/rc.d/netif	Thu Jul 11 23:35:51 2013	(r253226)
+++ stable/9/etc/rc.d/netif	Fri Jul 12 00:40:49 2013	(r253227)
@@ -123,16 +123,28 @@ network_common()
 		_cooked_list="`list_net_interfaces`"
 	fi
 
+	_dadwait=
 	_fail=
 	_ok=
 	for ifn in ${_cooked_list}; do
 		if ${_func} ${ifn} $2; then
 			_ok="${_ok} ${ifn}"
+			if ipv6if ${ifn}; then
+				_dadwait=1
+			fi
 		else
 			_fail="${_fail} ${ifn}"
 		fi
 	done
 
+	# inet6 address configuration needs sleep for DAD.
+	case ${_func}:${_dadwait} in
+	ifn_start:1)
+		sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
+		sleep 1
+	;;
+	esac
+
 	_str=
 	if [ -n "${_ok}" ]; then
 		case ${_func} in

Modified: stable/9/share/man/man5/rc.conf.5
==============================================================================
--- stable/9/share/man/man5/rc.conf.5	Thu Jul 11 23:35:51 2013	(r253226)
+++ stable/9/share/man/man5/rc.conf.5	Fri Jul 12 00:40:49 2013	(r253227)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 22, 2012
+.Dd June 20, 2013
 .Dt RC.CONF 5
 .Os
 .Sh NAME

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

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 00:50:25 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id EEB3D575;
 Fri, 12 Jul 2013 00:50:25 +0000 (UTC)
 (envelope-from scottl@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id E14CA1FC5;
 Fri, 12 Jul 2013 00:50:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C0oPkb085880;
 Fri, 12 Jul 2013 00:50:25 GMT (envelope-from scottl@svn.freebsd.org)
Received: (from scottl@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C0oPpU085879;
 Fri, 12 Jul 2013 00:50:25 GMT (envelope-from scottl@svn.freebsd.org)
Message-Id: <201307120050.r6C0oPpU085879@svn.freebsd.org>
From: Scott Long 
Date: Fri, 12 Jul 2013 00:50:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253228 - head/sys/cam/scsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 00:50:26 -0000

Author: scottl
Date: Fri Jul 12 00:50:25 2013
New Revision: 253228
URL: http://svnweb.freebsd.org/changeset/base/253228

Log:
  Refactor the various delete methods out of dastart().  Cleans up a bunch
  of style and adds more modularity and clarity.
  
  Obtained from:	Netflix
  MFC after:	3 days

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Fri Jul 12 00:40:49 2013	(r253227)
+++ head/sys/cam/scsi/scsi_da.c	Fri Jul 12 00:50:25 2013	(r253228)
@@ -144,6 +144,22 @@ typedef enum {
 	DA_DELETE_MAX = DA_DELETE_ZERO
 } da_delete_methods;
 
+typedef void da_delete_func_t (struct cam_periph *periph, union ccb *ccb,
+			      struct bio *bp);
+static da_delete_func_t da_delete_trim;
+static da_delete_func_t da_delete_unmap;
+static da_delete_func_t da_delete_ws;
+
+static void * da_delete_functions[] = {
+	NULL,
+	NULL,
+	da_delete_trim,
+	da_delete_unmap,
+	da_delete_ws,
+	da_delete_ws,
+	da_delete_ws
+};
+
 static const char *da_delete_method_names[] =
     { "NONE", "DISABLE", "ATA_TRIM", "UNMAP", "WS16", "WS10", "ZERO" };
 static const char *da_delete_method_desc[] =
@@ -198,6 +214,7 @@ struct da_softc {
 	uint32_t		unmap_max_lba;
 	uint64_t		ws_max_blks;
 	da_delete_methods	delete_method;
+	da_delete_func_t	*delete_func;
 	struct	 disk_params params;
 	struct	 disk *disk;
 	union	 ccb saved_ccb;
@@ -1801,6 +1818,10 @@ dadeletemethodset(struct da_softc *softc
 
 	softc->delete_method = delete_method;
 	softc->disk->d_delmaxsize = dadeletemaxsize(softc, delete_method);
+	if (delete_method <= DA_DELETE_MAX)
+		softc->delete_func = da_delete_functions[delete_method];
+	else
+		softc->delete_func = NULL;
 
 	if (softc->delete_method > DA_DELETE_DISABLE)
 		softc->disk->d_flags |= DISKFLAG_CANDELETE;
@@ -2160,7 +2181,7 @@ skipstate:
 	switch (softc->state) {
 	case DA_STATE_NORMAL:
 	{
-		struct bio *bp, *bp1;
+		struct bio *bp;
 		uint8_t tag_code;
 
 		/* Execute immediate CCB if waiting. */
@@ -2180,237 +2201,13 @@ skipstate:
 		/* Run BIO_DELETE if not running yet. */
 		if (!softc->delete_running &&
 		    (bp = bioq_first(&softc->delete_queue)) != NULL) {
-		    uint64_t lba;
-		    uint64_t count; /* forward compat with WS32 */
-
-		    /*
-		     * In each of the methods below, while its the caller's
-		     * responsibility to ensure the request will fit into a
-		     * single device request, we might have changed the delete
-		     * method due to the device incorrectly advertising either
-		     * its supported methods or limits.
-		     * 
-		     * To prevent this causing further issues we validate the
-		     * against the methods limits, and warn which would
-		     * otherwise be unnecessary.
-		     */
-
-		    if (softc->delete_method == DA_DELETE_UNMAP) {
-			uint8_t *buf = softc->unmap_buf;
-			uint64_t lastlba = (uint64_t)-1;
-			uint32_t lastcount = 0, c;
-			uint64_t totalcount = 0;
-			uint32_t off, ranges = 0;
-
-			/*
-			 * Currently this doesn't take the UNMAP
-			 * Granularity and Granularity Alignment
-			 * fields into account.
-			 *
-			 * This could result in both unoptimal unmap
-			 * requests as as well as UNMAP calls unmapping
-			 * fewer LBA's than requested.
-			 */
-
-			softc->delete_running = 1;
-			bzero(softc->unmap_buf, sizeof(softc->unmap_buf));
-			bp1 = bp;
-			do {
-				bioq_remove(&softc->delete_queue, bp1);
-				if (bp1 != bp)
-					bioq_insert_tail(&softc->delete_run_queue, bp1);
-				lba = bp1->bio_pblkno;
-				count = bp1->bio_bcount / softc->params.secsize;
-
-				/* Try to extend the previous range. */
-				if (lba == lastlba) {
-					c = min(count, softc->unmap_max_lba -
-						lastcount);
-					lastcount += c;
-					off = ((ranges - 1) * UNMAP_RANGE_SIZE) +
-					      UNMAP_HEAD_SIZE;
-					scsi_ulto4b(lastcount, &buf[off + 8]);
-					count -= c;
-					lba +=c;
-					totalcount += c;
-				}
-
-				while (count > 0) {
-					c = min(count, softc->unmap_max_lba);
-					if (totalcount + c > softc->unmap_max_lba ||
-					    ranges >= softc->unmap_max_ranges) {
-						xpt_print(periph->path,
-						  "%s issuing short delete %ld > %ld"
-						  "|| %d >= %d",
-						  da_delete_method_desc[softc->delete_method],
-						  totalcount + c, softc->unmap_max_lba,
-						  ranges, softc->unmap_max_ranges);
-						break;
-					}
-					off = (ranges * UNMAP_RANGE_SIZE) +
-					      UNMAP_HEAD_SIZE;
-					scsi_u64to8b(lba, &buf[off + 0]);
-					scsi_ulto4b(c, &buf[off + 8]);
-					lba += c;
-					totalcount += c;
-					ranges++;
-					count -= c;
-					lastcount = c;
-				}
-				lastlba = lba;
-				bp1 = bioq_first(&softc->delete_queue);
-				if (bp1 == NULL ||
-				    ranges >= softc->unmap_max_ranges ||
-				    totalcount + bp1->bio_bcount /
-				     softc->params.secsize > softc->unmap_max_lba)
-					break;
-			} while (1);
-			scsi_ulto2b(ranges * 16 + 6, &buf[0]);
-			scsi_ulto2b(ranges * 16, &buf[2]);
-
-			scsi_unmap(&start_ccb->csio,
-					/*retries*/da_retry_count,
-					/*cbfcnp*/dadone,
-					/*tag_action*/MSG_SIMPLE_Q_TAG,
-					/*byte2*/0,
-					/*data_ptr*/ buf,
-					/*dxfer_len*/ ranges * 16 + 8,
-					/*sense_len*/SSD_FULL_SIZE,
-					da_default_timeout * 1000);
-			start_ccb->ccb_h.ccb_state = DA_CCB_DELETE;
-			goto out;
-		    } else if (softc->delete_method == DA_DELETE_ATA_TRIM) {
-				uint8_t *buf = softc->unmap_buf;
-				uint64_t lastlba = (uint64_t)-1;
-				uint32_t lastcount = 0, c, requestcount;
-				int ranges = 0, off, block_count;
-
-				softc->delete_running = 1;
-				bzero(softc->unmap_buf, sizeof(softc->unmap_buf));
-				bp1 = bp;
-				do {
-					bioq_remove(&softc->delete_queue, bp1);
-					if (bp1 != bp)
-						bioq_insert_tail(&softc->delete_run_queue, bp1);
-					lba = bp1->bio_pblkno;
-					count = bp1->bio_bcount / softc->params.secsize;
-					requestcount = count;
-
-					/* Try to extend the previous range. */
-					if (lba == lastlba) {
-						c = min(count, ATA_DSM_RANGE_MAX - lastcount);
-						lastcount += c;
-						off = (ranges - 1) * 8;
-						buf[off + 6] = lastcount & 0xff;
-						buf[off + 7] = (lastcount >> 8) & 0xff;
-						count -= c;
-						lba += c;
-					}
-
-					while (count > 0) {
-						c = min(count, ATA_DSM_RANGE_MAX);
-						off = ranges * 8;
-
-						buf[off + 0] = lba & 0xff;
-						buf[off + 1] = (lba >> 8) & 0xff;
-						buf[off + 2] = (lba >> 16) & 0xff;
-						buf[off + 3] = (lba >> 24) & 0xff;
-						buf[off + 4] = (lba >> 32) & 0xff;
-						buf[off + 5] = (lba >> 40) & 0xff;
-						buf[off + 6] = c & 0xff;
-						buf[off + 7] = (c >> 8) & 0xff;
-						lba += c;
-						ranges++;
-						count -= c;
-						lastcount = c;
-						if (count != 0 && ranges == softc->trim_max_ranges) {
-							xpt_print(periph->path,
-							  "%s issuing short delete %ld > %ld",
-							  da_delete_method_desc[softc->delete_method],
-							  requestcount,
-							  (softc->trim_max_ranges - ranges) *
-							  ATA_DSM_RANGE_MAX);
-							break;
-						}
-					}
-					lastlba = lba;
-					bp1 = bioq_first(&softc->delete_queue);
-					if (bp1 == NULL ||
-					    bp1->bio_bcount / softc->params.secsize >
-					    (softc->trim_max_ranges - ranges) *
-						    ATA_DSM_RANGE_MAX)
-						break;
-				} while (1);
-
-				block_count = (ranges + ATA_DSM_BLK_RANGES - 1) /
-					      ATA_DSM_BLK_RANGES;
-				scsi_ata_trim(&start_ccb->csio,
-						/*retries*/da_retry_count,
-						/*cbfcnp*/dadone,
-						/*tag_action*/MSG_SIMPLE_Q_TAG,
-						block_count,
-						/*data_ptr*/buf,
-						/*dxfer_len*/block_count * ATA_DSM_BLK_SIZE,
-						/*sense_len*/SSD_FULL_SIZE,
-						da_default_timeout * 1000);
-				start_ccb->ccb_h.ccb_state = DA_CCB_DELETE;
+			if (softc->delete_func != NULL) {
+				softc->delete_func(periph, start_ccb, bp);
 				goto out;
-		    } else if (softc->delete_method == DA_DELETE_ZERO ||
-			       softc->delete_method == DA_DELETE_WS10 ||
-			       softc->delete_method == DA_DELETE_WS16) {
-			/*
-			 * We calculate ws_max_blks here based off d_delmaxsize instead
-			 * of using softc->ws_max_blks as it is absolute max for the
-			 * device not the protocol max which may well be lower
-			 */
-			uint64_t ws_max_blks;
-			ws_max_blks = softc->disk->d_delmaxsize / softc->params.secsize;
-			softc->delete_running = 1;
-			lba = bp->bio_pblkno;
-			count = 0;
-			bp1 = bp;
-			do {
-				bioq_remove(&softc->delete_queue, bp1);
-				if (bp1 != bp)
-					bioq_insert_tail(&softc->delete_run_queue, bp1);
-				count += bp1->bio_bcount / softc->params.secsize;
-				if (count > ws_max_blks) {
-					count = min(count, ws_max_blks);
-					xpt_print(periph->path,
-					  "%s issuing short delete %ld > %ld",
-					  da_delete_method_desc[softc->delete_method],
-					  count, ws_max_blks);
-					break;
-				}
-				bp1 = bioq_first(&softc->delete_queue);
-				if (bp1 == NULL ||
-				    lba + count != bp1->bio_pblkno ||
-				    count + bp1->bio_bcount /
-				     softc->params.secsize > ws_max_blks)
-					break;
-			} while (1);
-
-			scsi_write_same(&start_ccb->csio,
-					/*retries*/da_retry_count,
-					/*cbfcnp*/dadone,
-					/*tag_action*/MSG_SIMPLE_Q_TAG,
-					/*byte2*/softc->delete_method ==
-					    DA_DELETE_ZERO ? 0 : SWS_UNMAP,
-					softc->delete_method ==
-					    DA_DELETE_WS16 ? 16 : 10,
-					/*lba*/lba,
-					/*block_count*/count,
-					/*data_ptr*/ __DECONST(void *,
-					    zero_region),
-					/*dxfer_len*/ softc->params.secsize,
-					/*sense_len*/SSD_FULL_SIZE,
-					da_default_timeout * 1000);
-			start_ccb->ccb_h.ccb_state = DA_CCB_DELETE;
-			goto out;
-		    } else {
-			bioq_flush(&softc->delete_queue, NULL, 0);
-			/* FALLTHROUGH */
-		    }
+			} else {
+				bioq_flush(&softc->delete_queue, NULL, 0);
+				/* FALLTHROUGH */
+			}
 		}
 
 		/* Run regular command. */
@@ -2703,6 +2500,240 @@ out:
 	}
 }
 
+/*
+ * In each of the methods below, while its the caller's
+ * responsibility to ensure the request will fit into a
+ * single device request, we might have changed the delete
+ * method due to the device incorrectly advertising either
+ * its supported methods or limits.
+ * 
+ * To prevent this causing further issues we validate the
+ * against the methods limits, and warn which would
+ * otherwise be unnecessary.
+ */
+static void
+da_delete_unmap(struct cam_periph *periph, union ccb *ccb, struct bio *bp)
+{
+	struct da_softc *softc = (struct da_softc *)periph->softc;;
+	struct bio *bp1;
+	uint8_t *buf = softc->unmap_buf;
+	uint64_t lba, lastlba = (uint64_t)-1;
+	uint64_t totalcount = 0;
+	uint64_t count;
+	uint32_t lastcount = 0, c;
+	uint32_t off, ranges = 0;
+
+	/*
+	 * Currently this doesn't take the UNMAP
+	 * Granularity and Granularity Alignment
+	 * fields into account.
+	 *
+	 * This could result in both unoptimal unmap
+	 * requests as as well as UNMAP calls unmapping
+	 * fewer LBA's than requested.
+	 */
+
+	softc->delete_running = 1;
+	bzero(softc->unmap_buf, sizeof(softc->unmap_buf));
+	bp1 = bp;
+	do {
+		bioq_remove(&softc->delete_queue, bp1);
+		if (bp1 != bp)
+			bioq_insert_tail(&softc->delete_run_queue, bp1);
+		lba = bp1->bio_pblkno;
+		count = bp1->bio_bcount / softc->params.secsize;
+
+		/* Try to extend the previous range. */
+		if (lba == lastlba) {
+			c = min(count, softc->unmap_max_lba - lastcount);
+			lastcount += c;
+			off = ((ranges - 1) * UNMAP_RANGE_SIZE) +
+			      UNMAP_HEAD_SIZE;
+			scsi_ulto4b(lastcount, &buf[off + 8]);
+			count -= c;
+			lba +=c;
+			totalcount += c;
+		}
+
+		while (count > 0) {
+			c = min(count, softc->unmap_max_lba);
+			if (totalcount + c > softc->unmap_max_lba ||
+			    ranges >= softc->unmap_max_ranges) {
+				xpt_print(periph->path,
+				    "%s issuing short delete %ld > %ld"
+				    "|| %d >= %d",
+				    da_delete_method_desc[softc->delete_method],
+				    totalcount + c, softc->unmap_max_lba,
+				    ranges, softc->unmap_max_ranges);
+				break;
+			}
+			off = (ranges * UNMAP_RANGE_SIZE) + UNMAP_HEAD_SIZE;
+			scsi_u64to8b(lba, &buf[off + 0]);
+			scsi_ulto4b(c, &buf[off + 8]);
+			lba += c;
+			totalcount += c;
+			ranges++;
+			count -= c;
+			lastcount = c;
+		}
+		lastlba = lba;
+		bp1 = bioq_first(&softc->delete_queue);
+		if (bp1 == NULL || ranges >= softc->unmap_max_ranges ||
+		    totalcount + bp1->bio_bcount /
+		    softc->params.secsize > softc->unmap_max_lba)
+			break;
+	} while (1);
+	scsi_ulto2b(ranges * 16 + 6, &buf[0]);
+	scsi_ulto2b(ranges * 16, &buf[2]);
+
+	scsi_unmap(&ccb->csio,
+		   /*retries*/da_retry_count,
+		   /*cbfcnp*/dadone,
+		   /*tag_action*/MSG_SIMPLE_Q_TAG,
+		   /*byte2*/0,
+		   /*data_ptr*/ buf,
+		   /*dxfer_len*/ ranges * 16 + 8,
+		   /*sense_len*/SSD_FULL_SIZE,
+		   da_default_timeout * 1000);
+	ccb->ccb_h.ccb_state = DA_CCB_DELETE;
+}
+
+static void
+da_delete_trim(struct cam_periph *periph, union ccb *ccb, struct bio *bp)
+{
+	struct da_softc *softc = (struct da_softc *)periph->softc;
+	struct bio *bp1;
+	uint8_t *buf = softc->unmap_buf;
+	uint64_t lastlba = (uint64_t)-1;
+	uint64_t count;
+	uint64_t lba;
+	uint32_t lastcount = 0, c, requestcount;
+	int ranges = 0, off, block_count;
+
+	softc->delete_running = 1;
+	bzero(softc->unmap_buf, sizeof(softc->unmap_buf));
+	bp1 = bp;
+	do {
+		bioq_remove(&softc->delete_queue, bp1);
+		if (bp1 != bp)
+			bioq_insert_tail(&softc->delete_run_queue, bp1);
+		lba = bp1->bio_pblkno;
+		count = bp1->bio_bcount / softc->params.secsize;
+		requestcount = count;
+
+		/* Try to extend the previous range. */
+		if (lba == lastlba) {
+			c = min(count, ATA_DSM_RANGE_MAX - lastcount);
+			lastcount += c;
+			off = (ranges - 1) * 8;
+			buf[off + 6] = lastcount & 0xff;
+			buf[off + 7] = (lastcount >> 8) & 0xff;
+			count -= c;
+			lba += c;
+		}
+
+		while (count > 0) {
+			c = min(count, ATA_DSM_RANGE_MAX);
+			off = ranges * 8;
+
+			buf[off + 0] = lba & 0xff;
+			buf[off + 1] = (lba >> 8) & 0xff;
+			buf[off + 2] = (lba >> 16) & 0xff;
+			buf[off + 3] = (lba >> 24) & 0xff;
+			buf[off + 4] = (lba >> 32) & 0xff;
+			buf[off + 5] = (lba >> 40) & 0xff;
+			buf[off + 6] = c & 0xff;
+			buf[off + 7] = (c >> 8) & 0xff;
+			lba += c;
+			ranges++;
+			count -= c;
+			lastcount = c;
+			if (count != 0 && ranges == softc->trim_max_ranges) {
+				xpt_print(periph->path,
+				    "%s issuing short delete %ld > %ld",
+				    da_delete_method_desc[softc->delete_method],
+				    requestcount,
+				    (softc->trim_max_ranges - ranges) *
+				    ATA_DSM_RANGE_MAX);
+				break;
+			}
+		}
+		lastlba = lba;
+		bp1 = bioq_first(&softc->delete_queue);
+		if (bp1 == NULL || bp1->bio_bcount / softc->params.secsize >
+		    (softc->trim_max_ranges - ranges) * ATA_DSM_RANGE_MAX)
+			break;
+	} while (1);
+
+	block_count = (ranges + ATA_DSM_BLK_RANGES - 1) / ATA_DSM_BLK_RANGES;
+	scsi_ata_trim(&ccb->csio,
+		      /*retries*/da_retry_count,
+		      /*cbfcnp*/dadone,
+		      /*tag_action*/MSG_SIMPLE_Q_TAG,
+		      block_count,
+		      /*data_ptr*/buf,
+		      /*dxfer_len*/block_count * ATA_DSM_BLK_SIZE,
+		      /*sense_len*/SSD_FULL_SIZE,
+		      da_default_timeout * 1000);
+	ccb->ccb_h.ccb_state = DA_CCB_DELETE;
+}
+
+/*
+ * We calculate ws_max_blks here based off d_delmaxsize instead
+ * of using softc->ws_max_blks as it is absolute max for the
+ * device not the protocol max which may well be lower
+ */
+static void
+da_delete_ws(struct cam_periph *periph, union ccb *ccb, struct bio *bp)
+{
+	struct da_softc *softc;
+	struct bio *bp1;
+	uint64_t ws_max_blks;
+	uint64_t lba;
+	uint64_t count; /* forward compat with WS32 */
+
+	softc = (struct da_softc *)periph->softc;
+	ws_max_blks = softc->disk->d_delmaxsize / softc->params.secsize;
+	softc->delete_running = 1;
+	lba = bp->bio_pblkno;
+	count = 0;
+	bp1 = bp;
+	do {
+		bioq_remove(&softc->delete_queue, bp1);
+		if (bp1 != bp)
+			bioq_insert_tail(&softc->delete_run_queue, bp1);
+		count += bp1->bio_bcount / softc->params.secsize;
+		if (count > ws_max_blks) {
+			count = min(count, ws_max_blks);
+			xpt_print(periph->path,
+			    "%s issuing short delete %ld > %ld",
+			    da_delete_method_desc[softc->delete_method],
+			    count, ws_max_blks);
+			break;
+		}
+		bp1 = bioq_first(&softc->delete_queue);
+		if (bp1 == NULL || lba + count != bp1->bio_pblkno ||
+		    count + bp1->bio_bcount /
+		    softc->params.secsize > ws_max_blks)
+			break;
+	} while (1);
+
+	scsi_write_same(&ccb->csio,
+			/*retries*/da_retry_count,
+			/*cbfcnp*/dadone,
+			/*tag_action*/MSG_SIMPLE_Q_TAG,
+			/*byte2*/softc->delete_method ==
+			    DA_DELETE_ZERO ? 0 : SWS_UNMAP,
+			softc->delete_method == DA_DELETE_WS16 ? 16 : 10,
+			/*lba*/lba,
+			/*block_count*/count,
+			/*data_ptr*/ __DECONST(void *, zero_region),
+			/*dxfer_len*/ softc->params.secsize,
+			/*sense_len*/SSD_FULL_SIZE,
+			da_default_timeout * 1000);
+	ccb->ccb_h.ccb_state = DA_CCB_DELETE;
+}
+
 static int
 cmd6workaround(union ccb *ccb)
 {

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 00:59:04 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 0D3E7715;
 Fri, 12 Jul 2013 00:59:04 +0000 (UTC)
 (envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id D9F3B1FF6;
 Fri, 12 Jul 2013 00:59:03 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C0x302088327;
 Fri, 12 Jul 2013 00:59:03 GMT
 (envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C0x39m088326;
 Fri, 12 Jul 2013 00:59:03 GMT
 (envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201307120059.r6C0x39m088326@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 12 Jul 2013 00:59:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253229 - stable/8/sys/nfsclient
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 00:59:04 -0000

Author: rmacklem
Date: Fri Jul 12 00:59:03 2013
New Revision: 253229
URL: http://svnweb.freebsd.org/changeset/base/253229

Log:
  MFC: r252673
  A problem with the old NFS client where large writes to large files
  would sometimes result in a corrupted file was reported via email.
  This problem appears to have been caused by r251719 (reverting
  r251719 fixed the problem). Although I have not been able to
  reproduce this problem, I suspect it is caused by another thread
  increasing np->n_size after the mtx_unlock(&np->n_mtx) but before
  the vnode_pager_setsize() call. Since the np->n_mtx mutex serializes
  updates to np->n_size, doing the vnode_pager_setsize() with the
  mutex locked appears to avoid the problem.
  Unfortunately, vnode_pager_setsize() where the new size is smaller,
  cannot be called with a mutex held.
  This patch returns the semantics to be close to pre-r251719 such that the
  call to the vnode_pager_setsize() is only delayed until after the mutex is
  unlocked when np->n_size is shrinking. Since the file is growing
  when being written, I believe this will fix the corruption.
  
  Tested by:	remy.nonnenmacher@activnetworks.com

Modified:
  stable/8/sys/nfsclient/nfs_subs.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/nfsclient/   (props changed)

Modified: stable/8/sys/nfsclient/nfs_subs.c
==============================================================================
--- stable/8/sys/nfsclient/nfs_subs.c	Fri Jul 12 00:50:25 2013	(r253228)
+++ stable/8/sys/nfsclient/nfs_subs.c	Fri Jul 12 00:59:03 2013	(r253229)
@@ -595,6 +595,7 @@ nfs_loadattrcache(struct vnode **vpp, st
 				vap->va_size = np->n_size;
 				np->n_attrstamp = 0;
 				KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp);
+				vnode_pager_setsize(vp, np->n_size);
 			} else if (np->n_flag & NMODIFIED) {
 				/*
 				 * We've modified the file: Use the larger
@@ -606,12 +607,22 @@ nfs_loadattrcache(struct vnode **vpp, st
 					np->n_size = vap->va_size;
 					np->n_flag |= NSIZECHANGED;
 				}
+				vnode_pager_setsize(vp, np->n_size);
+			} else if (vap->va_size < np->n_size) {
+				/*
+				 * When shrinking the size, the call to
+				 * vnode_pager_setsize() cannot be done
+				 * with the mutex held, so delay it until
+				 * after the mtx_unlock call.
+				 */
+				nsize = np->n_size = vap->va_size;
+				np->n_flag |= NSIZECHANGED;
+				setnsize = 1;
 			} else {
 				np->n_size = vap->va_size;
 				np->n_flag |= NSIZECHANGED;
+				vnode_pager_setsize(vp, np->n_size);
 			}
-			setnsize = 1;
-			nsize = vap->va_size;
 		} else {
 			np->n_size = vap->va_size;
 		}

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 01:06:08 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 9B5E98A7;
 Fri, 12 Jul 2013 01:06:08 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8D78C1035;
 Fri, 12 Jul 2013 01:06:08 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C168mw091225;
 Fri, 12 Jul 2013 01:06:08 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C168EJ091224;
 Fri, 12 Jul 2013 01:06:08 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120106.r6C168EJ091224@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 01:06:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253230 - stable/9/usr.sbin/ifmcstat
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 01:06:08 -0000

Author: hrs
Date: Fri Jul 12 01:06:08 2013
New Revision: 253230
URL: http://svnweb.freebsd.org/changeset/base/253230

Log:
  MFC 243441:
  
  Support a flag for ALLOW/BLOCK in source-specific multicast (RFC 4604).

Modified:
  stable/9/usr.sbin/ifmcstat/ifmcstat.c
Directory Properties:
  stable/9/usr.sbin/ifmcstat/   (props changed)

Modified: stable/9/usr.sbin/ifmcstat/ifmcstat.c
==============================================================================
--- stable/9/usr.sbin/ifmcstat/ifmcstat.c	Fri Jul 12 00:59:03 2013	(r253229)
+++ stable/9/usr.sbin/ifmcstat/ifmcstat.c	Fri Jul 12 01:06:08 2013	(r253230)
@@ -751,7 +751,7 @@ in6_ifinfo(struct mld_ifinfo *mli)
 		printf("mldv?(%d)", mli->mli_version);
 		break;
 	}
-	printb(" flags", mli->mli_flags, "\020\1SILENT");
+	printb(" flags", mli->mli_flags, "\020\1SILENT\2USEALLOW");
 	if (mli->mli_version == MLD_VERSION_2) {
 		printf(" rv %u qi %u qri %u uri %u",
 		    mli->mli_rv, mli->mli_qi, mli->mli_qri, mli->mli_uri);

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 01:08:13 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 5A99D9E7;
 Fri, 12 Jul 2013 01:08:13 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 4C0451041;
 Fri, 12 Jul 2013 01:08:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C18DPs091607;
 Fri, 12 Jul 2013 01:08:13 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C18Dhi091606;
 Fri, 12 Jul 2013 01:08:13 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120108.r6C18Dhi091606@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 01:08:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253231 - stable/9/etc
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 01:08:13 -0000

Author: hrs
Date: Fri Jul 12 01:08:12 2013
New Revision: 253231
URL: http://svnweb.freebsd.org/changeset/base/253231

Log:
  MFC 243324:
  
  Do not put "already running" message when rc_quiet=yes.
  
  PR:	bin/165477

Modified:
  stable/9/etc/rc.subr
Directory Properties:
  stable/9/etc/   (props changed)

Modified: stable/9/etc/rc.subr
==============================================================================
--- stable/9/etc/rc.subr	Fri Jul 12 01:06:08 2013	(r253230)
+++ stable/9/etc/rc.subr	Fri Jul 12 01:08:12 2013	(r253231)
@@ -742,7 +742,10 @@ run_rc_command()
 
 		start)
 			if [ -z "$rc_fast" -a -n "$rc_pid" ]; then
-				echo 1>&2 "${name} already running? (pid=$rc_pid)."
+				if [ -z "$rc_quiet" ]; then
+					echo 1>&2 "${name} already running? " \
+					    "(pid=$rc_pid)."
+				fi
 				return 1
 			fi
 

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 01:12:28 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id BD52DB5D;
 Fri, 12 Jul 2013 01:12:28 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id ADC7A1066;
 Fri, 12 Jul 2013 01:12:28 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C1CSVv094033;
 Fri, 12 Jul 2013 01:12:28 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C1CSgL094032;
 Fri, 12 Jul 2013 01:12:28 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120112.r6C1CSgL094032@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 01:12:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253232 - stable/9/etc/rc.d
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 01:12:28 -0000

Author: hrs
Date: Fri Jul 12 01:12:28 2013
New Revision: 253232
URL: http://svnweb.freebsd.org/changeset/base/253232

Log:
  MFC 242301:
  
  Load ipdivert.ko when natd_enable=YES.
  
  PR:	conf/167566

Modified:
  stable/9/etc/rc.d/ipfw
Directory Properties:
  stable/9/etc/rc.d/   (props changed)

Modified: stable/9/etc/rc.d/ipfw
==============================================================================
--- stable/9/etc/rc.d/ipfw	Fri Jul 12 01:08:12 2013	(r253231)
+++ stable/9/etc/rc.d/ipfw	Fri Jul 12 01:12:28 2013	(r253232)
@@ -25,11 +25,11 @@ ipfw_prestart()
 	if checkyesno dummynet_enable; then
 		required_modules="$required_modules dummynet"
 	fi
-
+	if checkyesno natd_enable; then
+		required_modules="$required_modules ipdivert"
+	fi
 	if checkyesno firewall_nat_enable; then
-		if ! checkyesno natd_enable; then
-			required_modules="$required_modules ipfw_nat"
-		fi
+		required_modules="$required_modules ipfw_nat"
 	fi
 }
 

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 01:16:20 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 5903ACBE;
 Fri, 12 Jul 2013 01:16:20 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 30292107F;
 Fri, 12 Jul 2013 01:16:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C1GKsa094698;
 Fri, 12 Jul 2013 01:16:20 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C1GJio094696;
 Fri, 12 Jul 2013 01:16:19 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120116.r6C1GJio094696@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 01:16:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253233 - in stable/9: etc share/man/man5
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 01:16:20 -0000

Author: hrs
Date: Fri Jul 12 01:16:19 2013
New Revision: 253233
URL: http://svnweb.freebsd.org/changeset/base/253233

Log:
  MFC 242184:
  
  Add setfib(1) support for services as _fib in rc.conf.

Modified:
  stable/9/etc/rc.subr
  stable/9/share/man/man5/rc.conf.5
Directory Properties:
  stable/9/etc/   (props changed)
  stable/9/share/man/man5/   (props changed)

Modified: stable/9/etc/rc.subr
==============================================================================
--- stable/9/etc/rc.subr	Fri Jul 12 01:12:28 2013	(r253232)
+++ stable/9/etc/rc.subr	Fri Jul 12 01:16:19 2013	(r253233)
@@ -503,6 +503,8 @@ check_startmsgs()
 #				NOTE:	$flags from the parent environment
 #					can be used to override this.
 #
+#	${name}_fib	n	Routing table number to run ${command} with.
+#
 #	${name}_nice	n	Nice level to run ${command} at.
 #
 #	${name}_user	n	User to run ${command} as, using su(1) if not
@@ -681,7 +683,8 @@ run_rc_command()
 	fi
 	eval _chdir=\$${name}_chdir	_chroot=\$${name}_chroot \
 	    _nice=\$${name}_nice	_user=\$${name}_user \
-	    _group=\$${name}_group	_groups=\$${name}_groups
+	    _group=\$${name}_group	_groups=\$${name}_groups \
+	    _fib=\$${name}_fib
 
 	if [ -n "$_user" ]; then	# unset $_user if running as that user
 		if [ "$_user" = "$(eval $IDCMD)" ]; then
@@ -765,11 +768,13 @@ run_rc_command()
 			if [ -n "$_chroot" ]; then
 				_doit="\
 ${_nice:+nice -n $_nice }\
+${_fib:+setfib -F $_fib }\
 chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\
 $_chroot $command $rc_flags $command_args"
 			else
 				_doit="\
 ${_chdir:+cd $_chdir && }\
+${_fib:+setfib -F $_fib }\
 $command $rc_flags $command_args"
 				if [ -n "$_user" ]; then
 				    _doit="su -m $_user -c 'sh -c \"$_doit\"'"

Modified: stable/9/share/man/man5/rc.conf.5
==============================================================================
--- stable/9/share/man/man5/rc.conf.5	Fri Jul 12 01:12:28 2013	(r253232)
+++ stable/9/share/man/man5/rc.conf.5	Fri Jul 12 01:16:19 2013	(r253233)
@@ -168,6 +168,27 @@ If set to
 .Dq Li NO ,
 no swapfile is installed, otherwise the value is used as the full
 pathname to a file to use for additional swap space.
+.It Ao Ar name Ac Ns Va _chroot
+.Pq Vt str
+.Xr chroot
+to this directory before running the service.
+.It Ao Ar name Ac Ns Va _user
+.Pq Vt str
+Run the service under this user account.
+.It Ao Ar name Ac Ns Va _group
+.Pq Vt str
+Run the chrooted service under this system group. Unlike the _user
+setting, this setting has no effect if the service is not chrooted.
+.It Ao Ar name Ac Ns Va _fib
+.Pq Vt int
+The
+.Xr setfib 1
+value to run the service under.
+.It Ao Ar name Ac Ns Va _nice
+.Pq Vt int
+The
+.Xr nice 1
+value to run the service under.
 .It Va apm_enable
 .Pq Vt bool
 If set to

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 01:23:42 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 1E201EE6;
 Fri, 12 Jul 2013 01:23:42 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 0F90210BA;
 Fri, 12 Jul 2013 01:23:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C1NgrU097361;
 Fri, 12 Jul 2013 01:23:42 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C1NfTV097357;
 Fri, 12 Jul 2013 01:23:41 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120123.r6C1NfTV097357@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 01:23:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253234 - in stable/9: etc/rc.d sbin/route
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 01:23:42 -0000

Author: hrs
Date: Fri Jul 12 01:23:41 2013
New Revision: 253234
URL: http://svnweb.freebsd.org/changeset/base/253234

Log:
  MFC 243185, 243188, 243212:
  
  Add -fib modifier to specify FIB number.  The FIB number can be in a
  comma-separated list and/or range specification:
  
   # route add -inet 192.0.2.0/24 198.51.100.1 -fib 1,3-5,6
  
  Although all of the subcommands supports the modifier, "monitor" does not
  support the list or range specification at this moment.

Modified:
  stable/9/etc/rc.d/routing
  stable/9/sbin/route/keywords
  stable/9/sbin/route/route.8
  stable/9/sbin/route/route.c
Directory Properties:
  stable/9/etc/rc.d/   (props changed)
  stable/9/sbin/route/   (props changed)

Modified: stable/9/etc/rc.d/routing
==============================================================================
--- stable/9/etc/rc.d/routing	Fri Jul 12 01:16:19 2013	(r253233)
+++ stable/9/etc/rc.d/routing	Fri Jul 12 01:23:41 2013	(r253234)
@@ -137,29 +137,20 @@ static_inet()
 
 static_inet6()
 {
-	local _action i fibs
+	local _action fibmod fibs
 	_action=$1
 
 	# get the number of FIBs supported.
-	fibs=`sysctl -n net.fibs`
-	: ${fibs:=1}
+	fibs=$((`${SYSCTL_N} net.fibs` - 1))
+	if [ "$fibs" -gt 0 ]; then
+		fibmod="-fib 0-$fibs"
+	else
+		fibmod=
+	fi
 
 	# 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=1
-	if test ${i} -lt ${fibs}; then
-		printf "Also installing reject routes for FIBs"
-		while test ${i} -lt ${fibs}; do
-			setfib -F ${i} route -q ${_action} \
-			    -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject
-			setfib -F ${i} route -q ${_action} \
-			    -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject
-			printf " %d" ${i}
-			i=$((i + 1))
-		done
-		printf "\n"
-	fi
+	route ${_action} -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject ${fibmod}
+	route ${_action} -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject ${fibmod}
 
 	case ${ipv6_defaultrouter} in
 	[Nn][Oo] | '')
@@ -231,21 +222,8 @@ 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=1
-	if test ${i} -lt ${fibs}; then
-		printf "Also installing reject routes for FIBs"
-		while test ${i} -lt ${fibs}; do
-			setfib -F ${i} route -q ${_action} \
-			    -inet6 fe80:: -prefixlen 10 ::1 -reject
-			setfib -F ${i} route -q ${_action} \
-			    -inet6 ff02:: -prefixlen 16 ::1 -reject
-			printf " %d" ${i}
-			i=$((i + 1))
-		done
-		printf "\n"
-	fi
+	route ${_action} -inet6 fe80:: -prefixlen 10 ::1 -reject ${fibmod}
+	route ${_action} -inet6 ff02:: -prefixlen 16 ::1 -reject ${fibmod}
 
 	case ${ipv6_default_interface} in
 	'')

Modified: stable/9/sbin/route/keywords
==============================================================================
--- stable/9/sbin/route/keywords	Fri Jul 12 01:16:19 2013	(r253233)
+++ stable/9/sbin/route/keywords	Fri Jul 12 01:23:41 2013	(r253234)
@@ -10,6 +10,7 @@ del
 delete
 dst
 expire
+fib
 flush
 gateway
 genmask

Modified: stable/9/sbin/route/route.8
==============================================================================
--- stable/9/sbin/route/route.8	Fri Jul 12 01:16:19 2013	(r253233)
+++ stable/9/sbin/route/route.8	Fri Jul 12 01:23:41 2013	(r253234)
@@ -28,7 +28,7 @@
 .\"     @(#)route.8	8.3 (Berkeley) 3/19/94
 .\" $FreeBSD$
 .\"
-.Dd October 2, 2005
+.Dd November 17, 2012
 .Dt ROUTE 8
 .Os
 .Sh NAME
@@ -114,16 +114,14 @@ The monitor command has the syntax:
 .Bd -ragged -offset indent -compact
 .Nm
 .Op Fl n
-.Cm monitor
+.Cm monitor Op Fl fib Ar number
 .Ed
 .Pp
 The flush command has the syntax:
 .Pp
 .Bd -ragged -offset indent -compact
 .Nm
-.Op Fl n
-.Cm flush
-.Op Ar family
+.Oo Fl n Cm flush Oc Oo Ar family Oc Op Fl fib Ar number
 .Ed
 .Pp
 If the
@@ -140,6 +138,11 @@ or
 .Fl inet
 modifiers, only routes having destinations with addresses in the
 delineated family will be deleted.
+When a
+.Fl fib
+option is specified, the operation will be applied to
+the specified FIB
+.Pq routing table .
 .Pp
 The other commands have the following syntax:
 .Pp
@@ -150,6 +153,7 @@ The other commands have the following sy
 .Op Fl net No \&| Fl host
 .Ar destination gateway
 .Op Ar netmask
+.Op Fl fib Ar number
 .Ed
 .Pp
 where
@@ -206,9 +210,15 @@ A
 .Ar destination
 of
 .Ar default
-is a synonym for
-.Fl net Li 0.0.0.0 ,
-which is the default route.
+is a synonym for the default route.
+For
+.Li IPv4
+it is
+.Fl net Fl inet Li 0.0.0.0 ,
+and for
+.Li IPv6
+it is
+.Fl net Fl inet6 Li :: .
 .Pp
 If the destination is directly reachable
 via an interface requiring
@@ -310,6 +320,33 @@ specify that all ensuing metrics may be 
 .Fl lockrest
 meta-modifier.
 .Pp
+The optional modifier
+.Fl fib Ar number
+specifies that the command will be applied to a non-default FIB.
+The
+.Ar number
+must be smaller than the
+.Va net.fibs
+.Xr sysctl 8
+MIB.
+When this modifier is not specified,
+or a negative number is specified,
+the default FIB shown in the
+.Va net.my_fibnum
+.Xr sysctl 8
+MIB will be used.
+.Pp
+The
+.Ar number
+allows multiple FIBs by a comma-separeted list and/or range
+specification.
+The
+.Qq Fl fib Li 2,4,6
+means the FIB number 2, 4, and 6.
+The
+.Qq Fl fib Li 1,3-5,6
+means the 1, 3, 4, 5, and 6.
+.Pp
 In a
 .Cm change
 or

Modified: stable/9/sbin/route/route.c
==============================================================================
--- stable/9/sbin/route/route.c	Fri Jul 12 01:16:19 2013	(r253233)
+++ stable/9/sbin/route/route.c	Fri Jul 12 01:23:41 2013	(r253234)
@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -77,7 +78,6 @@ struct keytab {
 	{0, 0}
 };
 
-struct	ortentry route;
 union	sockunion {
 	struct	sockaddr sa;
 	struct	sockaddr_in sin;
@@ -99,11 +99,14 @@ int	locking, lockrest, debugonly;
 struct	rt_metrics rt_metrics;
 u_long  rtm_inits;
 uid_t	uid;
+static int	defaultfib;
+static int	numfibs;
 
 static int	atalk_aton(const char *, struct at_addr *);
 static char	*atalk_ntoa(struct at_addr);
 static void	bprintf(FILE *, int, u_char *);
 static void	flushroutes(int argc, char *argv[]);
+static int	flushroutes_fib(int);
 static int	getaddr(int, char *, struct hostent **);
 static int	keyword(const char *);
 static void	inet_makenetandmask(u_long, struct sockaddr_in *, u_long);
@@ -112,21 +115,36 @@ static int inet6_makenetandmask(struct s
 #endif
 static void	interfaces(void);
 static void	mask_addr(void);
-static void	monitor(void);
+static void	monitor(int, char*[]);
 static const char	*netname(struct sockaddr *);
 static void	newroute(int, char **);
+static int	newroute_fib(int, char *, int);
 static void	pmsg_addrs(char *, int, size_t);
 static void	pmsg_common(struct rt_msghdr *, size_t);
 static int	prefixlen(const char *);
-static void	print_getmsg(struct rt_msghdr *, int);
+static void	print_getmsg(struct rt_msghdr *, int, int);
 static void	print_rtmsg(struct rt_msghdr *, size_t);
 static const char	*routename(struct sockaddr *);
-static int	rtmsg(int, int);
+static int	rtmsg(int, int, int);
 static void	set_metric(char *, int);
+static int	set_sofib(int);
+static int	set_procfib(int);
 static void	sockaddr(char *, struct sockaddr *);
 static void	sodump(sup, const char *);
 extern	char *iso_ntoa(void);
 
+struct fibl {
+	TAILQ_ENTRY(fibl)	fl_next;
+
+	int	fl_num;
+	int	fl_error;
+	int	fl_errno;
+};
+TAILQ_HEAD(fibl_head_t, fibl) fibl_head;
+
+static int	fiboptlist_csv(const char *, struct fibl_head_t *);
+static int	fiboptlist_range(const char *, struct fibl_head_t *);
+
 static void usage(const char *) __dead2;
 
 void
@@ -144,6 +162,7 @@ int
 main(int argc, char **argv)
 {
 	int ch;
+	size_t len;
 
 	if (argc < 2)
 		usage(NULL);
@@ -180,6 +199,17 @@ main(int argc, char **argv)
 		s = socket(PF_ROUTE, SOCK_RAW, 0);
 	if (s < 0)
 		err(EX_OSERR, "socket");
+
+	len = sizeof(numfibs);
+	if (sysctlbyname("net.fibs", (void *)&numfibs, &len, NULL, 0) == -1)
+		numfibs = -1;
+
+	len = sizeof(defaultfib);
+	if (numfibs != -1 &&
+	    sysctlbyname("net.my_fibnum", (void *)&defaultfib, &len, NULL,
+		0) == -1)
+		defaultfib = -1;
+
 	if (*argv != NULL)
 		switch (keyword(*argv)) {
 		case K_GET:
@@ -195,7 +225,7 @@ main(int argc, char **argv)
 			/* NOTREACHED */
 
 		case K_MONITOR:
-			monitor();
+			monitor(argc, argv);
 			/* NOTREACHED */
 
 		case K_FLUSH:
@@ -207,6 +237,124 @@ main(int argc, char **argv)
 	/* NOTREACHED */
 }
 
+static int
+set_sofib(int fib)
+{
+
+	if (fib < 0)
+		return (0);
+	return (setsockopt(s, SOL_SOCKET, SO_SETFIB, (void *)&fib,
+	    sizeof(fib)));
+}
+
+static int
+set_procfib(int fib)
+{
+	
+	if (fib < 0)
+		return (0);
+	return (setfib(fib));
+}
+
+static int
+fiboptlist_range(const char *arg, struct fibl_head_t *flh)
+{
+	struct fibl *fl;
+	char *str, *token, *endptr;
+	int fib[2], i, error;
+
+	str = strdup(arg);
+	error = 0;
+	i = 0;
+	while ((token = strsep(&str, "-")) != NULL) {
+		switch (i) {
+		case 0:
+		case 1:
+			fib[i] = strtol(token, &endptr, 0);
+			if (*endptr != '\0' || (fib[i] == 0 &&
+			    (errno == EINVAL || errno == ERANGE)))
+				error = 1;
+			break;
+		default:
+			error = 1;
+		}
+		if (error)
+			goto fiboptlist_range_ret;
+		i++;
+	}
+	if (fib[0] >= fib[1]) {
+		error = 1;
+		goto fiboptlist_range_ret;
+	}
+	for (i = fib[0]; i <= fib[1]; i++) {
+		fl = calloc(1, sizeof(*fl));
+		if (fl == NULL) {
+			error = 1;
+			goto fiboptlist_range_ret;
+		}
+		fl->fl_num = i;
+		TAILQ_INSERT_TAIL(flh, fl, fl_next);
+	}
+fiboptlist_range_ret:
+	free(str);
+	return (error);
+}
+
+#define	ALLSTRLEN	64
+static int
+fiboptlist_csv(const char *arg, struct fibl_head_t *flh)
+{
+	struct fibl *fl;
+	char *str, *token, *endptr;
+	int fib, error;
+
+	if (strcmp("all", arg) == 0) {
+		str = calloc(1, ALLSTRLEN);
+		if (str == NULL) {
+			error = 1;
+			goto fiboptlist_csv_ret;
+		}
+		if (numfibs > 1)
+			snprintf(str, ALLSTRLEN - 1, "%d-%d", 0, numfibs - 1);
+		else
+			snprintf(str, ALLSTRLEN - 1, "%d", 0);
+	} else if (strcmp("default", arg) == 0) {
+		str = calloc(1, ALLSTRLEN);
+		if (str == NULL) {
+			error = 1;
+			goto fiboptlist_csv_ret;
+		}
+		snprintf(str, ALLSTRLEN - 1, "%d", defaultfib);
+	} else
+		str = strdup(arg);
+
+	error = 0;
+	while ((token = strsep(&str, ",")) != NULL) {
+		if (*token != '-' && strchr(token, '-') != NULL) {
+			error = fiboptlist_range(token, flh);
+			if (error)
+				goto fiboptlist_csv_ret;
+		} else {
+			fib = strtol(token, &endptr, 0);
+			if (*endptr != '\0' || (fib == 0 &&
+			    (errno == EINVAL || errno == ERANGE))) {
+				error = 1;
+				goto fiboptlist_csv_ret;
+			}
+			fl = calloc(1, sizeof(*fl));
+			if (fl == NULL) {
+				error = 1;
+				goto fiboptlist_csv_ret;
+			}
+			fl->fl_num = fib;
+			TAILQ_INSERT_TAIL(flh, fl, fl_next);
+		}
+	}
+fiboptlist_csv_ret:
+	free(str);
+	return (error);
+}
+
 /*
  * Purge all entries in the routing tables not
  * associated with network interfaces.
@@ -214,38 +362,71 @@ main(int argc, char **argv)
 static void
 flushroutes(int argc, char *argv[])
 {
-	size_t needed;
-	int mib[6], rlen, seqno, count = 0;
-	char *buf, *next, *lim;
-	struct rt_msghdr *rtm;
+	struct fibl *fl;
+	int error;
 
 	if (uid != 0 && !debugonly) {
 		errx(EX_NOPERM, "must be root to alter routing table");
 	}
 	shutdown(s, SHUT_RD); /* Don't want to read back our messages */
-	if (argc > 1) {
+
+	TAILQ_INIT(&fibl_head);
+	while (argc > 1) {
+		argc--;
 		argv++;
-		if (argc == 2 && **argv == '-')
-		    switch (keyword(*argv + 1)) {
-			case K_INET:
-				af = AF_INET;
-				break;
+		if (**argv != '-')
+			usage(*argv);
+		switch (keyword(*argv + 1)) {
+		case K_INET:
+			af = AF_INET;
+			break;
 #ifdef INET6
-			case K_INET6:
-				af = AF_INET6;
-				break;
+		case K_INET6:
+			af = AF_INET6;
+			break;
 #endif
-			case K_ATALK:
-				af = AF_APPLETALK;
-				break;
-			case K_LINK:
-				af = AF_LINK;
-				break;
-			default:
-				goto bad;
-		} else
-bad:			usage(*argv);
+		case K_ATALK:
+			af = AF_APPLETALK;
+			break;
+		case K_LINK:
+			af = AF_LINK;
+			break;
+		case K_FIB:
+			if (!--argc)
+				usage(*argv);
+			error = fiboptlist_csv(*++argv, &fibl_head);
+			if (error)
+				usage(*argv);
+			break;
+		default:
+			usage(*argv);
+		}
 	}
+	if (TAILQ_EMPTY(&fibl_head)) {
+		error = fiboptlist_csv("default", &fibl_head);
+		if (error)
+			errx(EX_OSERR, "fiboptlist_csv failed.");
+	}
+	TAILQ_FOREACH(fl, &fibl_head, fl_next)
+		flushroutes_fib(fl->fl_num);
+}
+
+static int
+flushroutes_fib(int fib)
+{
+	struct rt_msghdr *rtm;
+	size_t needed;
+	char *buf, *next, *lim;
+	int mib[6], rlen, seqno, count = 0;
+	int error;
+
+	error = set_sofib(fib);
+	error += set_procfib(fib);
+	if (error) {
+		warn("fib number %d is ignored", fib);
+		return (error);
+	}
+
 retry:
 	mib[0] = CTL_NET;
 	mib[1] = PF_ROUTE;
@@ -303,13 +484,17 @@ retry:
 			print_rtmsg(rtm, rlen);
 		else {
 			struct sockaddr *sa = (struct sockaddr *)(rtm + 1);
-			(void) printf("%-20.20s ", rtm->rtm_flags & RTF_HOST ?
+
+			printf("%-20.20s ", rtm->rtm_flags & RTF_HOST ?
 			    routename(sa) : netname(sa));
 			sa = (struct sockaddr *)(SA_SIZE(sa) + (char *)sa);
-			(void) printf("%-20.20s ", routename(sa));
-			(void) printf("done\n");
+			printf("%-20.20s ", routename(sa));
+			if (fib >= 0)
+				printf("-fib %-3d ", fib);
+			printf("done\n");
 		}
 	}
+	return (error);
 }
 
 const char *
@@ -573,18 +758,32 @@ set_metric(char *value, int key)
 	*valp = atoi(value);
 }
 
+#define	F_ISHOST	0x01
+#define	F_FORCENET	0x02
+#define	F_FORCEHOST	0x04
+#define	F_PROXY		0x08
+#define	F_INTERFACE	0x10
+
 static void
 newroute(int argc, char **argv)
 {
+	struct hostent *hp;
+	struct fibl *fl;
 	char *cmd;
-	const char *dest = "", *gateway = "", *errmsg;
-	int ishost = 0, proxy = 0, ret, attempts, oerrno, flags = RTF_STATIC;
-	int key;
-	struct hostent *hp = 0;
+	const char *dest, *gateway, *errmsg;
+	int key, error, flags, nrflags, fibnum;
 
 	if (uid != 0) {
 		errx(EX_NOPERM, "must be root to alter routing table");
 	}
+
+	dest = NULL;
+	gateway = NULL;
+	flags = RTF_STATIC;
+	nrflags = 0;
+	hp = NULL;
+	TAILQ_INIT(&fibl_head);
+
 	cmd = argv[0];
 	if (*cmd != 'g' && *cmd != 's')
 		shutdown(s, SHUT_RD); /* Don't want to read back our messages */
@@ -616,7 +815,7 @@ newroute(int argc, char **argv)
 				break;
 			case K_IFACE:
 			case K_INTERFACE:
-				iflag++;
+				nrflags |= F_INTERFACE;
 				break;
 			case K_NOSTATIC:
 				flags &= ~RTF_STATIC;
@@ -628,7 +827,7 @@ newroute(int argc, char **argv)
 				lockrest = 1;
 				break;
 			case K_HOST:
-				forcehost++;
+				nrflags |= F_FORCEHOST;
 				break;
 			case K_REJECT:
 				flags |= RTF_REJECT;
@@ -643,7 +842,7 @@ newroute(int argc, char **argv)
 				flags |= RTF_PROTO2;
 				break;
 			case K_PROXY:
-				proxy = 1;
+				nrflags |= F_PROXY;
 				break;
 			case K_XRESOLVE:
 				flags |= RTF_XRESOLVE;
@@ -657,6 +856,13 @@ newroute(int argc, char **argv)
 			case K_NOSTICK:
 				flags &= ~RTF_STICKY;
 				break;
+			case K_FIB:
+				if (!--argc)
+					usage(NULL);
+				error = fiboptlist_csv(*++argv, &fibl_head);
+				if (error)
+					usage(NULL);
+				break;
 			case K_IFA:
 				if (!--argc)
 					usage(NULL);
@@ -680,7 +886,8 @@ newroute(int argc, char **argv)
 			case K_DST:
 				if (!--argc)
 					usage(NULL);
-				ishost = getaddr(RTA_DST, *++argv, &hp);
+				if (getaddr(RTA_DST, *++argv, &hp))
+					nrflags |= F_ISHOST;
 				dest = *argv;
 				break;
 			case K_NETMASK:
@@ -689,17 +896,17 @@ newroute(int argc, char **argv)
 				(void) getaddr(RTA_NETMASK, *++argv, 0);
 				/* FALLTHROUGH */
 			case K_NET:
-				forcenet++;
+				nrflags |= F_FORCENET;
 				break;
 			case K_PREFIXLEN:
 				if (!--argc)
 					usage(NULL);
 				if (prefixlen(*++argv) == -1) {
-					forcenet = 0;
-					ishost = 1;
+					nrflags &= ~F_FORCENET;
+					nrflags |= F_ISHOST;
 				} else {
-					forcenet = 1;
-					ishost = 0;
+					nrflags |= F_FORCENET;
+					nrflags &= ~F_ISHOST;
 				}
 				break;
 			case K_MTU:
@@ -721,18 +928,20 @@ newroute(int argc, char **argv)
 		} else {
 			if ((rtm_addrs & RTA_DST) == 0) {
 				dest = *argv;
-				ishost = getaddr(RTA_DST, *argv, &hp);
+				if (getaddr(RTA_DST, *argv, &hp))
+					nrflags |= F_ISHOST;
 			} else if ((rtm_addrs & RTA_GATEWAY) == 0) {
 				gateway = *argv;
 				(void) getaddr(RTA_GATEWAY, *argv, &hp);
 			} else {
 				(void) getaddr(RTA_NETMASK, *argv, 0);
-				forcenet = 1;
+				nrflags |= F_FORCENET;
 			}
 		}
 	}
-	if (forcehost) {
-		ishost = 1;
+
+	if (nrflags & F_FORCEHOST) {
+		nrflags |= F_ISHOST;
 #ifdef INET6
 		if (af == AF_INET6) {
 			rtm_addrs &= ~RTA_NETMASK;
@@ -740,71 +949,125 @@ newroute(int argc, char **argv)
 		}
 #endif
 	}
-	if (forcenet)
-		ishost = 0;
+	if (nrflags & F_FORCENET)
+		nrflags &= ~F_ISHOST;
 	flags |= RTF_UP;
-	if (ishost)
+	if (nrflags & F_ISHOST)
 		flags |= RTF_HOST;
-	if (iflag == 0)
+	if ((nrflags & F_INTERFACE) == 0)
 		flags |= RTF_GATEWAY;
-	if (proxy) {
+	if (nrflags & F_PROXY) {
 		so_dst.sinarp.sin_other = SIN_PROXY;
 		flags |= RTF_ANNOUNCE;
 	}
-	for (attempts = 1; ; attempts++) {
-		errno = 0;
-		if ((ret = rtmsg(*cmd, flags)) == 0)
-			break;
-		if (errno != ENETUNREACH && errno != ESRCH)
-			break;
-		if (af == AF_INET && *gateway != '\0' &&
-		    hp != NULL && hp->h_addr_list[1] != NULL) {
-			hp->h_addr_list++;
-			memmove(&so_gate.sin.sin_addr, hp->h_addr_list[0],
-			    MIN((size_t)hp->h_length,
-			    sizeof(so_gate.sin.sin_addr)));
-		} else
-			break;
+	if (dest == NULL)
+		dest = "";
+	if (gateway == NULL)
+		gateway = "";
+
+	if (TAILQ_EMPTY(&fibl_head)) {
+		error = fiboptlist_csv("default", &fibl_head);
+		if (error)
+			errx(EX_OSERR, "fiboptlist_csv failed.");
+	}
+	error = 0;
+	TAILQ_FOREACH(fl, &fibl_head, fl_next) {
+		fl->fl_error = newroute_fib(fl->fl_num, cmd, flags);
+		if (fl->fl_error)
+			fl->fl_errno = errno;
+		error += fl->fl_error;
 	}
 	if (*cmd == 'g' || *cmd == 's')
-		exit(ret != 0);
+		exit(error);
+
+	error = 0;
 	if (!qflag) {
-		oerrno = errno;
-		(void) printf("%s %s %s", cmd, ishost? "host" : "net", dest);
-		if (*gateway) {
-			(void) printf(": gateway %s", gateway);
-			if (attempts > 1 && ret == 0 && af == AF_INET)
-			    (void) printf(" (%s)",
-				inet_ntoa(((struct sockaddr_in *)&route.rt_gateway)->sin_addr));
+		fibnum = 0;
+		TAILQ_FOREACH(fl, &fibl_head, fl_next) {
+			if (fl->fl_error == 0)
+				fibnum++;
+		}
+		if (fibnum > 0) {
+			int firstfib = 1;
+
+			printf("%s %s %s", cmd,
+			    (nrflags & F_ISHOST) ? "host" : "net", dest);
+			if (*gateway)
+				printf(": gateway %s", gateway);
+
+			if (numfibs > 1) {
+				TAILQ_FOREACH(fl, &fibl_head, fl_next) {
+					if (fl->fl_error == 0
+					    && fl->fl_num >= 0) {
+						if (firstfib) {
+							printf(" fib ");
+							firstfib = 0;
+						}
+						printf("%d", fl->fl_num);
+						if (fibnum-- > 1)
+							printf(",");
+					}
+				}
+			}
+			printf("\n");
 		}
-		if (ret == 0) {
-			(void) printf("\n");
-		} else {
-			switch (oerrno) {
-			case ESRCH:
-				errmsg = "not in table";
-				break;
-			case EBUSY:
-				errmsg = "entry in use";
-				break;
-			case ENOBUFS:
-				errmsg = "not enough memory";
-				break;
-			case EADDRINUSE:
-				/* handle recursion avoidance in rt_setgate() */
-				errmsg = "gateway uses the same route";
-				break;
-			case EEXIST:
-				errmsg = "route already in table";
-				break;
-			default:
-				errmsg = strerror(oerrno);
-				break;
+
+		fibnum = 0;
+		TAILQ_FOREACH(fl, &fibl_head, fl_next) {
+			if (fl->fl_error != 0) {
+				printf("%s %s %s", cmd, (nrflags & F_ISHOST)
+				    ? "host" : "net", dest);
+				if (*gateway)
+					printf(": gateway %s", gateway);
+
+				if (fl->fl_num >= 0)
+					printf(" fib %d", fl->fl_num);
+
+				switch (fl->fl_errno) {
+				case ESRCH:
+					errmsg = "not in table";
+					break;
+				case EBUSY:
+					errmsg = "entry in use";
+					break;
+				case ENOBUFS:
+					errmsg = "not enough memory";
+					break;
+				case EADDRINUSE:
+					/*
+					 * handle recursion avoidance
+					 * in rt_setgate()
+					 */
+					errmsg = "gateway uses the same route";
+					break;
+				case EEXIST:
+					errmsg = "route already in table";
+					break;
+				default:
+					errmsg = strerror(fl->fl_errno);
+					break;
+				}
+				printf(": %s\n", errmsg);
+				error = 1;
 			}
-			(void) printf(": %s\n", errmsg);
 		}
 	}
-	exit(ret != 0);
+	exit(error);
+}
+
+static int
+newroute_fib(int fib, char *cmd, int flags)
+{
+	int error;
+
+	error = set_sofib(fib);
+	if (error) {
+		warn("fib number %d is ignored", fib);
+		return (error);
+	}
+
+	error = rtmsg(*cmd, flags, fib);
+	return (error);
 }
 
 static void
@@ -1165,10 +1428,33 @@ retry2:
 }
 
 static void
-monitor(void)
+monitor(int argc, char *argv[])
 {
-	int n;
-	char msg[2048];
+	int n, fib, error;
+	char msg[2048], *endptr;
+
+	fib = defaultfib;
+	while (argc > 1) {
+		argc--;
+		argv++;
+		if (**argv != '-')
+			usage(*argv);
+		switch (keyword(*argv + 1)) {
+		case K_FIB:
+			if (!--argc)
+				usage(*argv);
+			fib = strtol(*++argv, &endptr, 0);
+			if (*endptr != '\0' || (fib == 0 &&
+			    (errno == EINVAL || errno == ERANGE)))
+				usage(*argv);
+			break;
+		default:
+			usage(*argv);
+		}
+	}
+	error = set_sofib(fib);
+	if (error)
+		errx(EX_USAGE, "invalid fib number: %d", fib);
 
 	verbose = 1;
 	if (debugonly) {
@@ -1190,7 +1476,7 @@ struct {
 } m_rtmsg;
 
 static int
-rtmsg(int cmd, int flags)
+rtmsg(int cmd, int flags, int fib)
 {
 	static int seq;
 	int rlen;
@@ -1253,7 +1539,7 @@ rtmsg(int cmd, int flags)
 		if (l < 0)
 			warn("read from routing socket");
 		else
-			print_getmsg(&rtm, l);
+			print_getmsg(&rtm, l, fib);
 	}
 #undef rtm
 	return (0);
@@ -1431,7 +1717,7 @@ badlen:
 }
 
 static void
-print_getmsg(struct rt_msghdr *rtm, int msglen)
+print_getmsg(struct rt_msghdr *rtm, int msglen, int fib)
 {
 	struct sockaddr *dst = NULL, *gate = NULL, *mask = NULL;
 	struct sockaddr_dl *ifp = NULL;
@@ -1491,6 +1777,8 @@ print_getmsg(struct rt_msghdr *rtm, int 
 	}
 	if (gate && rtm->rtm_flags & RTF_GATEWAY)
 		(void)printf("    gateway: %s\n", routename(gate));
+	if (fib >= 0)
+		(void)printf("        fib: %u\n", (unsigned int)fib);
 	if (ifp)
 		(void)printf("  interface: %.*s\n",
 		    ifp->sdl_nlen, ifp->sdl_data);

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 01:25:25 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 60359C8;
 Fri, 12 Jul 2013 01:25:25 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 51EC110D0;
 Fri, 12 Jul 2013 01:25:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C1PPGP097657;
 Fri, 12 Jul 2013 01:25:25 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C1PPlG097656;
 Fri, 12 Jul 2013 01:25:25 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120125.r6C1PPlG097656@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 01:25:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253235 - stable/9/sbin/route
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 01:25:25 -0000

Author: hrs
Date: Fri Jul 12 01:25:24 2013
New Revision: 253235
URL: http://svnweb.freebsd.org/changeset/base/253235

Log:
  MFC 244325:
  
  - Fix strtol() error handling.
  - Add a range condition of given FIB number and the related error messages.
  - Fix free() problem.

Modified:
  stable/9/sbin/route/route.c
Directory Properties:
  stable/9/sbin/route/   (props changed)

Modified: stable/9/sbin/route/route.c
==============================================================================
--- stable/9/sbin/route/route.c	Fri Jul 12 01:23:41 2013	(r253234)
+++ stable/9/sbin/route/route.c	Fri Jul 12 01:25:24 2013	(r253235)
@@ -260,19 +260,25 @@ static int
 fiboptlist_range(const char *arg, struct fibl_head_t *flh)
 {
 	struct fibl *fl;
-	char *str, *token, *endptr;
+	char *str0, *str, *token, *endptr;
 	int fib[2], i, error;
 
-	str = strdup(arg);
+	str0 = str = strdup(arg);
 	error = 0;
 	i = 0;
 	while ((token = strsep(&str, "-")) != NULL) {
 		switch (i) {
 		case 0:
 		case 1:
+			errno = 0;
 			fib[i] = strtol(token, &endptr, 0);
-			if (*endptr != '\0' || (fib[i] == 0 &&
-			    (errno == EINVAL || errno == ERANGE)))
+			if (errno == 0) {
+				if (*endptr != '\0' ||
+				    fib[i] < 0 ||
+				    (numfibs != -1 && fib[i] > numfibs - 1)) 
+					errno = EINVAL;
+			}
+			if (errno)
 				error = 1;
 			break;
 		default:
@@ -296,7 +302,7 @@ fiboptlist_range(const char *arg, struct
 		TAILQ_INSERT_TAIL(flh, fl, fl_next);
 	}
 fiboptlist_range_ret:
-	free(str);
+	free(str0);
 	return (error);
 }
 
@@ -305,7 +311,7 @@ static int
 fiboptlist_csv(const char *arg, struct fibl_head_t *flh)
 {
 	struct fibl *fl;
-	char *str, *token, *endptr;
+	char *str0, *str, *token, *endptr;
 	int fib, error;
 
 	if (strcmp("all", arg) == 0) {
@@ -319,14 +325,14 @@ fiboptlist_csv(const char *arg, struct f
 		else
 			snprintf(str, ALLSTRLEN - 1, "%d", 0);
 	} else if (strcmp("default", arg) == 0) {
-		str = calloc(1, ALLSTRLEN);
+		str0 = str = calloc(1, ALLSTRLEN);
 		if (str == NULL) {
 			error = 1;
 			goto fiboptlist_csv_ret;
 		}
 		snprintf(str, ALLSTRLEN - 1, "%d", defaultfib);
 	} else
-		str = strdup(arg);
+		str0 = str = strdup(arg);
 
 	error = 0;
 	while ((token = strsep(&str, ",")) != NULL) {
@@ -335,9 +341,15 @@ fiboptlist_csv(const char *arg, struct f
 			if (error)
 				goto fiboptlist_csv_ret;
 		} else {
+			errno = 0;
 			fib = strtol(token, &endptr, 0);
-			if (*endptr != '\0' || (fib == 0 &&
-			    (errno == EINVAL || errno == ERANGE))) {
+			if (errno == 0) {
+				if (*endptr != '\0' ||
+				    fib < 0 ||
+				    (numfibs != -1 && fib > numfibs - 1))
+					errno = EINVAL;
+			}
+			if (errno) {
 				error = 1;
 				goto fiboptlist_csv_ret;
 			}
@@ -351,7 +363,7 @@ fiboptlist_csv(const char *arg, struct f
 		}
 	}
 fiboptlist_csv_ret:
-	free(str);
+	free(str0);
 	return (error);
 }
 
@@ -396,7 +408,7 @@ flushroutes(int argc, char *argv[])
 				usage(*argv);
 			error = fiboptlist_csv(*++argv, &fibl_head);
 			if (error)
-				usage(*argv);
+				errx(EX_USAGE, "invalid fib number: %s", *argv);
 			break;
 		default:
 			usage(*argv);
@@ -861,7 +873,8 @@ newroute(int argc, char **argv)
 					usage(NULL);
 				error = fiboptlist_csv(*++argv, &fibl_head);
 				if (error)
-					usage(NULL);
+					errx(EX_USAGE,
+					    "invalid fib number: %s", *argv);
 				break;
 			case K_IFA:
 				if (!--argc)
@@ -1443,10 +1456,16 @@ monitor(int argc, char *argv[])
 		case K_FIB:
 			if (!--argc)
 				usage(*argv);
+			errno = 0;
 			fib = strtol(*++argv, &endptr, 0);
-			if (*endptr != '\0' || (fib == 0 &&
-			    (errno == EINVAL || errno == ERANGE)))
-				usage(*argv);
+			if (errno == 0) {
+				if (*endptr != '\0' ||
+				    fib < 0 ||
+				    (numfibs != -1 && fib > numfibs - 1))
+					errno = EINVAL;
+			}
+			if (errno)
+				errx(EX_USAGE, "invalid fib number: %s", *argv);
 			break;
 		default:
 			usage(*argv);

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 01:27:12 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 7C230222;
 Fri, 12 Jul 2013 01:27:12 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 6E3D110E5;
 Fri, 12 Jul 2013 01:27:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C1RC93097925;
 Fri, 12 Jul 2013 01:27:12 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C1RCOE097924;
 Fri, 12 Jul 2013 01:27:12 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120127.r6C1RCOE097924@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 01:27:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253236 - stable/9/sbin/route
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 01:27:12 -0000

Author: hrs
Date: Fri Jul 12 01:27:11 2013
New Revision: 253236
URL: http://svnweb.freebsd.org/changeset/base/253236

Log:
  MFC 245168:
  
  Fix -iface and -interface modifiers.

Modified:
  stable/9/sbin/route/route.c
Directory Properties:
  stable/9/sbin/route/   (props changed)

Modified: stable/9/sbin/route/route.c
==============================================================================
--- stable/9/sbin/route/route.c	Fri Jul 12 01:25:24 2013	(r253235)
+++ stable/9/sbin/route/route.c	Fri Jul 12 01:27:11 2013	(r253236)
@@ -94,7 +94,7 @@ typedef union sockunion *sup;
 int	pid, rtm_addrs;
 int	s;
 int	forcehost, forcenet, doflush, nflag, af, qflag, tflag;
-int	iflag, verbose, aflen = sizeof (struct sockaddr_in);
+int	verbose, aflen = sizeof (struct sockaddr_in);
 int	locking, lockrest, debugonly;
 struct	rt_metrics rt_metrics;
 u_long  rtm_inits;
@@ -107,7 +107,7 @@ static char	*atalk_ntoa(struct at_addr);
 static void	bprintf(FILE *, int, u_char *);
 static void	flushroutes(int argc, char *argv[]);
 static int	flushroutes_fib(int);
-static int	getaddr(int, char *, struct hostent **);
+static int	getaddr(int, char *, struct hostent **, int);
 static int	keyword(const char *);
 static void	inet_makenetandmask(u_long, struct sockaddr_in *, u_long);
 #ifdef INET6
@@ -879,34 +879,34 @@ newroute(int argc, char **argv)
 			case K_IFA:
 				if (!--argc)
 					usage(NULL);
-				(void) getaddr(RTA_IFA, *++argv, 0);
+				getaddr(RTA_IFA, *++argv, 0, nrflags);
 				break;
 			case K_IFP:
 				if (!--argc)
 					usage(NULL);
-				(void) getaddr(RTA_IFP, *++argv, 0);
+				getaddr(RTA_IFP, *++argv, 0, nrflags);
 				break;
 			case K_GENMASK:
 				if (!--argc)
 					usage(NULL);
-				(void) getaddr(RTA_GENMASK, *++argv, 0);
+				getaddr(RTA_GENMASK, *++argv, 0, nrflags);
 				break;
 			case K_GATEWAY:
 				if (!--argc)
 					usage(NULL);
-				(void) getaddr(RTA_GATEWAY, *++argv, 0);
+				getaddr(RTA_GATEWAY, *++argv, 0, nrflags);
 				break;
 			case K_DST:
 				if (!--argc)
 					usage(NULL);
-				if (getaddr(RTA_DST, *++argv, &hp))
+				if (getaddr(RTA_DST, *++argv, &hp, nrflags))
 					nrflags |= F_ISHOST;
 				dest = *argv;
 				break;
 			case K_NETMASK:
 				if (!--argc)
 					usage(NULL);
-				(void) getaddr(RTA_NETMASK, *++argv, 0);
+				getaddr(RTA_NETMASK, *++argv, 0, nrflags);
 				/* FALLTHROUGH */
 			case K_NET:
 				nrflags |= F_FORCENET;
@@ -941,13 +941,13 @@ newroute(int argc, char **argv)
 		} else {
 			if ((rtm_addrs & RTA_DST) == 0) {
 				dest = *argv;
-				if (getaddr(RTA_DST, *argv, &hp))
+				if (getaddr(RTA_DST, *argv, &hp, nrflags))
 					nrflags |= F_ISHOST;
 			} else if ((rtm_addrs & RTA_GATEWAY) == 0) {
 				gateway = *argv;
-				(void) getaddr(RTA_GATEWAY, *argv, &hp);
+				getaddr(RTA_GATEWAY, *argv, &hp, nrflags);
 			} else {
-				(void) getaddr(RTA_NETMASK, *argv, 0);
+				getaddr(RTA_NETMASK, *argv, 0, nrflags);
 				nrflags |= F_FORCENET;
 			}
 		}
@@ -1166,7 +1166,7 @@ inet6_makenetandmask(struct sockaddr_in6
  * returning 1 if a host address, 0 if a network address.
  */
 static int
-getaddr(int which, char *str, struct hostent **hpp)
+getaddr(int which, char *str, struct hostent **hpp, int nrflags)
 {
 	sup su;
 	struct hostent *hp;
@@ -1187,7 +1187,7 @@ getaddr(int which, char *str, struct hos
 		break;
 	case RTA_GATEWAY:
 		su = &so_gate;
-		if (iflag) {
+		if (nrflags & F_INTERFACE) {
 			struct ifaddrs *ifap, *ifa;
 			struct sockaddr_dl *sdl = NULL;
 
@@ -1247,7 +1247,7 @@ getaddr(int which, char *str, struct hos
 #if 0
 			bzero(su, sizeof(*su));	/* for readability */
 #endif
-			getaddr(RTA_NETMASK, str, 0);
+			getaddr(RTA_NETMASK, str, 0, nrflags);
 			break;
 #if 0
 		case RTA_NETMASK:

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 01:29:58 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 1D6B237F;
 Fri, 12 Jul 2013 01:29:58 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 0FFA01106;
 Fri, 12 Jul 2013 01:29:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C1TvQQ098281;
 Fri, 12 Jul 2013 01:29:57 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C1Tvnu098280;
 Fri, 12 Jul 2013 01:29:57 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120129.r6C1Tvnu098280@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 01:29:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253237 - stable/9/sbin/route
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 01:29:58 -0000

Author: hrs
Date: Fri Jul 12 01:29:57 2013
New Revision: 253237
URL: http://svnweb.freebsd.org/changeset/base/253237

Log:
  MFC 251581:
  
  Fix a bug that the gateway address was not shown when a -gateway modifier
  was used.

Modified:
  stable/9/sbin/route/route.c
Directory Properties:
  stable/9/sbin/route/   (props changed)

Modified: stable/9/sbin/route/route.c
==============================================================================
--- stable/9/sbin/route/route.c	Fri Jul 12 01:27:11 2013	(r253236)
+++ stable/9/sbin/route/route.c	Fri Jul 12 01:29:57 2013	(r253237)
@@ -895,6 +895,7 @@ newroute(int argc, char **argv)
 				if (!--argc)
 					usage(NULL);
 				getaddr(RTA_GATEWAY, *++argv, 0, nrflags);
+				gateway = *argv;
 				break;
 			case K_DST:
 				if (!--argc)

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 01:34:26 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id F379657D;
 Fri, 12 Jul 2013 01:34:25 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id D745E112B;
 Fri, 12 Jul 2013 01:34:25 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C1YPT1000695;
 Fri, 12 Jul 2013 01:34:25 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C1YPr5000692;
 Fri, 12 Jul 2013 01:34:25 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120134.r6C1YPr5000692@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 01:34:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253238 - in stable/9: etc/rc.d share/man/man5
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 01:34:26 -0000

Author: hrs
Date: Fri Jul 12 01:34:24 2013
New Revision: 253238
URL: http://svnweb.freebsd.org/changeset/base/253238

Log:
  MFC 251584:
  
  Add :ifname modifier to specify interface-specific routes into
  {,ipv6_}static_routes and rc.d/routing.  For example:
  
   static_routes="foo bar:em0"
   route_foo="-net 10.0.0.0/24 -gateway 192.168.2.1"
   route_bar="-net 192.168.1.0/24 -gateway 192.168.0.2"
  
  At boot time, all of the static routes are installed as before.
  The differences are:
  
  - "/etc/rc.d/netif start/stop " now configures static routes
    with : if any.
  - "/etc/rc.d/routing start/stop  " works as well.   cannot be
    omitted when  is specified, but a keyword "any" or "all" can be used
    for  and .

Modified:
  stable/9/etc/rc.d/netif
  stable/9/etc/rc.d/routing
  stable/9/share/man/man5/rc.conf.5
Directory Properties:
  stable/9/etc/rc.d/   (props changed)
  stable/9/share/man/man5/   (props changed)

Modified: stable/9/etc/rc.d/netif
==============================================================================
--- stable/9/etc/rc.d/netif	Fri Jul 12 01:29:57 2013	(r253237)
+++ stable/9/etc/rc.d/netif	Fri Jul 12 01:34:24 2013	(r253238)
@@ -46,6 +46,8 @@ set_rcvar_obsolete ipv6_prefer
 
 network_start()
 {
+	local _if
+
 	# Set the list of interfaces to work on.
 	#
 	cmdifn=$*
@@ -81,16 +83,29 @@ network_start()
 	if [ -f /etc/rc.d/bridge -a -n "$cmdifn" ] ; then
 		/etc/rc.d/bridge start $cmdifn
 	fi
+	if [ -f /etc/rc.d/routing -a -n "$cmdifn" ] ; then
+		for _if in $cmdifn; do
+			/etc/rc.d/routing start any $_if
+		done
+	fi
 }
 
 network_stop()
 {
+	local _if
+
 	# Set the list of interfaces to work on.
 	#
 	cmdifn=$*
 
 	# Deconfigure the interface(s)
 	network_common ifn_stop
+
+	if [ -f /etc/rc.d/routing -a -n "$cmdifn" ] ; then
+		for _if in $cmdifn; do
+			/etc/rc.d/routing stop any $_if
+		done
+	fi
 }
 
 # network_common routine

Modified: stable/9/etc/rc.d/routing
==============================================================================
--- stable/9/etc/rc.d/routing	Fri Jul 12 01:29:57 2013	(r253237)
+++ stable/9/etc/rc.d/routing	Fri Jul 12 01:34:24 2013	(r253238)
@@ -19,56 +19,73 @@ extra_commands="options static"
 static_cmd="routing_start static"
 options_cmd="routing_start options"
 
-afcheck()
-{
-	case $_af in
-	""|inet|inet6|ipx|atm)
-		;;
-	*)
-		err 1 "Unsupported address family: $_af."
-		;;
-	esac
-}
+ROUTE_CMD="/sbin/route"
 
 routing_start()
 {
-	local _cmd _af _a
+	local _cmd _af _if _a
 	_cmd=$1
 	_af=$2
+	_if=$3
 
-	afcheck
+	case $_if in
+	""|[Aa][Ll][Ll]|[Aa][Nn][Yy])	_if="" ;;
+	esac
 
 	case $_af in
 	inet|inet6|ipx|atm)
-		setroutes $_cmd $_af
+		if afexists $_af; then
+			setroutes $_cmd $_af $_if
+		else
+			err 1 "Unsupported address family: $_af."
+		fi
 		;;
-	"")
+	""|[Aa][Ll][Ll]|[Aa][Nn][Yy])
 		for _a in inet inet6 ipx atm; do
-			afexists $_a && setroutes $_cmd $_a
+			afexists $_a && setroutes $_cmd $_a $_if
 		done
 		;;
+	*)
+		err 1 "Unsupported address family: $_af."
+		;;
 	esac
 }
 
 routing_stop()
 {
-	local _af _a
+	local _af _if _a
 	_af=$1
+	_if=$2
 
-	afcheck
+	case $_if in
+	""|[Aa][Ll][Ll]|[Aa][Nn][Yy])	_if="" ;;
+	esac
 
 	case $_af in
 	inet|inet6|ipx|atm)
-		eval static_${_af} delete
-		eval routing_stop_${_af}
+		if afexists $_af; then
+			eval static_${_af} delete $_if 
+			# When $_if is specified, do not flush routes.
+			if ! [ -n "$_if" ]; then
+				eval routing_stop_${_af}
+			fi
+		else
+			err 1 "Unsupported address family: $_af."
+		fi
 		;;
-	"")
+	""|[Aa][Ll][Ll]|[Aa][Nn][Yy])
 		for _a in inet inet6 ipx atm; do
 			afexists $_a || continue
-			eval static_${_a} delete
-			eval routing_stop_${_a}
+			eval static_${_a} delete $_if
+			# When $_if is specified, do not flush routes.
+			if ! [ -n "$_if" ]; then
+				eval routing_stop_${_a}
+			fi
 		done
 		;;
+	*)
+		err 1 "Unsupported address family: $_af."
+		;;
 	esac
 }
 
@@ -76,13 +93,13 @@ setroutes()
 {
 	case $1 in
 	static)
-		static_$2 add
+		static_$2 add $3
 		;;
 	options)
 		options_$2
 		;;
 	doall)
-		static_$2 add
+		static_$2 add $3
 		options_$2
 		;;
 	esac
@@ -90,14 +107,14 @@ setroutes()
 
 routing_stop_inet()
 {
-	route -n flush -inet
+	${ROUTE_CMD} -n flush -inet
 }
 
 routing_stop_inet6()
 {
 	local i
 
-	route -n flush -inet6
+	${ROUTE_CMD} -n flush -inet6
 	for i in ${ipv6_network_interfaces}; do
 		ifconfig $i inet6 -defaultif
 	done
@@ -115,30 +132,47 @@ routing_stop_ipx()
 
 static_inet()
 {
-	local _action
+	local _action _if _skip
 	_action=$1
+	_if=$2
 
+	# Add default route.
 	case ${defaultrouter} in
 	[Nn][Oo] | '')
 		;;
 	*)
-		static_routes="default ${static_routes}"
-		route_default="default ${defaultrouter}"
+		static_routes="_default ${static_routes}"
+		route__default="default ${defaultrouter}"
 		;;
 	esac
 
+	# Install configured routes.
 	if [ -n "${static_routes}" ]; then
 		for i in ${static_routes}; do
-			route_args=`get_if_var $i route_IF`
-			route ${_action} ${route_args}
+			_skip=0
+			if [ -n "$_if" ]; then
+				case $i in
+				*:$_if)	;;
+				*)	_skip=1 ;;
+				esac
+			fi
+			if [ $_skip = 0 ]; then
+				route_args=`get_if_var ${i%:*} route_IF`
+				if [ -n "$route_args" ]; then
+					${ROUTE_CMD} ${_action} ${route_args}
+				else
+					warn "route_${i%:*} not found."
+				fi
+			fi
 		done
 	fi
 }
 
 static_inet6()
 {
-	local _action fibmod fibs
+	local _action _if _skip fibmod fibs
 	_action=$1
+	_if=$2
 
 	# get the number of FIBs supported.
 	fibs=$((`${SYSCTL_N} net.fibs` - 1))
@@ -148,58 +182,74 @@ static_inet6()
 		fibmod=
 	fi
 
+	# Add pre-defined static routes first.
+	ipv6_static_routes="_v4mapped _v4compat ${ipv6_static_routes}"
+	ipv6_static_routes="_lla _llma ${ipv6_static_routes}"
+
 	# disallow "internal" addresses to appear on the wire
-	route ${_action} -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject ${fibmod}
-	route ${_action} -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject ${fibmod}
+	ipv6_route__v4mapped="::ffff:0.0.0.0 -prefixlen 96 ::1 -reject ${fibmod}"
+	ipv6_route__v4compat="::0.0.0.0 -prefixlen 96 ::1 -reject ${fibmod}"
 
+	# Disallow link-local unicast packets without outgoing scope
+	# identifiers.  However, if you set "ipv6_default_interface",
+	# for the host case, you will allow to omit the identifiers.
+	# Under this configuration, the packets will go to the default
+	# interface.
+	ipv6_route__lla="fe80:: -prefixlen 10 ::1 -reject ${fibmod}"
+	ipv6_route__llma="ff02:: -prefixlen 16 ::1 -reject ${fibmod}"
+
+	# Add default route.
 	case ${ipv6_defaultrouter} in
 	[Nn][Oo] | '')
 		;;
 	*)
-		ipv6_static_routes="default ${ipv6_static_routes}"
-		ipv6_route_default="default ${ipv6_defaultrouter}"
+		ipv6_static_routes="_default ${ipv6_static_routes}"
+		ipv6_route__default="default ${ipv6_defaultrouter}"
 		;;
 	esac
 
+	# Install configured routes.
 	if [ -n "${ipv6_static_routes}" ]; then
 		for i in ${ipv6_static_routes}; do
-			ipv6_route_args=`get_if_var $i ipv6_route_IF`
-			route ${_action} -inet6 ${ipv6_route_args}
+			_skip=0
+			if [ -n "$_if" ]; then
+				case $i in
+				*:$_if)	;;
+				*)	_skip=1 ;;
+				esac
+			fi
+			if [ $_skip = 0 ]; then
+				ipv6_route_args=`get_if_var ${i%:*} ipv6_route_IF`
+				if [ -n "$ipv6_route_args" ]; then
+					${ROUTE_CMD} ${_action} \
+						-inet6 ${ipv6_route_args}
+				else
+					warn "route_${i%:*} not found"
+				fi
+			fi
 		done
 	fi
 
-	# Fixup $ipv6_network_interfaces
-	case ${ipv6_network_interfaces} in
-	[Nn][Oo][Nn][Ee])
-		ipv6_network_interfaces=''
-		;;
-	esac
+	# Install the "default interface" to kernel, which will be used
+	# as the default route when there's no router.
 
+	# Disable installing the default interface when we act
+	# as router to avoid conflict between the default
+	# router list and the manual configured default route.
 	if checkyesno ipv6_gateway_enable; then
-		for i in ${ipv6_network_interfaces}; do
-
-			laddr=`network6_getladdr $i exclude_tentative`
-			case ${laddr} in
-			'')
-				;;
-			*)
-				ipv6_working_interfaces="$i \
-				    ${ipv6_working_interfaces}"
-				;;
-			esac
-		done
-		ipv6_network_interfaces=${ipv6_working_interfaces}
+		return
 	fi
 
-	# Install the "default interface" to kernel, which will be used
-	# as the default route when there's no router.
 	case "${ipv6_default_interface}" in
 	[Nn][Oo] | [Nn][Oo][Nn][Ee])
-		ipv6_default_interface=""
+		return
 		;;
 	[Aa][Uu][Tt][Oo] | "")
 		for i in ${ipv6_network_interfaces}; do
 			case $i in
+			[Nn][Oo][Nn][Ee])
+				return
+				;;
 			lo0|faith[0-9]*)
 				continue
 				;;
@@ -217,27 +267,8 @@ static_inet6()
 		;;
 	esac
 
-	# Disallow link-local unicast packets without outgoing scope
-	# identifiers.  However, if you set "ipv6_default_interface",
-	# 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 ${fibmod}
-	route ${_action} -inet6 ff02:: -prefixlen 16 ::1 -reject ${fibmod}
-
-	case ${ipv6_default_interface} in
-	'')
-		;;
-	*)
-		# Disable installing the default interface when we act
-		# as router to avoid conflict between the default
-		# router list and the manual configured default route.
-		if ! checkyesno ipv6_gateway_enable; then
-			ifconfig ${ipv6_default_interface} inet6 defaultif
-			sysctl net.inet6.ip6.use_defaultzone=1
-		fi
-		;;
-	esac
+	ifconfig ${ipv6_default_interface} inet6 defaultif
+	sysctl net.inet6.ip6.use_defaultzone=1
 }
 
 static_atm()
@@ -248,7 +279,11 @@ static_atm()
 	if [ -n "${natm_static_routes}" ]; then
 		for i in ${natm_static_routes}; do
 			route_args=`get_if_var $i route_IF`
-			atmconfig natm ${_action} ${route_args}
+			if [ -n "$route_args" ]; then
+				atmconfig natm ${_action} ${route_args}
+			else
+				warn "route_${i} not found."
+			fi
 		done
 	fi
 }

Modified: stable/9/share/man/man5/rc.conf.5
==============================================================================
--- stable/9/share/man/man5/rc.conf.5	Fri Jul 12 01:29:57 2013	(r253237)
+++ stable/9/share/man/man5/rc.conf.5	Fri Jul 12 01:34:24 2013	(r253238)
@@ -2704,10 +2704,18 @@ whose contents will later be passed to a
 operation.
 For example:
 .Bd -literal
-static_routes="mcast gif0local"
+static_routes="ext mcast:gif0 gif0local:gif0"
+route_ext="-net 10.0.0.0/24 -gateway 192.168.0.1"
 route_mcast="-net 224.0.0.0/4 -iface gif0"
 route_gif0local="-host 169.254.1.1 -iface lo0"
 .Ed
+.Pp
+When an
+.Ar element
+is in the form of
+.Li name:ifname ,
+the route is specific to the interface
+.Li ifname .
 .It Va ipv6_static_routes
 .Pq Vt str
 The IPv6 equivalent of

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 01:52:33 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id A9F13803;
 Fri, 12 Jul 2013 01:52:33 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 9B52611A5;
 Fri, 12 Jul 2013 01:52:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C1qXDV006239;
 Fri, 12 Jul 2013 01:52:33 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C1qVdS006230;
 Fri, 12 Jul 2013 01:52:31 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120152.r6C1qVdS006230@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 01:52:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253239 - in stable/9: share/man/man4 sys/net sys/netinet6
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 01:52:33 -0000

Author: hrs
Date: Fri Jul 12 01:52:31 2013
New Revision: 253239
URL: http://svnweb.freebsd.org/changeset/base/253239

Log:
  MFC 232379, 252511, 252548, 253060:
  
  - Allow to configure net.inet6.ip6.{accept_rtadv,no_radr} by the
    loader tunables as well because they have to be configured before
    interface initialization for AF_INET6.
  
  - Allow ND6_IFF_AUTO_LINKLOCAL for IFT_BRIDGE.  An interface with IFT_BRIDGE
    is initialized with !ND6_IFF_AUTO_LINKLOCAL && !ND6_IFF_ACCEPT_RTADV
    regardless of net.inet6.ip6.accept_rtadv and net.inet6.ip6.auto_linklocal.
    To configure an autoconfigured link-local address (RFC 4862), the
    following rc.conf(5) configuration can be used:
  
     ifconfig_bridge0_ipv6="inet6 auto_linklocal"
  
  - if_bridge(4) now removes IPv6 addresses on a member interface to be
    added when the parent interface or one of the existing member
    interfaces has an IPv6 address.  if_bridge(4) merges each link-local
    scope zone which the member interfaces form respectively, so it causes
    address scope violation.  Removal of the IPv6 addresses prevents it.
  
  - if_lagg(4) now removes IPv6 addresses on a member interfaces
    unconditionally.
  
  - Set reasonable flags to non-IPv6-capable interfaces.

Modified:
  stable/9/share/man/man4/bridge.4
  stable/9/sys/net/if_bridge.c
  stable/9/sys/net/if_lagg.c
  stable/9/sys/netinet6/in6.c
  stable/9/sys/netinet6/in6_ifattach.c
  stable/9/sys/netinet6/in6_var.h
  stable/9/sys/netinet6/ip6_input.c
  stable/9/sys/netinet6/nd6.c
Directory Properties:
  stable/9/share/man/man4/   (props changed)
  stable/9/sys/   (props changed)

Modified: stable/9/share/man/man4/bridge.4
==============================================================================
--- stable/9/share/man/man4/bridge.4	Fri Jul 12 01:34:24 2013	(r253238)
+++ stable/9/share/man/man4/bridge.4	Fri Jul 12 01:52:31 2013	(r253239)
@@ -35,7 +35,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 9, 2010
+.Dd July 3, 2013
 .Dt IF_BRIDGE 4
 .Os
 .Sh NAME
@@ -142,6 +142,79 @@ This can be used to multiplex the input 
 stream.
 This is useful for reconstructing the traffic for network taps
 that transmit the RX/TX signals out through two separate interfaces.
+.Sh IPV6 SUPPORT
+.Nm
+supports the
+.Li AF_INET6
+address family on bridge interfaces.
+The following
+.Xr rc.conf 5
+variable configures an IPv6 link-local address on
+.Li bridge0
+interface: 
+.Bd -literal -offset indent
+ifconfig_bridge0_ipv6="up"
+.Ed
+.Pp
+or in a more explicit manner:
+.Bd -literal -offset indent
+ifconfig_bridge0_ipv6="inet6 auto_linklocal"
+.Ed
+.Pp
+However, the
+.Li AF_INET6
+address family has a concept of scope zone.
+Bridging multiple interfaces change the zone configuration because
+multiple links are merged to each other and form a new single link
+while the member interfaces still work individually.
+This means each member interface still has a separate link-local scope
+zone and the
+.Nm
+interface has another single,
+aggregated link-local scope zone at the same time.
+This situation is clearly against the description
+.Qq zones of the same scope cannot overlap
+in Section 5,
+RFC 4007.
+Although it works in most cases,
+it can cause some conterintuitive or undesirable behavior in some
+edge cases when both of the
+.Nm
+interface and one of the member interface have an IPv6 address
+and applications use both of them.
+.Pp
+To prevent this situation,
+.Nm
+checks whether an link-local scoped IPv6 address is configured on
+a member interface to be added and the 
+.Nm
+interface.
+When the
+.Nm
+interface has IPv6 addresses,
+IPv6 addresses on the member interface will be automatically removed
+before the interface is added.
+When both
+.Nm
+interface and the existing member interfaces do not have one,
+adding an interface with IPv6 addresses as a new member interface is allowed.
+These means only one interface in the link-local scope zone where the
+.Nm
+interface forms can have link-local scoped IPv6 addresses.
+.Pp
+Note that
+.Li ACCEPT_RTADV
+and
+.Li AUTO_LINKLOCAL
+interface flag are not enabled by default on
+.Nm
+interface even when
+.Va net.inet6.ip6.accept_rtadv
+and/or
+.Va net.inet6.ip6.auto_linklocal
+is set to
+.Li 1 .
+.Ed
 .Sh SPANNING TREE
 The
 .Nm

Modified: stable/9/sys/net/if_bridge.c
==============================================================================
--- stable/9/sys/net/if_bridge.c	Fri Jul 12 01:34:24 2013	(r253238)
+++ stable/9/sys/net/if_bridge.c	Fri Jul 12 01:52:31 2013	(r253239)
@@ -119,6 +119,7 @@ __FBSDID("$FreeBSD$");
 #ifdef INET6
 #include 
 #include 
+#include 
 #endif
 #if defined(INET) || defined(INET6)
 #include 
@@ -1041,14 +1042,6 @@ bridge_ioctl_add(struct bridge_softc *sc
 	if (ifs->if_bridge != NULL)
 		return (EBUSY);
 
-	bif = malloc(sizeof(*bif), M_DEVBUF, M_NOWAIT|M_ZERO);
-	if (bif == NULL)
-		return (ENOMEM);
-
-	bif->bif_ifp = ifs;
-	bif->bif_flags = IFBIF_LEARNING | IFBIF_DISCOVER;
-	bif->bif_savedcaps = ifs->if_capenable;
-
 	switch (ifs->if_type) {
 	case IFT_ETHER:
 	case IFT_L2VLAN:
@@ -1056,20 +1049,95 @@ bridge_ioctl_add(struct bridge_softc *sc
 		/* permitted interface types */
 		break;
 	default:
-		error = EINVAL;
-		goto out;
+		return (EINVAL);
 	}
 
+#ifdef INET6
+	/*
+	 * Two valid inet6 addresses with link-local scope must not be
+	 * on the parent interface and the member interfaces at the
+	 * same time.  This restriction is needed to prevent violation
+	 * of link-local scope zone.  Attempts to add a member
+	 * interface which has inet6 addresses when the parent has
+	 * inet6 triggers removal of all inet6 addresses on the member
+	 * interface.
+	 */
+
+	/* Check if the parent interface has a link-local scope addr. */
+	if (in6ifa_llaonifp(sc->sc_ifp) != NULL) {
+		/*
+		 * If any, remove all inet6 addresses from the member
+		 * interfaces.
+		 */
+		BRIDGE_XLOCK(sc);
+		LIST_FOREACH(bif, &sc->sc_iflist, bif_next) {
+ 			if (in6ifa_llaonifp(bif->bif_ifp)) {
+				BRIDGE_UNLOCK(sc);
+				in6_ifdetach(bif->bif_ifp);
+				BRIDGE_LOCK(sc);
+				if_printf(sc->sc_ifp,
+				    "IPv6 addresses on %s have been removed "
+				    "before adding it as a member to prevent "
+				    "IPv6 address scope violation.\n",
+				    bif->bif_ifp->if_xname);
+			}
+		}
+		BRIDGE_XDROP(sc);
+		if (in6ifa_llaonifp(ifs)) {
+			BRIDGE_UNLOCK(sc);
+			in6_ifdetach(ifs);
+			BRIDGE_LOCK(sc);
+			if_printf(sc->sc_ifp,
+			    "IPv6 addresses on %s have been removed "
+			    "before adding it as a member to prevent "
+			    "IPv6 address scope violation.\n",
+			    ifs->if_xname);
+		}
+	} else {
+		struct in6_ifaddr *ia6_m, *ia6_s;
+		/*
+		 * If not, check whether one of the existing member
+		 * interfaces have inet6 address.  If any, remove
+		 * inet6 addresses on the interface to be added.
+		 */
+		ia6_m = NULL;
+		BRIDGE_XLOCK(sc);
+		LIST_FOREACH(bif, &sc->sc_iflist, bif_next) {
+			ia6_m = in6ifa_llaonifp(bif->bif_ifp);
+			if (ia6_m != NULL)
+				break;
+		}
+		BRIDGE_XDROP(sc);
+		ia6_s = in6ifa_llaonifp(ifs);
+
+		if (ia6_m != NULL && ia6_s != NULL) {
+			BRIDGE_UNLOCK(sc);
+			in6_ifdetach(ifs);
+			BRIDGE_LOCK(sc);
+			if_printf(sc->sc_ifp, "IPv6 addresses on %s have "
+				  "been removed before adding it as a member "
+				  "to prevent IPv6 address scope violation.\n",
+				  ifs->if_xname);
+		}
+	}
+#endif
 	/* Allow the first Ethernet member to define the MTU */
 	if (LIST_EMPTY(&sc->sc_iflist))
 		sc->sc_ifp->if_mtu = ifs->if_mtu;
 	else if (sc->sc_ifp->if_mtu != ifs->if_mtu) {
 		if_printf(sc->sc_ifp, "invalid MTU: %lu(%s) != %lu\n",
 		    ifs->if_mtu, ifs->if_xname, sc->sc_ifp->if_mtu);
-		error = EINVAL;
-		goto out;
+		return (EINVAL);
 	}
 
+	bif = malloc(sizeof(*bif), M_DEVBUF, M_NOWAIT|M_ZERO);
+	if (bif == NULL)
+		return (ENOMEM);
+
+	bif->bif_ifp = ifs;
+	bif->bif_flags = IFBIF_LEARNING | IFBIF_DISCOVER;
+	bif->bif_savedcaps = ifs->if_capenable;
+
 	/*
 	 * Assign the interface's MAC address to the bridge if it's the first
 	 * member and the MAC address of the bridge has not been changed from
@@ -1104,12 +1172,10 @@ bridge_ioctl_add(struct bridge_softc *sc
 			BRIDGE_LOCK(sc);
 			break;
 	}
-	if (error)
-		bridge_delete_member(sc, bif, 0);
-out:
+
 	if (error) {
-		if (bif != NULL)
-			free(bif, M_DEVBUF);
+		bridge_delete_member(sc, bif, 0);
+		free(bif, M_DEVBUF);
 	}
 	return (error);
 }
@@ -3473,7 +3539,7 @@ bridge_fragment(struct ifnet *ifp, struc
 				continue;
 			}
 			bcopy(eh, mtod(m0, caddr_t), ETHER_HDR_LEN);
-		} else 
+		} else
 			m_freem(m);
 	}
 

Modified: stable/9/sys/net/if_lagg.c
==============================================================================
--- stable/9/sys/net/if_lagg.c	Fri Jul 12 01:34:24 2013	(r253238)
+++ stable/9/sys/net/if_lagg.c	Fri Jul 12 01:52:31 2013	(r253239)
@@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$");
 
 #ifdef INET6
 #include 
+#include 
+#include 
 #endif
 
 #include 
@@ -532,6 +534,34 @@ lagg_port_create(struct lagg_softc *sc, 
 	if (ifp->if_type != IFT_ETHER)
 		return (EPROTONOSUPPORT);
 
+#ifdef INET6
+	/*
+	 * The member interface should not have inet6 address because
+	 * two interfaces with a valid link-local scope zone must not be
+	 * merged in any form.  This restriction is needed to
+	 * prevent violation of link-local scope zone.  Attempts to
+	 * add a member interface which has inet6 addresses triggers
+	 * removal of all inet6 addresses on the member interface.
+	 */
+	SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) {
+		if (in6ifa_llaonifp(lp->lp_ifp)) {
+			in6_ifdetach(lp->lp_ifp);
+			if_printf(sc->sc_ifp,
+			    "IPv6 addresses on %s have been removed "
+			    "before adding it as a member to prevent "
+			    "IPv6 address scope violation.\n",
+			    lp->lp_ifp->if_xname);
+		}
+	}
+	if (in6ifa_llaonifp(ifp)) {
+		in6_ifdetach(ifp);
+		if_printf(sc->sc_ifp,
+		    "IPv6 addresses on %s have been removed "
+		    "before adding it as a member to prevent "
+		    "IPv6 address scope violation.\n",
+		    ifp->if_xname);
+	}
+#endif
 	/* Allow the first Ethernet member to define the MTU */
 	if (SLIST_EMPTY(&sc->sc_ports))
 		sc->sc_ifp->if_mtu = ifp->if_mtu;

Modified: stable/9/sys/netinet6/in6.c
==============================================================================
--- stable/9/sys/netinet6/in6.c	Fri Jul 12 01:34:24 2013	(r253238)
+++ stable/9/sys/netinet6/in6.c	Fri Jul 12 01:52:31 2013	(r253239)
@@ -1961,6 +1961,32 @@ in6ifa_ifpwithaddr(struct ifnet *ifp, st
 }
 
 /*
+ * Find a link-local scoped address on ifp and return it if any.
+ */
+struct in6_ifaddr *
+in6ifa_llaonifp(struct ifnet *ifp)
+{
+	struct sockaddr_in6 *sin6;
+	struct ifaddr *ifa;
+
+	if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED)
+		return (NULL);
+	if_addr_rlock(ifp);
+	TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
+		if (ifa->ifa_addr->sa_family != AF_INET6)
+			continue;
+		sin6 = (struct sockaddr_in6 *)ifa->ifa_addr;
+		if (IN6_IS_SCOPE_LINKLOCAL(&sin6->sin6_addr) ||
+		    IN6_IS_ADDR_MC_INTFACELOCAL(&sin6->sin6_addr) ||
+		    IN6_IS_ADDR_MC_NODELOCAL(&sin6->sin6_addr))
+			break;
+	}
+	if_addr_runlock(ifp);
+
+	return ((struct in6_ifaddr *)ifa);
+}
+
+/*
  * Convert IP6 address to printable (loggable) representation. Caller
  * has to make sure that ip6buf is at least INET6_ADDRSTRLEN long.
  */

Modified: stable/9/sys/netinet6/in6_ifattach.c
==============================================================================
--- stable/9/sys/netinet6/in6_ifattach.c	Fri Jul 12 01:34:24 2013	(r253238)
+++ stable/9/sys/netinet6/in6_ifattach.c	Fri Jul 12 01:52:31 2013	(r253239)
@@ -266,6 +266,7 @@ found:
 
 	/* get EUI64 */
 	switch (ifp->if_type) {
+	case IFT_BRIDGE:
 	case IFT_ETHER:
 	case IFT_L2VLAN:
 	case IFT_FDDI:
@@ -727,7 +728,8 @@ in6_ifattach(struct ifnet *ifp, struct i
 	switch (ifp->if_type) {
 	case IFT_PFLOG:
 	case IFT_PFSYNC:
-	case IFT_CARP:
+		ND_IFINFO(ifp)->flags &= ~ND6_IFF_AUTO_LINKLOCAL;
+		ND_IFINFO(ifp)->flags |= ND6_IFF_IFDISABLED;
 		return;
 	}
 
@@ -735,7 +737,6 @@ in6_ifattach(struct ifnet *ifp, struct i
 	 * quirks based on interface type
 	 */
 	switch (ifp->if_type) {
-#ifdef IFT_STF
 	case IFT_STF:
 		/*
 		 * 6to4 interface is a very special kind of beast.
@@ -743,8 +744,8 @@ in6_ifattach(struct ifnet *ifp, struct i
 		 * linklocals for 6to4 interface, but there's no use and
 		 * it is rather harmful to have one.
 		 */
-		goto statinit;
-#endif
+		ND_IFINFO(ifp)->flags &= ~ND6_IFF_AUTO_LINKLOCAL;
+		break;
 	default:
 		break;
 	}
@@ -778,8 +779,7 @@ in6_ifattach(struct ifnet *ifp, struct i
 	/*
 	 * assign a link-local address, if there's none.
 	 */
-	if (ifp->if_type != IFT_BRIDGE &&
-	    !(ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
+	if (!(ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
 	    ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) {
 		int error;
 
@@ -796,10 +796,6 @@ in6_ifattach(struct ifnet *ifp, struct i
 			ifa_free(&ia->ia_ifa);
 	}
 
-#ifdef IFT_STF			/* XXX */
-statinit:
-#endif
-
 	/* update dynamically. */
 	if (V_in6_maxmtu < ifp->if_mtu)
 		V_in6_maxmtu = ifp->if_mtu;

Modified: stable/9/sys/netinet6/in6_var.h
==============================================================================
--- stable/9/sys/netinet6/in6_var.h	Fri Jul 12 01:34:24 2013	(r253238)
+++ stable/9/sys/netinet6/in6_var.h	Fri Jul 12 01:52:31 2013	(r253239)
@@ -765,6 +765,7 @@ void	in6_setmaxmtu(void);
 int	in6_if2idlen(struct ifnet *);
 struct in6_ifaddr *in6ifa_ifpforlinklocal(struct ifnet *, int);
 struct in6_ifaddr *in6ifa_ifpwithaddr(struct ifnet *, struct in6_addr *);
+struct in6_ifaddr *in6ifa_llaonifp(struct ifnet *);
 char	*ip6_sprintf(char *, const struct in6_addr *);
 int	in6_addr2zoneid(struct ifnet *, struct in6_addr *, u_int32_t *);
 int	in6_matchlen(struct in6_addr *, struct in6_addr *);

Modified: stable/9/sys/netinet6/ip6_input.c
==============================================================================
--- stable/9/sys/netinet6/ip6_input.c	Fri Jul 12 01:34:24 2013	(r253238)
+++ stable/9/sys/netinet6/ip6_input.c	Fri Jul 12 01:52:31 2013	(r253239)
@@ -166,6 +166,8 @@ ip6_init(void)
 
 	TUNABLE_INT_FETCH("net.inet6.ip6.auto_linklocal",
 	    &V_ip6_auto_linklocal);
+	TUNABLE_INT_FETCH("net.inet6.ip6.accept_rtadv", &V_ip6_accept_rtadv);
+	TUNABLE_INT_FETCH("net.inet6.ip6.no_radr", &V_ip6_no_radr);
 
 	TAILQ_INIT(&V_in6_ifaddrhead);
 

Modified: stable/9/sys/netinet6/nd6.c
==============================================================================
--- stable/9/sys/netinet6/nd6.c	Fri Jul 12 01:34:24 2013	(r253238)
+++ stable/9/sys/netinet6/nd6.c	Fri Jul 12 01:52:31 2013	(r253239)
@@ -184,13 +184,25 @@ nd6_ifattach(struct ifnet *ifp)
 
 	nd->flags = ND6_IFF_PERFORMNUD;
 
-	/* A loopback interface always has ND6_IFF_AUTO_LINKLOCAL. */
-	if (V_ip6_auto_linklocal || (ifp->if_flags & IFF_LOOPBACK))
+	/* A loopback interface always has ND6_IFF_AUTO_LINKLOCAL.
+	 * XXXHRS: Clear ND6_IFF_AUTO_LINKLOCAL on an IFT_BRIDGE interface by
+	 * default regardless of the V_ip6_auto_linklocal configuration to
+	 * give a reasonable default behavior.
+	 */
+	if ((V_ip6_auto_linklocal && ifp->if_type != IFT_BRIDGE) ||
+	    (ifp->if_flags & IFF_LOOPBACK))
 		nd->flags |= ND6_IFF_AUTO_LINKLOCAL;
-
-	/* A loopback interface does not need to accept RTADV. */
-	if (V_ip6_accept_rtadv && !(ifp->if_flags & IFF_LOOPBACK))
-		nd->flags |= ND6_IFF_ACCEPT_RTADV;
+	/*
+	 * A loopback interface does not need to accept RTADV.
+	 * XXXHRS: Clear ND6_IFF_ACCEPT_RTADV on an IFT_BRIDGE interface by
+	 * default regardless of the V_ip6_accept_rtadv configuration to
+	 * prevent the interface from accepting RA messages arrived
+	 * on one of the member interfaces with ND6_IFF_ACCEPT_RTADV.
+	 */
+	if (V_ip6_accept_rtadv &&
+	    !(ifp->if_flags & IFF_LOOPBACK) &&
+	    (ifp->if_type != IFT_BRIDGE))
+			nd->flags |= ND6_IFF_ACCEPT_RTADV;
 	if (V_ip6_no_radr && !(ifp->if_flags & IFF_LOOPBACK))
 		nd->flags |= ND6_IFF_NO_RADR;
 
@@ -1360,16 +1372,6 @@ nd6_ioctl(u_long cmd, caddr_t data, stru
 		struct ifaddr *ifa;
 		struct in6_ifaddr *ia;
 
-		/*
-		 * Try to clear ifdisabled flag when enabling
-		 * accept_rtadv or auto_linklocal.
-		 */
-		if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
-		    !(ND.flags & ND6_IFF_IFDISABLED) &&
-		    (ND.flags & (ND6_IFF_ACCEPT_RTADV |
-		    ND6_IFF_AUTO_LINKLOCAL)))
-			ND.flags &= ~ND6_IFF_IFDISABLED;
-
 		if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
 		    !(ND.flags & ND6_IFF_IFDISABLED)) {
 			/* ifdisabled 1->0 transision */

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 01:55:29 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 80A93940;
 Fri, 12 Jul 2013 01:55:29 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 72D0511B1;
 Fri, 12 Jul 2013 01:55:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C1tTNh006708;
 Fri, 12 Jul 2013 01:55:29 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C1tTrp006707;
 Fri, 12 Jul 2013 01:55:29 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120155.r6C1tTrp006707@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 01:55:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253240 - stable/9/share/man/man4
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 01:55:29 -0000

Author: hrs
Date: Fri Jul 12 01:55:28 2013
New Revision: 253240
URL: http://svnweb.freebsd.org/changeset/base/253240

Log:
  MFC 253093:
  
  Make mandoc lint happy.

Modified:
  stable/9/share/man/man4/bridge.4
Directory Properties:
  stable/9/share/man/man4/   (props changed)

Modified: stable/9/share/man/man4/bridge.4
==============================================================================
--- stable/9/share/man/man4/bridge.4	Fri Jul 12 01:52:31 2013	(r253239)
+++ stable/9/share/man/man4/bridge.4	Fri Jul 12 01:55:28 2013	(r253240)
@@ -151,7 +151,7 @@ The following
 .Xr rc.conf 5
 variable configures an IPv6 link-local address on
 .Li bridge0
-interface: 
+interface:
 .Bd -literal -offset indent
 ifconfig_bridge0_ipv6="up"
 .Ed
@@ -186,7 +186,7 @@ and applications use both of them.
 To prevent this situation,
 .Nm
 checks whether an link-local scoped IPv6 address is configured on
-a member interface to be added and the 
+a member interface to be added and the
 .Nm
 interface.
 When the
@@ -214,7 +214,6 @@ and/or
 .Va net.inet6.ip6.auto_linklocal
 is set to
 .Li 1 .
-.Ed
 .Sh SPANNING TREE
 The
 .Nm

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 01:56:06 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 8155CA71;
 Fri, 12 Jul 2013 01:56:06 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 59B0011B8;
 Fri, 12 Jul 2013 01:56:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C1u6HH006831;
 Fri, 12 Jul 2013 01:56:06 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C1u6Z3006829;
 Fri, 12 Jul 2013 01:56:06 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120156.r6C1u6Z3006829@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 01:56:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253241 - stable/9/lib/libc/net
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 01:56:06 -0000

Author: hrs
Date: Fri Jul 12 01:56:05 2013
New Revision: 253241
URL: http://svnweb.freebsd.org/changeset/base/253241

Log:
  MFC 253066:
  
  Update references.

Modified:
  stable/9/lib/libc/net/getaddrinfo.3
  stable/9/lib/libc/net/getnameinfo.3
Directory Properties:
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/net/getaddrinfo.3
==============================================================================
--- stable/9/lib/libc/net/getaddrinfo.3	Fri Jul 12 01:55:28 2013	(r253240)
+++ stable/9/lib/libc/net/getaddrinfo.3	Fri Jul 12 01:56:05 2013	(r253241)
@@ -255,7 +255,7 @@ member points to a filled-in socket addr
 This implementation of
 .Fn getaddrinfo
 allows numeric IPv6 address notation with scope identifier,
-as documented in chapter 11 of draft-ietf-ipv6-scoping-arch-02.txt.
+as documented in chapter 11 of RFC 4007.
 By appending the percent character and scope identifier to addresses,
 one can fill the
 .Li sin6_scope_id
@@ -441,9 +441,8 @@ freeaddrinfo(res0);
 .%A E. Nordmark
 .%A B. Zill
 .%T "IPv6 Scoped Address Architecture"
-.%R internet draft
-.%N draft-ietf-ipv6-scoping-arch-02.txt
-.%O work in progress material
+.%R RFC 4007
+.%D March 2005
 .Re
 .Rs
 .%A Craig Metz

Modified: stable/9/lib/libc/net/getnameinfo.3
==============================================================================
--- stable/9/lib/libc/net/getnameinfo.3	Fri Jul 12 01:55:28 2013	(r253240)
+++ stable/9/lib/libc/net/getnameinfo.3	Fri Jul 12 01:56:05 2013	(r253241)
@@ -191,10 +191,11 @@ printf("host=%s\en", hbuf);
 .%A R. Gilligan
 .%A S. Thomson
 .%A J. Bound
+.%A J. McCann
 .%A W. Stevens
 .%T Basic Socket Interface Extensions for IPv6
-.%R RFC 2553
-.%D March 1999
+.%R RFC 3493
+.%D February 2003
 .Re
 .Rs
 .%A S. Deering
@@ -203,9 +204,8 @@ printf("host=%s\en", hbuf);
 .%A E. Nordmark
 .%A B. Zill
 .%T "IPv6 Scoped Address Architecture"
-.%R internet draft
-.%N draft-ietf-ipv6-scoping-arch-02.txt
-.%O work in progress material
+.%R RFC 4007
+.%D March 2005
 .Re
 .Rs
 .%A Craig Metz
@@ -217,9 +217,9 @@ printf("host=%s\en", hbuf);
 The
 .Fn getnameinfo
 function is defined by the
-.St -p1003.1g-2000
-draft specification and documented in
-.Tn "RFC 2553" ,
+.St -p1003.1-2004
+specification and documented in
+.Tn "RFC 3493" ,
 .Dq Basic Socket Interface Extensions for IPv6 .
 .Sh CAVEATS
 .Fn getnameinfo

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 01:59:31 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 4EBD3BBF;
 Fri, 12 Jul 2013 01:59:31 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 411FC11CA;
 Fri, 12 Jul 2013 01:59:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C1xVF3007260;
 Fri, 12 Jul 2013 01:59:31 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C1xVx1007259;
 Fri, 12 Jul 2013 01:59:31 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120159.r6C1xVx1007259@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 01:59:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253242 - stable/9/usr.sbin/rtadvd
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 01:59:31 -0000

Author: hrs
Date: Fri Jul 12 01:59:30 2013
New Revision: 253242
URL: http://svnweb.freebsd.org/changeset/base/253242

Log:
  MFC 253058:
  
  - Add missing "static" keywords.
  - Add a check for ifindex to if_indextoifinfo().  It returns NULL when
    if_indextoname() fails.

Modified:
  stable/9/usr.sbin/rtadvd/rtadvd.c
Directory Properties:
  stable/9/usr.sbin/rtadvd/   (props changed)

Modified: stable/9/usr.sbin/rtadvd/rtadvd.c
==============================================================================
--- stable/9/usr.sbin/rtadvd/rtadvd.c	Fri Jul 12 01:56:05 2013	(r253241)
+++ stable/9/usr.sbin/rtadvd/rtadvd.c	Fri Jul 12 01:59:30 2013	(r253242)
@@ -95,7 +95,7 @@ struct sockaddr_in6 rcvfrom;
 static const char *pidfilename = _PATH_RTADVDPID;
 const char *conffile = _PATH_RTADVDCONF;
 static struct pidfh *pfh;
-int dflag = 0, sflag = 0;
+static int dflag, sflag;
 static int wait_shutdown;
 
 #define	PFD_RAWSOCK	0
@@ -139,7 +139,7 @@ union nd_opt {
 #define NDOPT_FLAG_RDNSS	(1 << 5)
 #define NDOPT_FLAG_DNSSL	(1 << 6)
 
-uint32_t ndopt_flags[] = {
+static uint32_t ndopt_flags[] = {
 	[ND_OPT_SOURCE_LINKADDR]	= NDOPT_FLAG_SRCLINKADDR,
 	[ND_OPT_TARGET_LINKADDR]	= NDOPT_FLAG_TGTLINKADDR,
 	[ND_OPT_PREFIX_INFORMATION]	= NDOPT_FLAG_PREFIXINFO,
@@ -1637,6 +1637,11 @@ struct ifinfo *
 if_indextoifinfo(int idx)
 {
 	struct ifinfo *ifi;
+	char *name, name0[IFNAMSIZ];
+
+	/* Check if the interface has a valid name or not. */
+	if (if_indextoname(idx, name0) == NULL)
+		return (NULL);
 
 	TAILQ_FOREACH(ifi, &ifilist, ifi_next) {
 		if (ifi->ifi_ifindex == idx)

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 02:11:42 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id A3EF9E8B;
 Fri, 12 Jul 2013 02:11:42 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 967541227;
 Fri, 12 Jul 2013 02:11:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C2BgVg012718;
 Fri, 12 Jul 2013 02:11:42 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C2BgId012717;
 Fri, 12 Jul 2013 02:11:42 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120211.r6C2BgId012717@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 02:11:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253243 - stable/9/usr.sbin/ifmcstat
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 02:11:42 -0000

Author: hrs
Date: Fri Jul 12 02:11:42 2013
New Revision: 253243
URL: http://svnweb.freebsd.org/changeset/base/253243

Log:
  MFC 245015:
  
  Print the flags= part only when flags != 0.

Modified:
  stable/9/usr.sbin/ifmcstat/ifmcstat.c
Directory Properties:
  stable/9/usr.sbin/ifmcstat/   (props changed)

Modified: stable/9/usr.sbin/ifmcstat/ifmcstat.c
==============================================================================
--- stable/9/usr.sbin/ifmcstat/ifmcstat.c	Fri Jul 12 01:59:30 2013	(r253242)
+++ stable/9/usr.sbin/ifmcstat/ifmcstat.c	Fri Jul 12 02:11:42 2013	(r253243)
@@ -296,7 +296,8 @@ in_ifinfo(struct igmp_ifinfo *igi)
 		printf("igmpv?(%d)", igi->igi_version);
 		break;
 	}
-	printb(" flags", igi->igi_flags, "\020\1SILENT\2LOOPBACK");
+	if (igi->igi_flags)
+		printb(" flags", igi->igi_flags, "\020\1SILENT\2LOOPBACK");
 	if (igi->igi_version == IGMP_VERSION_3) {
 		printf(" rv %u qi %u qri %u uri %u",
 		    igi->igi_rv, igi->igi_qi, igi->igi_qri, igi->igi_uri);
@@ -751,7 +752,8 @@ in6_ifinfo(struct mld_ifinfo *mli)
 		printf("mldv?(%d)", mli->mli_version);
 		break;
 	}
-	printb(" flags", mli->mli_flags, "\020\1SILENT\2USEALLOW");
+	if (mli->mli_flags)
+		printb(" flags", mli->mli_flags, "\020\1SILENT\2USEALLOW");
 	if (mli->mli_version == MLD_VERSION_2) {
 		printf(" rv %u qi %u qri %u uri %u",
 		    mli->mli_rv, mli->mli_qi, mli->mli_qri, mli->mli_uri);

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 02:26:17 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 45D7F20D;
 Fri, 12 Jul 2013 02:26:17 +0000 (UTC)
 (envelope-from sbruno@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 36B811281;
 Fri, 12 Jul 2013 02:26:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C2QHV4016066;
 Fri, 12 Jul 2013 02:26:17 GMT (envelope-from sbruno@svn.freebsd.org)
Received: (from sbruno@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C2QF6I016058;
 Fri, 12 Jul 2013 02:26:15 GMT (envelope-from sbruno@svn.freebsd.org)
Message-Id: <201307120226.r6C2QF6I016058@svn.freebsd.org>
From: Sean Bruno 
Date: Fri, 12 Jul 2013 02:26:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253244 - in stable/9: sys/dev/mfi usr.sbin/mfiutil
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 02:26:17 -0000

Author: sbruno
Date: Fri Jul 12 02:26:15 2013
New Revision: 253244
URL: http://svnweb.freebsd.org/changeset/base/253244

Log:
  MFC r251516
  
  Implement foreign device handling.
  
  PR:	kern/172091

Added:
  stable/9/usr.sbin/mfiutil/mfi_foreign.c
     - copied unchanged from r251516, head/usr.sbin/mfiutil/mfi_foreign.c
Modified:
  stable/9/sys/dev/mfi/mfireg.h
  stable/9/usr.sbin/mfiutil/Makefile
  stable/9/usr.sbin/mfiutil/mfi_config.c
  stable/9/usr.sbin/mfiutil/mfi_show.c
  stable/9/usr.sbin/mfiutil/mfiutil.8
  stable/9/usr.sbin/mfiutil/mfiutil.c
  stable/9/usr.sbin/mfiutil/mfiutil.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/usr.sbin/mfiutil/   (props changed)

Modified: stable/9/sys/dev/mfi/mfireg.h
==============================================================================
--- stable/9/sys/dev/mfi/mfireg.h	Fri Jul 12 02:11:42 2013	(r253243)
+++ stable/9/sys/dev/mfi/mfireg.h	Fri Jul 12 02:26:15 2013	(r253244)
@@ -230,7 +230,11 @@ typedef enum {
 	MFI_DCMD_CFG_CLEAR =		0x04030000,
 	MFI_DCMD_CFG_MAKE_SPARE =	0x04040000,
 	MFI_DCMD_CFG_REMOVE_SPARE =	0x04050000,
+	MFI_DCMD_CFG_FOREIGN_SCAN =     0x04060100,
+	MFI_DCMD_CFG_FOREIGN_DISPLAY =  0x04060200,
+	MFI_DCMD_CFG_FOREIGN_PREVIEW =  0x04060300,
 	MFI_DCMD_CFG_FOREIGN_IMPORT =	0x04060400,
+	MFI_DCMD_CFG_FOREIGN_CLEAR =    0x04060500,
 	MFI_DCMD_BBU_GET_STATUS =	0x05010000,
 	MFI_DCMD_BBU_GET_CAPACITY_INFO =0x05020000,
 	MFI_DCMD_BBU_GET_DESIGN_INFO =	0x05030000,

Modified: stable/9/usr.sbin/mfiutil/Makefile
==============================================================================
--- stable/9/usr.sbin/mfiutil/Makefile	Fri Jul 12 02:11:42 2013	(r253243)
+++ stable/9/usr.sbin/mfiutil/Makefile	Fri Jul 12 02:26:15 2013	(r253244)
@@ -2,7 +2,7 @@
 PROG=	mfiutil
 
 SRCS=	mfiutil.c mfi_bbu.c mfi_cmd.c mfi_config.c mfi_drive.c mfi_evt.c \
-	mfi_flash.c mfi_patrol.c mfi_show.c mfi_volume.c
+	mfi_flash.c mfi_patrol.c mfi_show.c mfi_volume.c mfi_foreign.c
 MAN8=	mfiutil.8
 
 CFLAGS+= -fno-builtin-strftime

Modified: stable/9/usr.sbin/mfiutil/mfi_config.c
==============================================================================
--- stable/9/usr.sbin/mfiutil/mfi_config.c	Fri Jul 12 02:11:42 2013	(r253243)
+++ stable/9/usr.sbin/mfiutil/mfi_config.c	Fri Jul 12 02:26:15 2013	(r253244)
@@ -37,19 +37,13 @@
 #include 
 #include 
 #include 
-#ifdef DEBUG
 #include 
-#endif
 #include 
 #include 
 #include 
 #include 
 #include "mfiutil.h"
 
-#ifdef DEBUG
-static void	dump_config(int fd, struct mfi_config_data *config);
-#endif
-
 static int	add_spare(int ac, char **av);
 static int	remove_spare(int ac, char **av);
 
@@ -81,9 +75,17 @@ dehumanize(const char *value)
         }
         return (iv);
 }
+
 int
 mfi_config_read(int fd, struct mfi_config_data **configp)
 {
+	return mfi_config_read_opcode(fd, MFI_DCMD_CFG_READ, configp, NULL, 0);
+}
+
+int
+mfi_config_read_opcode(int fd, uint32_t opcode, struct mfi_config_data **configp,
+	uint8_t *mbox, size_t mboxlen)
+{
 	struct mfi_config_data *config;
 	uint32_t config_size;
 	int error;
@@ -98,8 +100,8 @@ fetch:
 	config = reallocf(config, config_size);
 	if (config == NULL)
 		return (-1);
-	if (mfi_dcmd_command(fd, MFI_DCMD_CFG_READ, config,
-	    config_size, NULL, 0, NULL) < 0) {
+	if (mfi_dcmd_command(fd, opcode, config,
+	    config_size, mbox, mboxlen, NULL) < 0) {
 		error = errno;
 		free(config);
 		errno = error;
@@ -366,6 +368,13 @@ parse_array(int fd, int raid_type, char 
 			info->drives = NULL;
 			return (EINVAL);
 		}
+
+		if (pinfo->state.ddf.v.pd_type.is_foreign) {
+			warnx("Drive %u is foreign", device_id);
+			free(info->drives);
+			info->drives = NULL;
+			return (EINVAL);
+		}
 	}
 
 	return (0);
@@ -804,7 +813,7 @@ create_volume(int ac, char **av)
 
 #ifdef DEBUG
 	if (dump)
-		dump_config(fd, config);
+		dump_config(fd, config, NULL);
 #endif
 
 	/* Send the new config to the controller. */
@@ -1093,10 +1102,9 @@ remove_spare(int ac, char **av)
 }
 MFI_COMMAND(top, remove, remove_spare);
 
-#ifdef DEBUG
 /* Display raw data about a config. */
-static void
-dump_config(int fd, struct mfi_config_data *config)
+void
+dump_config(int fd, struct mfi_config_data *config, const char *msg_prefix)
 {
 	struct mfi_array *ar;
 	struct mfi_ld_config *ld;
@@ -1106,9 +1114,12 @@ dump_config(int fd, struct mfi_config_da
 	char *p;
 	int i, j;
 
+	if (NULL == msg_prefix)
+		msg_prefix = "Configuration (Debug)";
+
 	printf(
-	    "mfi%d Configuration (Debug): %d arrays, %d volumes, %d spares\n",
-	    mfi_unit, config->array_count, config->log_drv_count,
+	    "mfi%d %s: %d arrays, %d volumes, %d spares\n", mfi_unit,
+	    msg_prefix, config->array_count, config->log_drv_count,
 	    config->spares_count);
 	printf("  array size: %u\n", config->array_size);
 	printf("  volume size: %u\n", config->log_drv_size);
@@ -1186,6 +1197,7 @@ dump_config(int fd, struct mfi_config_da
 	}
 }
 
+#ifdef DEBUG
 static int
 debug_config(int ac, char **av)
 {
@@ -1213,7 +1225,7 @@ debug_config(int ac, char **av)
 	}
 
 	/* Dump out the configuration. */
-	dump_config(fd, config);
+	dump_config(fd, config, NULL);
 	free(config);
 	close(fd);
 
@@ -1265,7 +1277,7 @@ dump(int ac, char **av)
 		close(fd);
 		return (error);
 	}
-	dump_config(fd, config);
+	dump_config(fd, config, NULL);
 	free(config);
 	close(fd);
 

Copied: stable/9/usr.sbin/mfiutil/mfi_foreign.c (from r251516, head/usr.sbin/mfiutil/mfi_foreign.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/9/usr.sbin/mfiutil/mfi_foreign.c	Fri Jul 12 02:26:15 2013	(r253244, copy of r251516, head/usr.sbin/mfiutil/mfi_foreign.c)
@@ -0,0 +1,364 @@
+/*
+ * Copyright (c) 2013 smh@freebsd.org
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "mfiutil.h"
+
+MFI_TABLE(top, foreign);
+
+static int
+foreign_clear(__unused int ac, __unused char **av)
+{
+	int ch, error, fd;
+
+	fd = mfi_open(mfi_unit, O_RDWR);
+	if (fd < 0) {
+		error = errno;
+		warn("mfi_open");
+		return (error);
+	}
+
+	printf(
+	    "Are you sure you wish to clear ALL foreign configurations"
+	    " on mfi%u? [y/N] ", mfi_unit);
+
+	ch = getchar();
+	if (ch != 'y' && ch != 'Y') {
+		printf("\nAborting\n");
+		close(fd);
+		return (0);
+	}
+
+	if (mfi_dcmd_command(fd, MFI_DCMD_CFG_FOREIGN_CLEAR, NULL, 0, NULL,
+	    0, NULL) < 0) {
+		error = errno;
+		warn("Failed to clear foreign configuration");
+		close(fd);
+		return (error);
+	}
+
+	printf("mfi%d: Foreign configuration cleared\n", mfi_unit);
+	close(fd);
+	return (0);
+}
+MFI_COMMAND(foreign, clear, foreign_clear);
+
+static int
+foreign_scan(__unused int ac, __unused char **av)
+{
+	struct mfi_foreign_scan_info info;
+	int error, fd;
+
+	fd = mfi_open(mfi_unit, O_RDONLY);
+	if (fd < 0) {
+		error = errno;
+		warn("mfi_open");
+		return (error);
+	}
+
+	if (mfi_dcmd_command(fd, MFI_DCMD_CFG_FOREIGN_SCAN, &info,
+	    sizeof(info), NULL, 0, NULL) < 0) {
+		error = errno;
+		warn("Failed to scan foreign configuration");
+		close(fd);
+		return (error);
+	}
+
+	printf("mfi%d: Found %d foreign configurations\n", mfi_unit,
+	       info.count);
+	close(fd);
+	return (0);
+}
+MFI_COMMAND(foreign, scan, foreign_scan);
+
+static int
+foreign_show_cfg(int fd, uint32_t opcode, uint8_t cfgidx, int diagnostic)
+{
+	struct mfi_config_data *config;
+	char prefix[26];
+	int error;
+	uint8_t mbox[4];
+
+	bzero(mbox, sizeof(mbox));
+	mbox[0] = cfgidx;
+	if (mfi_config_read_opcode(fd, opcode, &config, mbox, sizeof(mbox)) < 0) {
+		error = errno;
+		warn("Failed to get foreign config %d", error);
+		close(fd);
+		return (error);
+	}
+
+	if (opcode == MFI_DCMD_CFG_FOREIGN_PREVIEW)
+		sprintf(prefix, "Foreign configuration preview %d", cfgidx);
+	else
+		sprintf(prefix, "Foreign configuration %d", cfgidx);
+	/*
+	 * MegaCli uses DCMD opcodes: 0x03100200 (which fails) followed by
+	 * 0x1a721880 which returns what looks to be drive / volume info
+	 * but we have no real information on what these are or what they do
+	 * so we're currently relying solely on the config returned above
+	 */
+	if (diagnostic)
+		dump_config(fd, config, prefix);
+	else {
+		char *ld_list;
+		int i;
+
+		ld_list = (char *)(config->array);
+
+        	printf("%s: %d arrays, %d volumes, %d spares\n", prefix, 
+		       config->array_count, config->log_drv_count,
+		       config->spares_count);
+
+
+		for (i = 0; i < config->array_count; i++)
+			 ld_list += config->array_size;
+
+		for (i = 0; i < config->log_drv_count; i++) {
+        		const char *level;
+        		char size[6], stripe[5];
+			struct mfi_ld_config *ld;
+
+			ld = (struct mfi_ld_config *)ld_list;
+
+        		format_stripe(stripe, sizeof(stripe),
+            			ld->params.stripe_size);
+			/*
+			 * foreign configs don't seem to have a secondary raid level
+			 * but, we can use span depth here as if a LD spans multiple
+			 * arrays of disks (2 raid 1 sets for example), we will have an
+			 * indication based on the spam depth. swb
+			 */ 
+        		level = mfi_raid_level(ld->params.primary_raid_level,
+            					(ld->params.span_depth - 1));
+
+        		humanize_number(size, sizeof(size), ld->span[0].num_blocks * 512,
+            			"", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
+
+			printf(" ID%d ", i);
+              		printf("(%6s) %-8s |",
+				size, level);
+			printf("volume spans %d %s\n",	ld->params.span_depth,
+							(ld->params.span_depth > 1) ? "arrays" : "array");
+			for (int j = 0; j < ld->params.span_depth; j++) {
+				char *ar_list;
+				struct mfi_array *ar;
+				uint16_t device_id;
+
+				printf("      array %u @ ", ld->span[j].array_ref);
+        			humanize_number(size, sizeof(size), ld->span[j].num_blocks * 512,
+            				"", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
+				
+				printf("(%6s)\n",size);
+				ar_list = (char *)config->array + (ld->span[j].array_ref * config->array_size);
+
+				ar = (struct mfi_array *)ar_list;
+				for (int k = 0; k < ar->num_drives; k++) {
+					device_id = ar->pd[k].ref.v.device_id;
+					if (device_id == 0xffff)
+						printf("        drive MISSING\n");
+					else {
+						printf("        drive %u %s\n", device_id,
+			    				mfi_pdstate(ar->pd[k].fw_state));
+					}
+				}
+
+			}
+			ld_list += config->log_drv_size;
+		}
+	}
+
+	free(config);
+
+	return (0);
+}
+
+int
+display_format(int ac, char **av, int diagnostic, mfi_dcmd_t display_cmd)
+{
+	struct mfi_foreign_scan_info info;
+	uint8_t i;
+	int error, fd;
+
+	if (ac > 2) {
+		warnx("foreign display: extra arguments");
+                return (EINVAL);
+	}
+
+	fd = mfi_open(mfi_unit, O_RDONLY);
+	if (fd < 0) {
+		error = errno;
+		warn("mfi_open");
+		return (error);
+	}
+
+	if (mfi_dcmd_command(fd, MFI_DCMD_CFG_FOREIGN_SCAN, &info,
+	    sizeof(info), NULL, 0, NULL) < 0) {
+		error = errno;
+		warn("Failed to scan foreign configuration");
+		close(fd);
+		return (error);
+	}
+
+	if (info.count == 0) {
+		warnx("foreign display: no foreign configs found");
+		close(fd);
+		return (EINVAL);
+	}
+
+	if (ac == 1) {
+		for (i = 0; i < info.count; i++) {
+			error = foreign_show_cfg(fd,
+				display_cmd, i, diagnostic);
+			if(error != 0) {
+				close(fd);
+				return (error);
+			}
+			if (i < info.count - 1)
+				printf("\n");
+		}
+	} else if (ac == 2) {
+		error = foreign_show_cfg(fd,
+			display_cmd, atoi(av[1]), diagnostic);
+		if (error != 0) {
+			close(fd);
+			return (error);
+		}
+	}
+	
+	close(fd);
+	return (0);
+}
+
+static int
+foreign_display(int ac, char **av)
+{
+	return(display_format(ac, av, 1/*diagnostic output*/, MFI_DCMD_CFG_FOREIGN_DISPLAY));
+}
+MFI_COMMAND(foreign, diag, foreign_display);
+
+static int
+foreign_preview(int ac, char **av)
+{
+	return(display_format(ac, av, 1/*diagnostic output*/, MFI_DCMD_CFG_FOREIGN_PREVIEW));
+}
+MFI_COMMAND(foreign, preview, foreign_preview);
+
+static int
+foreign_import(int ac, char **av)
+{
+	struct mfi_foreign_scan_info info;
+	int ch, error, fd;
+	uint8_t cfgidx;
+	uint8_t mbox[4];
+
+	if (ac > 2) {
+		warnx("foreign preview: extra arguments");
+                return (EINVAL);
+	}
+
+	fd = mfi_open(mfi_unit, O_RDWR);
+	if (fd < 0) {
+		error = errno;
+		warn("mfi_open");
+		return (error);
+	}
+
+	if (mfi_dcmd_command(fd, MFI_DCMD_CFG_FOREIGN_SCAN, &info,
+	    sizeof(info), NULL, 0, NULL) < 0) {
+		error = errno;
+		warn("Failed to scan foreign configuration");
+		close(fd);
+		return (error);
+	}
+
+	if (info.count == 0) {
+		warnx("foreign import: no foreign configs found");
+		close(fd);
+		return (EINVAL);
+	}
+
+	if (ac == 1) {
+		cfgidx = 0xff;
+		printf("Are you sure you wish to import ALL foreign "
+		       "configurations on mfi%u? [y/N] ", mfi_unit);
+	} else {
+		/*
+		 * While this is docmmented for MegaCli this failed with
+		 * exit code 0x03 on the test controller which was a Supermicro
+		 * SMC2108 with firmware 12.12.0-0095 which is a LSI 2108 based
+		 * controller.
+		 */
+		cfgidx = atoi(av[1]);
+		if (cfgidx >= info.count) {
+			warnx("Invalid foreign config %d specified max is %d",
+			      cfgidx, info.count - 1);
+			close(fd);
+			return (EINVAL);
+		}
+		printf("Are you sure you wish to import the foreign "
+		       "configuration %d on mfi%u? [y/N] ", cfgidx, mfi_unit);
+	}
+
+	ch = getchar();
+	if (ch != 'y' && ch != 'Y') {
+		printf("\nAborting\n");
+		close(fd);
+		return (0);
+	}
+
+	bzero(mbox, sizeof(mbox));
+	mbox[0] = cfgidx;
+	if (mfi_dcmd_command(fd, MFI_DCMD_CFG_FOREIGN_IMPORT, NULL, 0, mbox,
+	    sizeof(mbox), NULL) < 0) {
+		error = errno;
+		warn("Failed to import foreign configuration");
+		close(fd);
+		return (error);
+	}
+
+	if (ac == 1)
+		printf("mfi%d: All foreign configurations imported\n",
+		       mfi_unit);
+	else
+		printf("mfi%d: Foreign configuration %d imported\n", mfi_unit,
+		       cfgidx);
+	close(fd);
+	return (0);
+}
+MFI_COMMAND(foreign, import, foreign_import);

Modified: stable/9/usr.sbin/mfiutil/mfi_show.c
==============================================================================
--- stable/9/usr.sbin/mfiutil/mfi_show.c	Fri Jul 12 02:11:42 2013	(r253243)
+++ stable/9/usr.sbin/mfiutil/mfi_show.c	Fri Jul 12 02:26:15 2013	(r253244)
@@ -40,9 +40,11 @@
 #include 
 #include "mfiutil.h"
 
+static const char* foreign_state = " (FOREIGN)";
+
 MFI_TABLE(top, show);
 
-static void
+void
 format_stripe(char *buf, size_t buflen, uint8_t stripe)
 {
 
@@ -291,7 +293,7 @@ show_battery(int ac, char **av __unused)
 }
 MFI_COMMAND(show, battery, show_battery);
 
-static void
+void
 print_ld(struct mfi_ld_info *info, int state_len)
 {
 	struct mfi_ld_params *params = &info->ld_config.params;
@@ -312,19 +314,24 @@ print_ld(struct mfi_ld_info *info, int s
 		    mfi_ldstate(params->state));
 }
 
-static void
+void
 print_pd(struct mfi_pd_info *info, int state_len)
 {
 	const char *s;
-	char buf[6];
+	char buf[256];
 
 	humanize_number(buf, sizeof(buf), info->raw_size * 512, "",
 	    HN_AUTOSCALE, HN_B | HN_NOSPACE |HN_DECIMAL);
 	printf("(%6s) ", buf);
+	if (info->state.ddf.v.pd_type.is_foreign) {
+		sprintf(buf, "%s%s", mfi_pdstate(info->fw_state), foreign_state);
+		s = buf;
+	} else
+		s = mfi_pdstate(info->fw_state);
 	if (state_len > 0)
-		printf("%-*s", state_len, mfi_pdstate(info->fw_state));
+		printf("%-*s", state_len, s);
 	else
-		printf("%s", mfi_pdstate(info->fw_state));
+		printf("%s",s);
 	s = mfi_pd_inq_string(info);
 	if (s != NULL)
 		printf(" %s", s);
@@ -560,6 +567,8 @@ show_drives(int ac, char **av __unused)
 			goto error;
 		}
 		len = strlen(mfi_pdstate(info.fw_state));
+		if (info.state.ddf.v.pd_type.is_foreign)
+			len += strlen(foreign_state);
 		if (len > state_len)
 			state_len = len;
 	}
@@ -787,7 +796,7 @@ show_progress(int ac, char **av __unused
 			printf("drive %s ", mfi_drive_name(NULL, device_id,
 			    MFI_DNAME_DEVICE_ID|MFI_DNAME_HONOR_OPTS));
 			mfi_display_progress("Clear", &pinfo.prog_info.clear);
-			busy = 1;
+			
 		}
 	}
 
@@ -800,3 +809,10 @@ show_progress(int ac, char **av __unused
 	return (0);
 }
 MFI_COMMAND(show, progress, show_progress);
+
+static int
+show_foreign(int ac, char **av)
+{
+	return(display_format(ac, av, 0/*normal display*/, MFI_DCMD_CFG_FOREIGN_DISPLAY));
+}
+MFI_COMMAND(show, foreign, show_foreign);

Modified: stable/9/usr.sbin/mfiutil/mfiutil.8
==============================================================================
--- stable/9/usr.sbin/mfiutil/mfiutil.8	Fri Jul 12 02:11:42 2013	(r253243)
+++ stable/9/usr.sbin/mfiutil/mfiutil.8	Fri Jul 12 02:26:15 2013	(r253244)
@@ -63,6 +63,9 @@
 .Cm show firmware
 .Nm
 .Op Fl u Ar unit
+.Cm show foreign Op Ar volume
+.Nm
+.Op Fl u Ar unit
 .Cm show logstate
 .Nm
 .Op Fl d
@@ -140,6 +143,21 @@
 .Cm patrol Ar command Op Ar interval Op Ar start
 .Nm
 .Op Fl u Ar unit
+.Cm foreign scan
+.Nm
+.Op Fl u Ar unit
+.Cm foreign clear Op Ar config
+.Nm
+.Op Fl u Ar unit
+.Cm foreign diag Op Ar config
+.Nm
+.Op Fl u Ar unit
+.Cm foreign preview Op Ar config
+.Nm
+.Op Fl u Ar unit
+.Cm foreign import Op Ar config
+.Nm
+.Op Fl u Ar unit
 .Cm flash Ar file
 .Nm
 .Op Fl u Ar unit
@@ -321,6 +339,8 @@ The entry in the event log corresponding
 .El
 .It Cm show firmware
 Lists all of the firmware images present on the controller.
+.It Cm show foreign
+Displays detected foreign configurations on disks for importation or removal.
 .It Cm show logstate
 Display the various sequence numbers associated with the event log.
 .It Cm show patrol
@@ -567,6 +587,35 @@ Enable manual patrol reads that are only
 Start a patrol read operation.
 .It Cm stop patrol
 Stop a currently running patrol read operation.
+.It Cm foreign scan
+Scan for foreign configurations and display the number found. The
+.Ar config
+argument for the commands below takes the form of a number from 0 to the total
+configurations found.
+.It Cm foreign clear Op config
+Clear the specifed foreign
+.Ar config
+or all if no
+.Ar config
+argument is provided.
+.It Cm foreign diag Op config
+Display a diagnostic display of the specifed foreign
+.Ar config
+or all if no
+.Ar config
+argument is provided.
+.It Cm foreign preview Op config
+Preview the specifed foreign
+.Ar config
+after import or all if no
+.Ar config
+argument is provided.
+.It Cm foreign import Op config
+Import the specifed foreign
+.Ar config
+or all if no
+.Ar config
+argument is provided.
 .It Cm flash Ar file
 Updates the flash on the controller with the firmware stored in
 .Ar file .
@@ -635,6 +684,9 @@ patrol read starting in 5 minutes:
 .Pp
 .Dl Nm Cm patrol auto 604800 300
 .Pp
+Display the second detected foreign configuration:
+.Pp
+.Dl Nm Cm show foreign 1
 .Sh SEE ALSO
 .Xr mfi 4
 .Sh HISTORY

Modified: stable/9/usr.sbin/mfiutil/mfiutil.c
==============================================================================
--- stable/9/usr.sbin/mfiutil/mfiutil.c	Fri Jul 12 02:11:42 2013	(r253243)
+++ stable/9/usr.sbin/mfiutil/mfiutil.c	Fri Jul 12 02:26:15 2013	(r253244)
@@ -60,6 +60,7 @@ usage(void)
 	fprintf(stderr, "    show drives               - list physical drives\n");
 	fprintf(stderr, "    show events               - display event log\n");
 	fprintf(stderr, "    show firmware             - list firmware images\n");
+	fprintf(stderr, "    show foreign              - display detected foreign volumes\n");
 	fprintf(stderr, "    show logstate             - display event log sequence numbers\n");
 	fprintf(stderr, "    show volumes              - list logical volumes\n");
 	fprintf(stderr, "    show patrol               - display patrol read status\n");
@@ -83,6 +84,11 @@ usage(void)
 	fprintf(stderr, "    patrol  [interval [start]]\n");
 	fprintf(stderr, "    start patrol              - start a patrol read\n");
 	fprintf(stderr, "    stop patrol               - stop a patrol read\n");
+	fprintf(stderr, "    foreign scan              - scan for foreign configurations\n");
+	fprintf(stderr, "    foreign clear [volume]    - clear foreign configurations (default all)\n");
+	fprintf(stderr, "    foreign diag [volume]     - diagnostic display foreign configurations (default all)\n");
+	fprintf(stderr, "    foreign preview [volume]  - preview foreign configurations (default all)\n");
+	fprintf(stderr, "    foreign import [volume]   - import foreign configurations (default all)\n");
 	fprintf(stderr, "    flash \n");
 	fprintf(stderr, "    start learn               - start a BBU relearn\n");
 	fprintf(stderr, "    bbu       - set BBU properties\n");

Modified: stable/9/usr.sbin/mfiutil/mfiutil.h
==============================================================================
--- stable/9/usr.sbin/mfiutil/mfiutil.h	Fri Jul 12 02:11:42 2013	(r253243)
+++ stable/9/usr.sbin/mfiutil/mfiutil.h	Fri Jul 12 02:26:15 2013	(r253244)
@@ -123,6 +123,16 @@ struct mfiutil_command {
 extern int mfi_unit;
 extern u_int mfi_opts;
 
+/* We currently don't know the full details of the following struct */
+struct mfi_foreign_scan_cfg {
+        char data[24];
+};
+
+struct mfi_foreign_scan_info {
+        uint32_t count; /* Number of foreign configs found */
+        struct mfi_foreign_scan_cfg cfgs[8];
+};
+
 void	mbox_store_ldref(uint8_t *mbox, union mfi_ld_ref *ref);
 void	mbox_store_pdref(uint8_t *mbox, union mfi_pd_ref *ref);
 void	mfi_display_progress(const char *label, struct mfi_progress *prog);
@@ -135,6 +145,8 @@ const char *mfi_pd_inq_string(struct mfi
 const char *mfi_volume_name(int fd, uint8_t target_id);
 int	mfi_volume_busy(int fd, uint8_t target_id);
 int	mfi_config_read(int fd, struct mfi_config_data **configp);
+int	mfi_config_read_opcode(int fd, uint32_t opcode,
+    struct mfi_config_data **configp, uint8_t *mbox, size_t mboxlen);
 int	mfi_lookup_drive(int fd, char *drive, uint16_t *device_id);
 int	mfi_lookup_volume(int fd, const char *name, uint8_t *target_id);
 int	mfi_dcmd_command(int fd, uint32_t opcode, void *buf, size_t bufsize,
@@ -151,6 +163,10 @@ int	mfi_reconfig_supported(void);
 const char *mfi_status(u_int status_code);
 const char *mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id,
     uint32_t def);
+void	format_stripe(char *buf, size_t buflen, uint8_t stripe);
+void	print_ld(struct mfi_ld_info *info, int state_len);
+void	print_pd(struct mfi_pd_info *info, int state_len);
+void	dump_config(int fd, struct mfi_config_data *config, const char *msg_prefix);
 int	mfi_bbu_get_props(int fd, struct mfi_bbu_properties *props,
 	    uint8_t *statusp);
 int	mfi_bbu_set_props(int fd, struct mfi_bbu_properties *props,
@@ -159,4 +175,5 @@ void	mfi_autolearn_period(uint32_t, char
 void	mfi_next_learn_time(uint32_t, char *, size_t);
 void	mfi_autolearn_mode(uint8_t, char *, size_t);
 
+int	display_format(int ac, char **av, int diagnostic, mfi_dcmd_t display_cmd);
 #endif /* !__MFIUTIL_H__ */

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 02:28:02 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 2680435B;
 Fri, 12 Jul 2013 02:28:02 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 1846A128C;
 Fri, 12 Jul 2013 02:28:02 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C2S1u4016300;
 Fri, 12 Jul 2013 02:28:01 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C2S1b9016299;
 Fri, 12 Jul 2013 02:28:01 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307120228.r6C2S1b9016299@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 12 Jul 2013 02:28:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253245 - stable/9/sys/dev/hme
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 02:28:02 -0000

Author: yongari
Date: Fri Jul 12 02:28:01 2013
New Revision: 253245
URL: http://svnweb.freebsd.org/changeset/base/253245

Log:
  MFC r253134:
    Avoid controller reinitialization which could be triggered by
    dhclient(8) or alias addresses are added.

Modified:
  stable/9/sys/dev/hme/if_hme.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/hme/if_hme.c
==============================================================================
--- stable/9/sys/dev/hme/if_hme.c	Fri Jul 12 02:26:15 2013	(r253244)
+++ stable/9/sys/dev/hme/if_hme.c	Fri Jul 12 02:28:01 2013	(r253245)
@@ -742,6 +742,10 @@ hme_init_locked(struct hme_softc *sc)
 	u_int32_t n, v;
 
 	HME_LOCK_ASSERT(sc, MA_OWNED);
+
+	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+		return;
+
 	/*
 	 * Initialization sequence. The numbered steps below correspond
 	 * to the sequence outlined in section 6.3.5.1 in the Ethernet
@@ -1324,6 +1328,7 @@ hme_eint(struct hme_softc *sc, u_int sta
 	/* check for fatal errors that needs reset to unfreeze DMA engine */
 	if ((status & HME_SEB_STAT_FATAL_ERRORS) != 0) {
 		HME_WHINE(sc->sc_dev, "error signaled, status=%#x\n", status);
+		sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 		hme_init_locked(sc);
 	}
 }
@@ -1370,6 +1375,7 @@ hme_watchdog(struct hme_softc *sc)
 		device_printf(sc->sc_dev, "device timeout (no link)\n");
 	++ifp->if_oerrors;
 
+	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 	hme_init_locked(sc);
 	hme_start_locked(ifp);
 	return (EJUSTRETURN);

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 02:28:36 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 3996A48A;
 Fri, 12 Jul 2013 02:28:36 +0000 (UTC)
 (envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 2BF191291;
 Fri, 12 Jul 2013 02:28:36 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C2SaTj016402;
 Fri, 12 Jul 2013 02:28:36 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C2SaO5016401;
 Fri, 12 Jul 2013 02:28:36 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201307120228.r6C2SaO5016401@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Fri, 12 Jul 2013 02:28:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253246 - stable/8/sys/dev/hme
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 02:28:36 -0000

Author: yongari
Date: Fri Jul 12 02:28:35 2013
New Revision: 253246
URL: http://svnweb.freebsd.org/changeset/base/253246

Log:
  MFC r253134:
    Avoid controller reinitialization which could be triggered by
    dhclient(8) or alias addresses are added.

Modified:
  stable/8/sys/dev/hme/if_hme.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/hme/   (props changed)

Modified: stable/8/sys/dev/hme/if_hme.c
==============================================================================
--- stable/8/sys/dev/hme/if_hme.c	Fri Jul 12 02:28:01 2013	(r253245)
+++ stable/8/sys/dev/hme/if_hme.c	Fri Jul 12 02:28:35 2013	(r253246)
@@ -742,6 +742,10 @@ hme_init_locked(struct hme_softc *sc)
 	u_int32_t n, v;
 
 	HME_LOCK_ASSERT(sc, MA_OWNED);
+
+	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
+		return;
+
 	/*
 	 * Initialization sequence. The numbered steps below correspond
 	 * to the sequence outlined in section 6.3.5.1 in the Ethernet
@@ -1324,6 +1328,7 @@ hme_eint(struct hme_softc *sc, u_int sta
 	/* check for fatal errors that needs reset to unfreeze DMA engine */
 	if ((status & HME_SEB_STAT_FATAL_ERRORS) != 0) {
 		HME_WHINE(sc->sc_dev, "error signaled, status=%#x\n", status);
+		sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 		hme_init_locked(sc);
 	}
 }
@@ -1370,6 +1375,7 @@ hme_watchdog(struct hme_softc *sc)
 		device_printf(sc->sc_dev, "device timeout (no link)\n");
 	++ifp->if_oerrors;
 
+	ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
 	hme_init_locked(sc);
 	hme_start_locked(ifp);
 	return (EJUSTRETURN);

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 02:36:01 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 152AB61D;
 Fri, 12 Jul 2013 02:36:01 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 06DEA12C0;
 Fri, 12 Jul 2013 02:36:01 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C2a0BI018968;
 Fri, 12 Jul 2013 02:36:00 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C2a0nQ018966;
 Fri, 12 Jul 2013 02:36:00 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120236.r6C2a0nQ018966@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 02:36:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253247 - head/lib/libgeom
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 02:36:01 -0000

Author: hrs
Date: Fri Jul 12 02:36:00 2013
New Revision: 253247
URL: http://svnweb.freebsd.org/changeset/base/253247

Log:
  Use strtoumax() instead of strtoul() for id/ref attr in XML elements.
  This improves compatibility when running an ILP32 binary on LP64 kernel.
  
  Spotted by:	gjb

Modified:
  head/lib/libgeom/geom_xml2tree.c

Modified: head/lib/libgeom/geom_xml2tree.c
==============================================================================
--- head/lib/libgeom/geom_xml2tree.c	Fri Jul 12 02:28:35 2013	(r253246)
+++ head/lib/libgeom/geom_xml2tree.c	Fri Jul 12 02:36:00 2013	(r253247)
@@ -75,10 +75,10 @@ StartElement(void *userData, const char 
 	ref = NULL;
 	for (i = 0; attr[i] != NULL; i += 2) {
 		if (!strcmp(attr[i], "id")) {
-			id = (void *)strtoul(attr[i + 1], NULL, 0);
+			id = (void *)strtoumax(attr[i + 1], NULL, 0);
 			mt->nident++;
 		} else if (!strcmp(attr[i], "ref")) {
-			ref = (void *)strtoul(attr[i + 1], NULL, 0);
+			ref = (void *)strtoumax(attr[i + 1], NULL, 0);
 		} else
 			printf("%*.*s[%s = %s]\n",
 			    mt->level + 1, mt->level + 1, "",

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 02:42:38 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 48DEC7A5;
 Fri, 12 Jul 2013 02:42:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 2190312E2;
 Fri, 12 Jul 2013 02:42:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C2gclc021383;
 Fri, 12 Jul 2013 02:42:38 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C2gb6j021382;
 Fri, 12 Jul 2013 02:42:37 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201307120242.r6C2gb6j021382@svn.freebsd.org>
From: Glen Barber 
Date: Fri, 12 Jul 2013 02:42:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-svnadmin@freebsd.org
Subject: svn commit: r253248 - svnadmin/conf
X-SVN-Group: svnadmin
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 02:42:38 -0000

Author: gjb
Date: Fri Jul 12 02:42:37 2013
New Revision: 253248
URL: http://svnweb.freebsd.org/changeset/base/253248

Log:
  Begin code freeze for the 9.2-RELEASE cycle.
  
  Approved by:	re (implicit)

Modified:
  svnadmin/conf/approvers

Modified: svnadmin/conf/approvers
==============================================================================
--- svnadmin/conf/approvers	Fri Jul 12 02:36:00 2013	(r253247)
+++ svnadmin/conf/approvers	Fri Jul 12 02:42:37 2013	(r253248)
@@ -17,7 +17,7 @@
 # $FreeBSD$
 #
 #^head/				re
-#^stable/9/			re
+^stable/9/			re
 #^stable/8/			re
 #^stable/7/			re
 ^releng/9.[0-1]/		(security-officer|so)

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 04:22:47 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 7A0D7215;
 Fri, 12 Jul 2013 04:22:47 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 6CB1518B1;
 Fri, 12 Jul 2013 04:22:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C4MlwF052718;
 Fri, 12 Jul 2013 04:22:47 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C4Mlq0052717;
 Fri, 12 Jul 2013 04:22:47 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120422.r6C4Mlq0052717@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 04:22:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253249 - head/lib/libgeom
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 04:22:47 -0000

Author: hrs
Date: Fri Jul 12 04:22:46 2013
New Revision: 253249
URL: http://svnweb.freebsd.org/changeset/base/253249

Log:
  Revert r253247.  This change should be improved based on a lesson learnt
  from r233646 first.
  
  Pointed out by:	jmallett

Modified:
  head/lib/libgeom/geom_xml2tree.c

Modified: head/lib/libgeom/geom_xml2tree.c
==============================================================================
--- head/lib/libgeom/geom_xml2tree.c	Fri Jul 12 02:42:37 2013	(r253248)
+++ head/lib/libgeom/geom_xml2tree.c	Fri Jul 12 04:22:46 2013	(r253249)
@@ -75,10 +75,10 @@ StartElement(void *userData, const char 
 	ref = NULL;
 	for (i = 0; attr[i] != NULL; i += 2) {
 		if (!strcmp(attr[i], "id")) {
-			id = (void *)strtoumax(attr[i + 1], NULL, 0);
+			id = (void *)strtoul(attr[i + 1], NULL, 0);
 			mt->nident++;
 		} else if (!strcmp(attr[i], "ref")) {
-			ref = (void *)strtoumax(attr[i + 1], NULL, 0);
+			ref = (void *)strtoul(attr[i + 1], NULL, 0);
 		} else
 			printf("%*.*s[%s = %s]\n",
 			    mt->level + 1, mt->level + 1, "",

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 05:39:52 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 3EBA5E0E;
 Fri, 12 Jul 2013 05:39:52 +0000 (UTC)
 (envelope-from Andre.Albsmeier@siemens.com)
Received: from goliath.siemens.de (goliath.siemens.de [192.35.17.28])
 by mx1.freebsd.org (Postfix) with ESMTP id BA7B81AB8;
 Fri, 12 Jul 2013 05:39:51 +0000 (UTC)
Received: from mail2.siemens.de (localhost [127.0.0.1])
 by goliath.siemens.de (8.13.6/8.13.6) with ESMTP id r6C5doOe027166;
 Fri, 12 Jul 2013 07:39:50 +0200
Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130])
 by mail2.siemens.de (8.13.6/8.13.6) with ESMTP id r6C5dot2005087;
 Fri, 12 Jul 2013 07:39:50 +0200
Received: (from localhost)
 by curry.mchp.siemens.de (8.14.7/8.14.7) id r6C5dorw051492;
Date: Fri, 12 Jul 2013 07:39:50 +0200
From: Andre Albsmeier 
To: "Kenneth D. Merry" 
Subject: Re: svn commit: r252214 - in stable/9: bin/chio sys/cam/scsi sys/sys
Message-ID: <20130712053950.GA97972@bali>
References: <201306252143.r5PLhoM0064338@svn.freebsd.org>
 <20130702055333.GA2729@bali>
 <20130703052236.GA65730@nargothrond.kdm.org>
 <20130703054349.GA13656@bali>
 <20130710184915.GA28790@nargothrond.kdm.org>
 <20130710185833.GA83135@bali>
 <20130711205332.GA26100@nargothrond.kdm.org>
 <20130711220211.GA30392@nargothrond.kdm.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20130711220211.GA30392@nargothrond.kdm.org>
X-Echelon: 
X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses!
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: "src-committers@freebsd.org" ,
 "asomers@freebsd.org" , "Albsmeier,
 Andre" ,
 "svn-src-stable@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "svn-src-stable-9@freebsd.org" ,
 "gibbs@freebsd.org" 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 05:39:52 -0000

On Fri, 12-Jul-2013 at 00:02:11 +0200, Kenneth D. Merry wrote:
> On Thu, Jul 11, 2013 at 14:53:32 -0600, Kenneth D. Merry wrote:
> > On Wed, Jul 10, 2013 at 20:58:33 +0200, Andre Albsmeier wrote:
> > > On Wed, 10-Jul-2013 at 20:49:15 +0200, Kenneth D. Merry wrote:
> > > > On Wed, Jul 03, 2013 at 07:43:49 +0200, Andre Albsmeier wrote:
> > > > > On Wed, 03-Jul-2013 at 07:22:36 +0200, Kenneth D. Merry wrote:
> > > > > > On Tue, Jul 02, 2013 at 07:53:33 +0200, Andre Albsmeier wrote:
> > > > > > > On Tue, 25-Jun-2013 at 23:43:50 +0200, Kenneth D. Merry wrote:
> > > > > > > > Author: ken
> > > > > > > > Date: Tue Jun 25 21:43:49 2013
> > > > > > > > New Revision: 252214
> > > > > > > > URL: http://svnweb.freebsd.org/changeset/base/252214
> > > > > > > 
> > > > > > > Hi Ken,
> > > > > > > 
> > > > > > > > Log:
> > > > > > > >   MFC: 249658, 249701
> > > > > > > > 
> > > > > > > >   Update chio(1) and ch(4) to support reporting element designators.
> > > > > > > > 
> > > > > > > >   This allows mapping a tape drive in a changer (as reported by
> > > > > > > >   'chio status') to a sa(4) driver instance by comparing the
> > > > > > > >   serial numbers.
> > > > > > > > 
> > > > > > > >   The designators can be ASCII (which is printed out directly), binary
> > > > > > > >   (which is printed in hex format) or UTF-8, which is printed in either
> > > > > > > >   native UTF-8 format if the terminal can support it, or in %XX notation
> > > > > > > >   for non-ASCII characters.  Thanks to Hiroki Sato  for the
> > > > > > > >   explanation and example UTF-8 printing code.
> > > > > > > > 
> > > > > > > >   chio.h:               Modify the changer_element_status structure to add new
> > > > > > > >                 fields and definitions from the SMC3r16 spec.
> > > > > > > > 
> > > > > > > >                 Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and
> > > > > > > >                 define a new CHIOGSTATUS ioctl.
> > > > > > > > 
> > > > > > > >                 Clean up some tab/space issues.
> > > > > > > > 
> > > > > > > >   chio.c:       For the 'status' subcommand, print the designator field
> > > > > > > >                 if it is supplied by a device.
> > > > > > > > 
> > > > > > > >   scsi_ch.h:    Add new flags for DVCID and CURDATA to the READ
> > > > > > > >                 ELEMENT STATUS command structure.
> > > > > > > > 
> > > > > > > >                 Add a read_element_status_device_id structure
> > > > > > > >                 for the data fields in the new standard. Add new
> > > > > > > >                 unions, dt_or_obsolete and voltage_devid, to hold
> > > > > > > >                 and address data from either SCSI-2 or newer devices.
> > > > > > > > 
> > > > > > > >   scsi_ch.c:    Implement support for fetching device IDs with READ
> > > > > > > >                 ELEMENT STATUS data.
> > > > > > > > 
> > > > > > > >                 Add new arguments to scsi_read_element_status() to
> > > > > > > >                 allow the user to request the DVCID and CURDATA bits.
> > > > > > > 
> > > > > > > This broke "chio status" when talking to my QUALSTAR TLS-8211 library:
> > > > > > > 
> > > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): READ ELEMENT STATUS. CDB: b8 10 fd e8 00 01 03 00 04 00 00 00
> > > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): CAM status: SCSI Status Error
> > > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): SCSI status: Check Condition
> > > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
> > > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): Command byte 6 is invalid
> > > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): Error 22, Unretryable error
> > > > > > > 
> > > > > > > scsi_cmd->flags (Byte 6) must be zero for this library so I had to use
> > > > > > > this workaround to make it work again until a better solution is available:
> > > > > > > 
> > > > > > > --- sys/cam/scsi/scsi_ch.c.ORI	2013-06-26 13:38:54.000000000 +0200
> > > > > > > +++ sys/cam/scsi/scsi_ch.c	2013-07-02 07:42:24.000000000 +0200
> > > > > > > @@ -1245,8 +1245,8 @@
> > > > > > >  				 /* tag_action */ MSG_SIMPLE_Q_TAG,
> > > > > > >  				 /* voltag */ want_voltags,
> > > > > > >  				 /* sea */ softc->sc_firsts[chet],
> > > > > > > -				 /* dvcid */ 1,
> > > > > > > -				 /* curdata */ 1,
> > > > > > > +				 /* dvcid */ 0,
> > > > > > > +				 /* curdata */ 0,
> > > > > > >  				 /* count */ 1,
> > > > > > >  				 /* data_ptr */ data,
> > > > > > >  				 /* dxfer_len */ 1024,
> > > > > > > @@ -1284,8 +1284,8 @@
> > > > > > >  				 /* voltag */ want_voltags,
> > > > > > >  				 /* sea */ softc->sc_firsts[chet]
> > > > > > >  				 + cesr->cesr_element_base,
> > > > > > > -				 /* dvcid */ 1,
> > > > > > > -				 /* curdata */ 1,
> > > > > > > +				 /* dvcid */ 0,
> > > > > > > +				 /* curdata */ 0,
> > > > > > >  				 /* count */ cesr->cesr_element_count,
> > > > > > >  				 /* data_ptr */ data,
> > > > > > >  				 /* dxfer_len */ size,
> > > > > > > 
> > > > > > > 	-Andre
> > > > > > 
> > > > > > Oops, sorry.
> > > > > > 
> > > > > > We need to check the SCSI version to see whether to set those bits, and
> > > > > > also fall back in case it doesn't work.
> > > > > > 
> > > > > > I am on vacation and have very spotty net access.  I can't do anything
> > > > > > about it until I get back next week.
> > > > > > 
> > > > > > Justin and Alan (CCed) can work on the fix, though.
> > > > > 
> > > > > Take your time, for me it's working right now
> > > > > with the above patch...
> > > > 
> > > > Okay, I'm back and can take a look at this.
> > > 
> > > Welcome back ;-)
> > > 
> > > > 
> > > > Can you send me:
> > > 
> > > Sure, I am happy to help.
> > > 
> > > > 
> > > > camcontrol inquiry ch0 -v
> > > 
> > > pass17:  Removable Changer SCSI-2 device 
> > > pass17: Serial Number 0021009613
> > > pass17: 3.300MB/s transfers
> > > 
> > > > camcontrol cmd ch0 -v -c "12 0 0 0 ff 0" -i 255 "s58 i2 i2 i2 i2 i2 i2 i2 i2"
> > > 
> > > 0 0 0 0 0 0 0 0 
> > 
> > Okay, that was helpful, thanks!
> > 
> > > > 
> > > > I want to see what SCSI version this changer reports.  The second command
> > > > will print out the SCSI version descriptors, if any, that the changer
> > > > reports.
> > > 
> > > In case you need more info just drop me a note.
> > > 
> > > Thanks for looking into this.
> > 
> > Can you try the attached patch, and see how it works for you?
> > 
> > It defaults to not setting those bits for changers that claim to be SCSI-2
> > or below.  And if a SCSI-3 or higher changer returns an Illegal Request
> > type error, it will retry with the bits cleared to see whether that works.
> > 
> > I also bumped the read element status timeout after some testing with a
> > Spectra T-380.
> > 
> > The patch is against head, but stable/9 shouldn't be much different.
> 
> Oops, here is the patch.

Tried "chio status" and "chio move", both work!
dmesg now added a quirk entry for ch0:

 ch0:  Removable Changer SCSI-2 device 
 ch0: 3.300MB/s transfers
 ch0: 11 slots, 1 drive, 1 picker, 1 portal
+ch0: quirks=0x2
 sa0 at ahd3 bus 0 scbus4 target 0 lun 0
 sa0:  Removable Sequential Access SCSI-3 device 
 sa0: 160.000MB/s transfers (80.000MHz DT, offset 126, 16bit)

Thanks,

	-Andre

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 05:45:10 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 15E1F357;
 Fri, 12 Jul 2013 05:45:10 +0000 (UTC)
 (envelope-from grehan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 08BDF1AFF;
 Fri, 12 Jul 2013 05:45:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C5j9UP075902;
 Fri, 12 Jul 2013 05:45:09 GMT (envelope-from grehan@svn.freebsd.org)
Received: (from grehan@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C5j9m1075901;
 Fri, 12 Jul 2013 05:45:09 GMT (envelope-from grehan@svn.freebsd.org)
Message-Id: <201307120545.r6C5j9m1075901@svn.freebsd.org>
From: Peter Grehan 
Date: Fri, 12 Jul 2013 05:45:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253250 - stable/9/sys/kern
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 05:45:10 -0000

Author: grehan
Date: Fri Jul 12 05:45:09 2013
New Revision: 253250
URL: http://svnweb.freebsd.org/changeset/base/253250

Log:
  MFC r245066
  -------------------------------------------------------------------------
  Teach the kernel to recognize that it is executing inside a bhyve virtual
  machine.
  -------------------------------------------------------------------------
  
  This will help a 9.2 guest to run more effectively as a bhyve guest.
  
  Reviewed by:	neel
  Approved by:	re

Modified:
  stable/9/sys/kern/subr_param.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/subr_param.c
==============================================================================
--- stable/9/sys/kern/subr_param.c	Fri Jul 12 04:22:46 2013	(r253249)
+++ stable/9/sys/kern/subr_param.c	Fri Jul 12 05:45:09 2013	(r253250)
@@ -163,6 +163,7 @@ static const char *const vm_bnames[] = {
 	"Plex86",			/* Plex86 */
 	"Bochs",			/* Bochs */
 	"Xen",				/* Xen */
+	"BHYVE",			/* bhyve */
 	"Seabios",			/* KVM */
 	NULL
 };

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 06:03:26 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 37149C1D;
 Fri, 12 Jul 2013 06:03:26 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 29D051BD3;
 Fri, 12 Jul 2013 06:03:26 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C63Qem081505;
 Fri, 12 Jul 2013 06:03:26 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C63QKd081504;
 Fri, 12 Jul 2013 06:03:26 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201307120603.r6C63QKd081504@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Fri, 12 Jul 2013 06:03:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253252 - head/sbin/devfs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 06:03:26 -0000

Author: jh
Date: Fri Jul 12 06:03:25 2013
New Revision: 253252
URL: http://svnweb.freebsd.org/changeset/base/253252

Log:
  Clarify how "hide" and "unhide" commands work on directories.

Modified:
  head/sbin/devfs/devfs.8

Modified: head/sbin/devfs/devfs.8
==============================================================================
--- head/sbin/devfs/devfs.8	Fri Jul 12 05:58:54 2013	(r253251)
+++ head/sbin/devfs/devfs.8	Fri Jul 12 06:03:25 2013	(r253252)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 21, 2013
+.Dd July 12, 2013
 .Dt DEVFS 8
 .Os
 .Sh NAME
@@ -190,6 +190,7 @@ Nodes may later be revived manually with
 or with the
 .Cm unhide
 action.
+Hiding a directory node effectively hides all of its child nodes.
 .It Cm include Ar ruleset
 Apply all the rules in ruleset number
 .Ar ruleset
@@ -213,6 +214,8 @@ which may be a user name
 or number.
 .It Cm unhide
 Unhide the node.
+If the node resides in a subdirectory,
+all parent directory nodes must be visible to be able to access the node.
 .El
 .Sh IMPLEMENTATION NOTES
 Rulesets are created by the kernel at the first reference

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 06:54:29 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id D9B51169;
 Fri, 12 Jul 2013 06:54:29 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id CC3401E89;
 Fri, 12 Jul 2013 06:54:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C6sTuP096025;
 Fri, 12 Jul 2013 06:54:29 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C6sTm3096024;
 Fri, 12 Jul 2013 06:54:29 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307120654.r6C6sTm3096024@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 06:54:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253253 - head/usr.sbin/ypserv
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 06:54:29 -0000

Author: hrs
Date: Fri Jul 12 06:54:29 2013
New Revision: 253253
URL: http://svnweb.freebsd.org/changeset/base/253253

Log:
  Fix a wrong memcpy of struct sockaddr.
  
  Spotted by:	dt71@gmx.com

Modified:
  head/usr.sbin/ypserv/yp_main.c

Modified: head/usr.sbin/ypserv/yp_main.c
==============================================================================
--- head/usr.sbin/ypserv/yp_main.c	Fri Jul 12 06:03:25 2013	(r253252)
+++ head/usr.sbin/ypserv/yp_main.c	Fri Jul 12 06:54:29 2013	(r253253)
@@ -329,9 +329,8 @@ create_service(const int sock, const str
 					return -1;
 				}
 				memset(slep, 0, sizeof(*slep));
-				memcpy(&slep->sle_ss,
-				    (struct sockaddr *)(res->ai_addr),
-				    sizeof(res->ai_addr));
+				memcpy(&slep->sle_ss, res->ai_addr,
+				    res->ai_addrlen);
 				slep->sle_sock = s;
 				SLIST_INSERT_HEAD(&sle_head, slep, sle_next);
 

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 07:43:56 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id B9596FF1;
 Fri, 12 Jul 2013 07:43:56 +0000 (UTC)
 (envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id AC26011EB;
 Fri, 12 Jul 2013 07:43:56 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C7huDB010775;
 Fri, 12 Jul 2013 07:43:56 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C7hu2w010773;
 Fri, 12 Jul 2013 07:43:56 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201307120743.r6C7hu2w010773@svn.freebsd.org>
From: Andre Oppermann 
Date: Fri, 12 Jul 2013 07:43:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253254 - head/sys/netinet
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 07:43:56 -0000

Author: andre
Date: Fri Jul 12 07:43:56 2013
New Revision: 253254
URL: http://svnweb.freebsd.org/changeset/base/253254

Log:
  Unbreak VIMAGE by correctly naming the vnet pointer in struct tcp_syncache.
  
  Reported by:	trociny, rodrigc

Modified:
  head/sys/netinet/tcp_syncache.h

Modified: head/sys/netinet/tcp_syncache.h
==============================================================================
--- head/sys/netinet/tcp_syncache.h	Fri Jul 12 06:54:29 2013	(r253253)
+++ head/sys/netinet/tcp_syncache.h	Fri Jul 12 07:43:56 2013	(r253254)
@@ -118,7 +118,7 @@ struct tcp_syncache {
 	u_int	cache_limit;
 	u_int	rexmt_limit;
 	u_int	hash_secret;
-	struct vnet *sch_vnet;
+	struct vnet *vnet;
 	struct syncookie_secret secret;
 };
 

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 07:47:24 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 2D9F4405
 for ; Fri, 12 Jul 2013 07:47:24 +0000 (UTC)
 (envelope-from andre@freebsd.org)
Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2])
 by mx1.freebsd.org (Postfix) with ESMTP id C1B0D125A
 for ; Fri, 12 Jul 2013 07:47:23 +0000 (UTC)
Received: (qmail 95450 invoked from network); 12 Jul 2013 08:37:49 -0000
Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2])
 (envelope-sender )
 by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP
 for ; 12 Jul 2013 08:37:49 -0000
Message-ID: <51DFB484.1000703@freebsd.org>
Date: Fri, 12 Jul 2013 09:47:16 +0200
From: Andre Oppermann 
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
 rv:17.0) Gecko/20130509 Thunderbird/17.0.6
MIME-Version: 1.0
To: Andre Oppermann 
Subject: Re: svn commit: r253254 - head/sys/netinet
References: <201307120743.r6C7hu2w010773@svn.freebsd.org>
In-Reply-To: <201307120743.r6C7hu2w010773@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
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 07:47:24 -0000

On 12.07.2013 09:43, Andre Oppermann wrote:
> Author: andre
> Date: Fri Jul 12 07:43:56 2013
> New Revision: 253254
> URL: http://svnweb.freebsd.org/changeset/base/253254
>
> Log:
>    Unbreak VIMAGE by correctly naming the vnet pointer in struct tcp_syncache.
>
>    Reported by:	trociny, rodrigc

Sorry for the breakage.  I'm extending my test protocol to include VIMAGE,
INET-only and INET6-only builds.

-- 
Andre


From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 08:03:10 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id C33BC845;
 Fri, 12 Jul 2013 08:03:10 +0000 (UTC)
 (envelope-from rodrigc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 9B7DF130D;
 Fri, 12 Jul 2013 08:03:10 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C83A9B016524;
 Fri, 12 Jul 2013 08:03:10 GMT (envelope-from rodrigc@svn.freebsd.org)
Received: (from rodrigc@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C83ACp016523;
 Fri, 12 Jul 2013 08:03:10 GMT (envelope-from rodrigc@svn.freebsd.org)
Message-Id: <201307120803.r6C83ACp016523@svn.freebsd.org>
From: Craig Rodrigues 
Date: Fri, 12 Jul 2013 08:03:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 08:03:10 -0000

Author: rodrigc
Date: Fri Jul 12 08:03:10 2013
New Revision: 253255
URL: http://svnweb.freebsd.org/changeset/base/253255

Log:
  PR: kern/168520
  Submitted by: "YAMAMOTO, Shigeru" 
  Reviewed by: adrian
  
  In PC-BSD 9.1, VIMAGE is enabled in the kernel config.
  For laptops with Bluetooth capability, such as the HP Elitebook 8460p,
  the kernel will panic upon bootup, because curthread->td_vnet
  is not initialized.
  
  Properly initialize curthread->td_vnet when initializing the Bluetooth stack.
  
  This allows laptops such as the HP Elitebook 8460p laptop
  to properly boot with VIMAGE kernels.

Modified:
  head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c

Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
==============================================================================
--- head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c	Fri Jul 12 07:43:56 2013	(r253254)
+++ head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c	Fri Jul 12 08:03:10 2013	(r253255)
@@ -109,7 +109,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 
 #include "usbdevs.h"
 #include 
@@ -123,6 +125,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -487,13 +490,14 @@ ubt_attach(device_t dev)
 
 	sc->sc_dev = dev;
 	sc->sc_debug = NG_UBT_WARN_LEVEL;
-
+	CURVNET_SET(TD_TO_VNET(curthread));
 	/* 
 	 * Create Netgraph node
 	 */
 
 	if (ng_make_node_common(&typestruct, &sc->sc_node) != 0) {
 		UBT_ALERT(sc, "could not create Netgraph node\n");
+		CURVNET_RESTORE();
 		return (ENXIO);
 	}
 
@@ -501,10 +505,12 @@ ubt_attach(device_t dev)
 	if (ng_name_node(sc->sc_node, device_get_nameunit(dev)) != 0) {
 		UBT_ALERT(sc, "could not name Netgraph node\n");
 		NG_NODE_UNREF(sc->sc_node);
+		CURVNET_RESTORE();
 		return (ENXIO);
 	}
 	NG_NODE_SET_PRIVATE(sc->sc_node, sc);
 	NG_NODE_FORCE_WRITER(sc->sc_node);
+	CURVNET_RESTORE();
 
 	/*
 	 * Initialize device softc structure
@@ -631,8 +637,10 @@ ubt_detach(device_t dev)
 	/* Destroy Netgraph node */
 	if (node != NULL) {
 		sc->sc_node = NULL;
+		CURVNET_SET(node->nd_vnet);
 		NG_NODE_REALLY_DIE(node);
 		ng_rmnode_self(node);
+		CURVNET_RESTORE();
 	}
 
 	/* Make sure ubt_task in gone */

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 08:07:01 2013
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 09EB09E3;
 Fri, 12 Jul 2013 08:07:01 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au
 [211.29.132.246])
 by mx1.freebsd.org (Postfix) with ESMTP id 548921331;
 Fri, 12 Jul 2013 08:07:00 +0000 (UTC)
Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au
 (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23])
 by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id C32B64224C6;
 Fri, 12 Jul 2013 18:06:48 +1000 (EST)
Date: Fri, 12 Jul 2013 18:06:47 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: David Chisnall 
Subject: Re: svn commit: r253215 - head/lib/msun/src
In-Reply-To: <7D521907-4802-4141-9A5E-40EB157A5AEF@FreeBSD.org>
Message-ID: <20130712173951.R5131@besplex.bde.org>
References: <201307111741.r6BHf5gQ060844@svn.freebsd.org>
 <51DEFEF7.4080709@coosemans.org>
 <7D521907-4802-4141-9A5E-40EB157A5AEF@FreeBSD.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.0 cv=K8x6hFqI c=1 sm=1 a=hIML2bcmzLYA:10
 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Aet6fyW9sl8A:10
 a=YqRfAJJkAAAA:8 a=dE5sqkZ3J7ntajQaAuMA:9 a=CjuIK1q_8ugA:10
 a=UIDpq6-GphUA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
 Tijl Coosemans , src-committers@FreeBSD.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 08:07:01 -0000

On Thu, 11 Jul 2013, David Chisnall wrote:

> On 11 Jul 2013, at 19:52, Tijl Coosemans  wrote:
>
>> GCC doesn't support _Generic yet for -std=c11.
>
> Ugh.  Given that they also lack a fine-grained feature check mechanism, they really should not advertise support for a language dialect if they don't support it.
>>
>>> +#elif __GNUC_PREREQ__(5, 1)
>>
>> GCC 3.1?
>
> Ooops, I changed this to 5.1 to test the other code path and forgot to revert it.
>
>> Last __fpclassifyd should be __fpclassifyl.
>
> Fixed.

There are still many style bugs to fix:
- indentation of continuation lines.  It was changed from the normal 4
   spaces to 1 tab in macro definitions.  The style rule for continuation
   lines for #define's is not as clear as for statements, but math.h used
   to use 4 spaces consistently.
- whitespace before backslashes.  It is neither minimal, maximal, lines
   up the backslashes to tab boundaries, lines up the backslashes across
   macros, nor uses tabs.  It repaces formatting that uses tabs to line
   up all backslashes to the 7th tab stop.
- whitespace before macro bodies.  It was changed from the normal 1 tab
   to 1 space.  The next block of macros (for __MATH_BUILTIN_RELOPS)
   provides examples of normal formatting, and the block beginning with
   isfinite() looks really ugly in comparison.
- verbose names, and resulting ugly formatting to avoid long lines
- the x parameter is missing parentheses in the main macros starting at
   fpclassify().  __fp_type_select() supplies the necessary parentheses,
   but this is fragile.

BTW, is it really permitted for the comparison macros to evaluate their
args more than once?  This is done for the !__MATH_BUILTIN_RELOPS case.
I hoped that you replace all the inlines for isnan() by macros, but
now I can't see how to do this without using either multiple evaluation
of the arg or an unportable statement-expression.  However, the relops
already use macros that are sloppy about multiple evaluation in the
!_MATH_BUILTIN_RELOPS case, so math.h would be no more broken if it did
the same for isnan().  isnan() is just a special relop that is even
simpler than the others, but its implementation is more complicated and
10-20 times larger in math.h alone (100 times larger counting all the
compatibility cruft for it in other files).

>>> @@ -227,8 +250,6 @@ double	expm1(double);
>>> double	fma(double, double, double);
>>> double	hypot(double, double);
>>> int	ilogb(double) __pure2;
>>> -int	(isinf)(double) __pure2;
>>> -int	(isnan)(double) __pure2;
>>
>> I think they should stay for the C90 case.
>
> That would completely defeat the point of this entire exercise and be redundant unless we aim to support a compiler that only supports C90 and no GNU extensions, in which case you'll hit errors in cdefs.h, long before you get to this point in an include.

They aren't in C90.  More in another reply.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 09:14:52 2013
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id CEC4F675;
 Fri, 12 Jul 2013 09:14:52 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au
 [211.29.132.53])
 by mx1.freebsd.org (Postfix) with ESMTP id 844711884;
 Fri, 12 Jul 2013 09:14:51 +0000 (UTC)
Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au
 (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23])
 by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id BE5E6D40A7B;
 Fri, 12 Jul 2013 19:14:39 +1000 (EST)
Date: Fri, 12 Jul 2013 19:14:39 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Tijl Coosemans 
Subject: Re: svn commit: r253215 - head/lib/msun/src
In-Reply-To: <51DF14F9.50001@coosemans.org>
Message-ID: <20130712180753.E5131@besplex.bde.org>
References: <201307111741.r6BHf5gQ060844@svn.freebsd.org>
 <51DEFEF7.4080709@coosemans.org>
 <7D521907-4802-4141-9A5E-40EB157A5AEF@FreeBSD.org>
 <51DF0FA5.4050106@coosemans.org> <51DF14F9.50001@coosemans.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.0 cv=Q6eKePKa c=1 sm=1 a=hIML2bcmzLYA:10
 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=Aet6fyW9sl8A:10
 a=YqRfAJJkAAAA:8 a=XDH_4B7L22ftifMYl1UA:9 a=CjuIK1q_8ugA:10
 a=UIDpq6-GphUA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
 src-committers@FreeBSD.org, David Chisnall ,
 Bruce Evans 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 09:14:52 -0000

On Thu, 11 Jul 2013, Tijl Coosemans wrote:

> On 2013-07-11 22:03, Tijl Coosemans wrote:
>> On 2013-07-11 21:36, David Chisnall wrote:
>>> On 11 Jul 2013, at 19:52, Tijl Coosemans  wrote:
>>>>> @@ -227,8 +250,6 @@ double	expm1(double);
>>>>> double	fma(double, double, double);
>>>>> double	hypot(double, double);
>>>>> int	ilogb(double) __pure2;
>>>>> -int	(isinf)(double) __pure2;
>>>>> -int	(isnan)(double) __pure2;
>>>>
>>>> I think they should stay for the C90 case.
>>>
>>> That would completely defeat the point of this entire exercise and be
>>> redundant unless we aim to support a compiler that only supports C90
>>> and no GNU extensions, in which case you'll hit errors in cdefs.h,
>>> long before you get to this point in an include.
>>
>> isnan(double) is part of SUSv2. It should be visible when compiling with
>> -D_XOPEN_SOURCE=500. I think you need something like this:

>> #if (__BSD_VISIBLE || __XSI_VISIBLE <= 500) && __ISO_C_VISIBLE < 1999
>> int	isinf(double) __pure2;
>> int	isnan(double) __pure2;
>> #endif
>
> Actually this:
>
> #if (__BSD_VISIBLE || (defined(__XSI_VISIBLE) && __XSI_VISIBLE <= 500)) && __ISO_C_VISIBLE < 1999

Remove the __ISO_C_VISIBLE part, since this is not in C90.  This also fixes
a style bug (long line).

How can that work?  Even you forgot to restore the parentheses around
the functions, so the above has syntax errors.  Applications would
have to use parentheses to get the functions (or not include ,
but then it doesn't matther if it doesn't declare the functions).
Applications that forget to do this will get the macros instead of the
functions.  If the arg type is double, then the macro will work the
same as the functions.  Otherwise, it has different semantics, but
usually the same result except for signaling NaNs.  But does old XSI
really specify that parentheses must be used to get isnan() (or can
be used to get an isnan() function that is specified to exist)?  Old
BSD has almost no specification for isnan(), and there probably isn't
much old BSD code that carefully prevents use of the macro using
parentheses.  isnan()'s man page actually says that 3BSD introduced
isinf() and isnan() functions, but these have been superseded by the
macros.

I noticed some more problems in the implementation of these macros
and others:
- many or all of the __pure2's in the prototypes are wrong, since even
   the classification functions can have side effects for signaling
   NaNs.  It is impossible to avoid these side effects for extern
   functions in some cases, since the ABI gives them.  I think static
   inline functions must have the same results as extern functions,
   so compilers should pessimize inline functions as necessary to
   get the same bad results, but compilers don't do that.
- classification functions are specified to convert to the semantic
   type (remove any extra precision or exponent range) before classifying.

   For example, if x is a double slightly larger than sqrt(DBL_MAX), and
   if double expressions are evaluated in extra exponent range, then x*x
   is finite with the extra range but infinite in the semantic type.  So
   isinf(x*x) is true, and the implementation
   #define isinf(x) (fabs(x) == INFINITY) is invalid.  clang on x86 gets
   __builtin_isinf(x*x) this right as a side effect of its pessimization
   of fabs() to non-inline -- parameter passing to the extern fabs()
   converts to the semantic type.  Sometimes the arg is known not to have
   extra range, so no conversion is needed.

   isnan(x) can safely skip the conversion, at least on x86, since conversion
   doesn't change the classification of NaNs.  __builtin_isnan(x*x) for
   clang on x86 skips the conversion.

   __builtin_isinfinite(x*x) for clang on x86 is a combination of the above --
   isnan() with no conversion and !isinf() with pessimal conversion via
   non-inline fabs().

I couldn't find any case where a necessary conversion is not done.  Our
implementation using functions gives the necessary conversions including
ones that are broken for signaling NaNs.  But there is no problem for
with signaling NaNs for expressions like x*x, since the result of an
expression with almost any operator in it can't be a signaling NaN.

I think C11 has new mistakes for extra precision.  It specifies that
return reduces to the semantic type, like the classification macros
are required to do for their arg.  clang -std=c11 doesn't implement
this bug for at least:

 	#include 
 	double sq(double x) { return (x*x); }
 	double sq2(double x) { return (fabs(x*x); }

On i386 without SSE2 (so extra precision), this generates the same code
as with -std=c99.  Squaring x gives extra precision and exponent range.
This is not destroyed on return, so extra precision is not defeated by
writing the squaring operation as a function.  fabs() is inlined in both
cases, so it has little effect here (no effect unless x is NaN), but I
think even C99 doesn't permit this.  If fabs() were not inline, then
the ABI would force destruction of the extra precision and range when
it is called, and I think C99 requires conversion to the semantic type
for calls.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 09:20:55 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id C2D9D879;
 Fri, 12 Jul 2013 09:20:55 +0000 (UTC)
 (envelope-from oleg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id B4A8018BB;
 Fri, 12 Jul 2013 09:20:55 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6C9KtPX039917;
 Fri, 12 Jul 2013 09:20:55 GMT (envelope-from oleg@svn.freebsd.org)
Received: (from oleg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6C9KtET039916;
 Fri, 12 Jul 2013 09:20:55 GMT (envelope-from oleg@svn.freebsd.org)
Message-Id: <201307120920.r6C9KtET039916@svn.freebsd.org>
From: Oleg Bulyzhin 
Date: Fri, 12 Jul 2013 09:20:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253256 - head/sbin/recoverdisk
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 09:20:55 -0000

Author: oleg
Date: Fri Jul 12 09:20:55 2013
New Revision: 253256
URL: http://svnweb.freebsd.org/changeset/base/253256

Log:
  Fix 'SEE ALSO' list.

Modified:
  head/sbin/recoverdisk/recoverdisk.1

Modified: head/sbin/recoverdisk/recoverdisk.1
==============================================================================
--- head/sbin/recoverdisk/recoverdisk.1	Fri Jul 12 08:03:10 2013	(r253255)
+++ head/sbin/recoverdisk/recoverdisk.1	Fri Jul 12 09:20:55 2013	(r253256)
@@ -125,9 +125,9 @@ recoverdisk -b 0 /dev/ad3 /somewhere
 .Ed
 .Sh SEE ALSO
 .Xr dd 1 ,
-.Xr ada 4,
-.Xr cam 4,
-.Xr cd 4,
+.Xr ada 4 ,
+.Xr cam 4 ,
+.Xr cd 4 ,
 .Xr da 4
 .Sh HISTORY
 The

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 10:02:47 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id A80A1630;
 Fri, 12 Jul 2013 10:02:47 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 9A4E81AF8;
 Fri, 12 Jul 2013 10:02:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CA2lgI051352;
 Fri, 12 Jul 2013 10:02:47 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CA2lkH051351;
 Fri, 12 Jul 2013 10:02:47 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307121002.r6CA2lkH051351@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 12 Jul 2013 10:02:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253257 - stable/9/sys/vm
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 10:02:47 -0000

Author: kib
Date: Fri Jul 12 10:02:47 2013
New Revision: 253257
URL: http://svnweb.freebsd.org/changeset/base/253257

Log:
  MFC r253095:
  Fix typo in comment.
  
  Approved by:	re (hrs)

Modified:
  stable/9/sys/vm/swap_pager.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/vm/swap_pager.c
==============================================================================
--- stable/9/sys/vm/swap_pager.c	Fri Jul 12 09:20:55 2013	(r253256)
+++ stable/9/sys/vm/swap_pager.c	Fri Jul 12 10:02:47 2013	(r253257)
@@ -835,7 +835,7 @@ swap_pager_freespace(vm_object_t object,
  * SWAP_PAGER_RESERVE() - reserve swap blocks in object
  *
  *	Assigns swap blocks to the specified range within the object.  The 
- *	swap blocks are not zerod.  Any previous swap assignment is destroyed.
+ *	swap blocks are not zeroed.  Any previous swap assignment is destroyed.
  *
  *	Returns 0 on success, -1 on failure.
  */

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 10:07:21 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id D3AD879A;
 Fri, 12 Jul 2013 10:07:21 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id C63C11B1B;
 Fri, 12 Jul 2013 10:07:21 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CA7L26052093;
 Fri, 12 Jul 2013 10:07:21 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CA7L7F052092;
 Fri, 12 Jul 2013 10:07:21 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201307121007.r6CA7L7F052092@svn.freebsd.org>
From: Dag-Erling Smørgrav 
Date: Fri, 12 Jul 2013 10:07:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253258 - head/tools/build/mk
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 10:07:21 -0000

Author: des
Date: Fri Jul 12 10:07:21 2013
New Revision: 253258
URL: http://svnweb.freebsd.org/changeset/base/253258

Log:
  Remove authpf-noip along with authpf.
  
  Reminded by:	delphij@

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- head/tools/build/mk/OptionalObsoleteFiles.inc	Fri Jul 12 10:02:47 2013	(r253257)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc	Fri Jul 12 10:07:21 2013	(r253258)
@@ -206,7 +206,9 @@ OLD_FILES+=usr/share/man/man8/auditd.8.g
 
 .if ${MK_AUTHPF} == no
 OLD_FILES+=usr/sbin/authpf
+OLD_FILES+=usr/sbin/authpf-noip
 OLD_FILES+=usr/share/man/man8/authpf.8.gz
+OLD_FILES+=usr/share/man/man8/authpf-noip.8.gz
 .endif
 
 .if ${MK_BIND} == no

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 10:07:49 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 0A37B8D0;
 Fri, 12 Jul 2013 10:07:49 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id F0DD41B20;
 Fri, 12 Jul 2013 10:07:48 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CA7mau052186;
 Fri, 12 Jul 2013 10:07:48 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CA7mpN052185;
 Fri, 12 Jul 2013 10:07:48 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307121007.r6CA7mpN052185@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 12 Jul 2013 10:07:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253259 - stable/9/sys/kern
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 10:07:49 -0000

Author: kib
Date: Fri Jul 12 10:07:48 2013
New Revision: 253259
URL: http://svnweb.freebsd.org/changeset/base/253259

Log:
  MFC r251282:
  When auto-sizing the buffer cache, limit the amount of physical memory
  used as the estimation of size, to 16GB.  This provides around 100K of
  buffer headers and corresponding KVA for buffer map at the peak.
  Sizing the cache larger is not useful, also resulting in the wasting
  and exhausting of KVA for large machines.
  
  MFC note: the commit message was adjusted to match the code change, the
  sizing cap is for 16GB, as noted by delphij.
  
  Approved by:	re (delphij)

Modified:
  stable/9/sys/kern/vfs_bio.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/vfs_bio.c
==============================================================================
--- stable/9/sys/kern/vfs_bio.c	Fri Jul 12 10:07:21 2013	(r253258)
+++ stable/9/sys/kern/vfs_bio.c	Fri Jul 12 10:07:48 2013	(r253259)
@@ -562,7 +562,8 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon
 			nbuf += min((physmem_est - 4096) / factor,
 			    65536 / factor);
 		if (physmem_est > 65536)
-			nbuf += (physmem_est - 65536) * 2 / (factor * 5);
+			nbuf += min((physmem_est - 65536) * 2 / (factor * 5),
+			    32 * 1024 * 1024 / (factor * 5));
 
 		if (maxbcache && nbuf > maxbcache / BKVASIZE)
 			nbuf = maxbcache / BKVASIZE;

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 11:03:52 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 7A8B929D;
 Fri, 12 Jul 2013 11:03:52 +0000 (UTC)
 (envelope-from theraven@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 6CE701D59;
 Fri, 12 Jul 2013 11:03:52 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CB3qLq068784;
 Fri, 12 Jul 2013 11:03:52 GMT
 (envelope-from theraven@svn.freebsd.org)
Received: (from theraven@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CB3qrh068782;
 Fri, 12 Jul 2013 11:03:52 GMT
 (envelope-from theraven@svn.freebsd.org)
Message-Id: <201307121103.r6CB3qrh068782@svn.freebsd.org>
From: David Chisnall 
Date: Fri, 12 Jul 2013 11:03:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253260 - head/lib/msun/src
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 11:03:52 -0000

Author: theraven
Date: Fri Jul 12 11:03:51 2013
New Revision: 253260
URL: http://svnweb.freebsd.org/changeset/base/253260

Log:
  Fix the build with C++ where __builtin_types_compatible_p is not allowed.

Modified:
  head/lib/msun/src/math.h

Modified: head/lib/msun/src/math.h
==============================================================================
--- head/lib/msun/src/math.h	Fri Jul 12 10:07:48 2013	(r253259)
+++ head/lib/msun/src/math.h	Fri Jul 12 11:03:51 2013	(r253260)
@@ -81,12 +81,13 @@ extern const union __nan_un {
 #define	FP_SUBNORMAL	0x08
 #define	FP_ZERO		0x10
 
-#if __STDC_VERSION__ >= 201112L && defined(__clang__)
+#if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \
+    __has_extension(c_generic_selections)
 #define	__fp_type_select(x, f, d, ld) _Generic((x),     \
 	float: f(x),                                    \
 	double: d(x),                                   \
 	long double: ld(x))
-#elif __GNUC_PREREQ__(3, 1)
+#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
 #define	__fp_type_select(x, f, d, ld) __builtin_choose_expr(              \
 	__builtin_types_compatible_p(__typeof(x), long double), ld(x),    \
 	__builtin_choose_expr(                                            \

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 12:18:07 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 8CC35ADD;
 Fri, 12 Jul 2013 12:18:07 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 7F83310DF;
 Fri, 12 Jul 2013 12:18:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CCI7sv089673;
 Fri, 12 Jul 2013 12:18:07 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CCI7tH089672;
 Fri, 12 Jul 2013 12:18:07 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307121218.r6CCI7tH089672@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 12:18:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253261 - head/sys/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 12:18:07 -0000

Author: hrs
Date: Fri Jul 12 12:18:07 2013
New Revision: 253261
URL: http://svnweb.freebsd.org/changeset/base/253261

Log:
  - Drop GIF_ACCEPT_REVETHIP flag by default.
  - Add IFF_MONITOR support.

Modified:
  head/sys/net/if_gif.c

Modified: head/sys/net/if_gif.c
==============================================================================
--- head/sys/net/if_gif.c	Fri Jul 12 11:03:51 2013	(r253260)
+++ head/sys/net/if_gif.c	Fri Jul 12 12:18:07 2013	(r253261)
@@ -173,7 +173,7 @@ gif_clone_create(ifc, unit, params)
 	if_initname(GIF2IFP(sc), gifname, unit);
 
 	sc->encap_cookie4 = sc->encap_cookie6 = NULL;
-	sc->gif_options = GIF_ACCEPT_REVETHIP;
+	sc->gif_options = 0;
 
 	GIF2IFP(sc)->if_addrlen = 0;
 	GIF2IFP(sc)->if_mtu    = GIF_MTU;
@@ -437,6 +437,11 @@ gif_output(struct ifnet *ifp, struct mbu
 		goto end;
 	}
 #endif
+	if ((ifp->if_flags & IFF_MONITOR) != 0) {
+		error = ENETDOWN;
+		m_freem(m);
+		goto end;
+	}
 
 	/*
 	 * gif may cause infinite recursion calls when misconfigured.
@@ -551,6 +556,13 @@ gif_input(m, af, ifp)
 		bpf_mtap2(ifp->if_bpf, &af1, sizeof(af1), m);
 	}
 
+	if ((ifp->if_flags & IFF_MONITOR) != 0) {
+		ifp->if_ipackets++;
+		ifp->if_ibytes += m->m_pkthdr.len;
+		m_freem(m);
+		return;
+	}
+
 	if (ng_gif_input_p != NULL) {
 		(*ng_gif_input_p)(ifp, &m, af);
 		if (m == NULL)

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 12:36:13 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id AB184446;
 Fri, 12 Jul 2013 12:36:13 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 83638122B;
 Fri, 12 Jul 2013 12:36:13 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CCaDC4095417;
 Fri, 12 Jul 2013 12:36:13 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CCaDCW095414;
 Fri, 12 Jul 2013 12:36:13 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307121236.r6CCaDCW095414@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 12:36:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253262 - in head: lib/libc/gen sys/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 12:36:13 -0000

Author: hrs
Date: Fri Jul 12 12:36:12 2013
New Revision: 253262
URL: http://svnweb.freebsd.org/changeset/base/253262

Log:
  Add a leaf node CTL_NET.PF_ROUTE.0.AF.NET_RT_DUMP.0.FIB.  This returns
  routing table with the specified FIB number, not td->td_proc->p_fibnum.

Modified:
  head/lib/libc/gen/sysctl.3
  head/sys/net/rtsock.c

Modified: head/lib/libc/gen/sysctl.3
==============================================================================
--- head/lib/libc/gen/sysctl.3	Fri Jul 12 12:18:07 2013	(r253261)
+++ head/lib/libc/gen/sysctl.3	Fri Jul 12 12:36:12 2013	(r253262)
@@ -28,7 +28,7 @@
 .\"	@(#)sysctl.3	8.4 (Berkeley) 5/9/95
 .\" $FreeBSD$
 .\"
-.Dd February 11, 2012
+.Dd May 17, 2013
 .Dt SYSCTL 3
 .Os
 .Sh NAME
@@ -547,14 +547,14 @@ The length of each message is contained 
 The third level name is a protocol number, which is currently always 0.
 The fourth level name is an address family, which may be set to 0 to
 select all address families.
-The fifth and sixth level names are as follows:
-.Bl -column "Fifth level nameXXXXXX" "Sixth level is:XXX" -offset indent
-.It Sy "Fifth level name	Sixth level is:"
-.It "NET_RT_FLAGS	rtflags"
-.It "NET_RT_DUMP	None"
-.It "NET_RT_IFLIST	0 or if_index"
-.It "NET_RT_IFMALIST	0 or if_index"
-.It "NET_RT_IFLISTL	0 or if_index"
+The fifth, sixth, and seventh level names are as follows:
+.Bl -column "Fifth level	" "Sixth level	" -offset indent
+.It Sy "Fifth level	Sixth level	Seventh level"
+.It "NET_RT_FLAGS	rtflags			None"
+.It "NET_RT_DUMP	None			None or fib number"
+.It "NET_RT_IFLIST	0 or if_index		None"
+.It "NET_RT_IFMALIST	0 or if_index		None"
+.It "NET_RT_IFLISTL	0 or if_index		None"
 .El
 .Pp
 The

Modified: head/sys/net/rtsock.c
==============================================================================
--- head/sys/net/rtsock.c	Fri Jul 12 12:18:07 2013	(r253261)
+++ head/sys/net/rtsock.c	Fri Jul 12 12:36:12 2013	(r253262)
@@ -1905,6 +1905,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS)
 	u_int	namelen = arg2;
 	struct radix_node_head *rnh = NULL; /* silence compiler. */
 	int	i, lim, error = EINVAL;
+	int	fib = 0;
 	u_char	af;
 	struct	walkarg w;
 
@@ -1912,7 +1913,17 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS)
 	namelen--;
 	if (req->newptr)
 		return (EPERM);
-	if (namelen != 3)
+	if (name[1] == NET_RT_DUMP) {
+		if (namelen == 3)
+			fib = req->td->td_proc->p_fibnum;
+		else if (namelen == 4)
+			fib = (name[3] == -1) ?
+			    req->td->td_proc->p_fibnum : name[3];
+		else
+			return ((namelen < 3) ? EISDIR : ENOTDIR);
+		if (fib < 0 || fib >= rt_numfibs)
+			return (EINVAL);
+	} else if (namelen != 3)
 		return ((namelen < 3) ? EISDIR : ENOTDIR);
 	af = name[0];
 	if (af > AF_MAX)
@@ -1951,7 +1962,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS)
 		 * take care of routing entries
 		 */
 		for (error = 0; error == 0 && i <= lim; i++) {
-			rnh = rt_tables_get_rnh(req->td->td_proc->p_fibnum, i);
+			rnh = rt_tables_get_rnh(fib, i);
 			if (rnh != NULL) {
 				RADIX_NODE_HEAD_RLOCK(rnh); 
 			    	error = rnh->rnh_walktree(rnh,

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 12:40:22 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 4A1DD73B;
 Fri, 12 Jul 2013 12:40:22 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 3C2B4125F;
 Fri, 12 Jul 2013 12:40:22 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CCeM9S096155;
 Fri, 12 Jul 2013 12:40:22 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CCeMMi096154;
 Fri, 12 Jul 2013 12:40:22 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201307121240.r6CCeMMi096154@svn.freebsd.org>
From: Michael Tuexen 
Date: Fri, 12 Jul 2013 12:40:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253263 - stable/9/sys/netinet
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 12:40:22 -0000

Author: tuexen
Date: Fri Jul 12 12:40:21 2013
New Revision: 253263
URL: http://svnweb.freebsd.org/changeset/base/253263

Log:
  MFC r253099:
  Use IPSECSTAT_INC() and IPSEC6STAT_INC() macros for ipsec statistics
  accounting.
  
  Approved by: re@

Modified:
  stable/9/sys/netinet/sctp_input.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netinet/sctp_input.c
==============================================================================
--- stable/9/sys/netinet/sctp_input.c	Fri Jul 12 12:36:12 2013	(r253262)
+++ stable/9/sys/netinet/sctp_input.c	Fri Jul 12 12:40:21 2013	(r253263)
@@ -5705,7 +5705,7 @@ sctp_common_input_processing(struct mbuf
 #ifdef INET
 		case AF_INET:
 			if (ipsec4_in_reject(m, &inp->ip_inp.inp)) {
-				MODULE_GLOBAL(ipsec4stat).in_polvio++;
+				IPSECSTAT_INC(in_polvio);
 				SCTP_STAT_INCR(sctps_hdrops);
 				goto out;
 			}
@@ -5714,7 +5714,7 @@ sctp_common_input_processing(struct mbuf
 #ifdef INET6
 		case AF_INET6:
 			if (ipsec6_in_reject(m, &inp->ip_inp.inp)) {
-				MODULE_GLOBAL(ipsec6stat).in_polvio++;
+				IPSEC6STAT_INC(in_polvio);
 				SCTP_STAT_INCR(sctps_hdrops);
 				goto out;
 			}

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 13:51:20 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 59065B13;
 Fri, 12 Jul 2013 13:51:20 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 4AF0717AF;
 Fri, 12 Jul 2013 13:51:20 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CDpKtx018321;
 Fri, 12 Jul 2013 13:51:20 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CDpKjA018320;
 Fri, 12 Jul 2013 13:51:20 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201307121351.r6CDpKjA018320@svn.freebsd.org>
From: Michael Tuexen 
Date: Fri, 12 Jul 2013 13:51:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253264 - stable/8/lib/libc/net
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 13:51:20 -0000

Author: tuexen
Date: Fri Jul 12 13:51:19 2013
New Revision: 253264
URL: http://svnweb.freebsd.org/changeset/base/253264

Log:
  MFC r253104:
  Fix a bug where SCTP_ENABLE_STREAM_RESET is not handled by
  sctp_opt_info().

Modified:
  stable/8/lib/libc/net/sctp_sys_calls.c
Directory Properties:
  stable/8/lib/   (props changed)
  stable/8/lib/libc/   (props changed)

Modified: stable/8/lib/libc/net/sctp_sys_calls.c
==============================================================================
--- stable/8/lib/libc/net/sctp_sys_calls.c	Fri Jul 12 12:40:21 2013	(r253263)
+++ stable/8/lib/libc/net/sctp_sys_calls.c	Fri Jul 12 13:51:19 2013	(r253264)
@@ -335,6 +335,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i
 	case SCTP_REMOTE_UDP_ENCAPS_PORT:
 		((struct sctp_udpencaps *)arg)->sue_assoc_id = id;
 		break;
+	case SCTP_ENABLE_STREAM_RESET:
+		((struct sctp_assoc_value *)arg)->assoc_id = id;
+		break;
 	default:
 		break;
 	}

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 13:52:27 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 93454C47;
 Fri, 12 Jul 2013 13:52:27 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8589217B9;
 Fri, 12 Jul 2013 13:52:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CDqRiM018501;
 Fri, 12 Jul 2013 13:52:27 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CDqRjV018500;
 Fri, 12 Jul 2013 13:52:27 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201307121352.r6CDqRjV018500@svn.freebsd.org>
From: Michael Tuexen 
Date: Fri, 12 Jul 2013 13:52:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject: svn commit: r253265 - stable/8/lib/libc/net
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 13:52:27 -0000

Author: tuexen
Date: Fri Jul 12 13:52:27 2013
New Revision: 253265
URL: http://svnweb.freebsd.org/changeset/base/253265

Log:
  MFC r253105:
  Fix the handling of SCTP_CURRENT_ASSOC and SCTP_ALL_ASSOC in
  sctp_opt_info().

Modified:
  stable/8/lib/libc/net/sctp_sys_calls.c
Directory Properties:
  stable/8/lib/   (props changed)
  stable/8/lib/libc/   (props changed)

Modified: stable/8/lib/libc/net/sctp_sys_calls.c
==============================================================================
--- stable/8/lib/libc/net/sctp_sys_calls.c	Fri Jul 12 13:51:19 2013	(r253264)
+++ stable/8/lib/libc/net/sctp_sys_calls.c	Fri Jul 12 13:52:27 2013	(r253265)
@@ -274,6 +274,11 @@ sctp_opt_info(int sd, sctp_assoc_t id, i
 		errno = EINVAL;
 		return (-1);
 	}
+	if ((id == SCTP_CURRENT_ASSOC) ||
+	    (id == SCTP_ALL_ASSOC)) {
+		errno = EINVAL;
+		return (-1);
+	}
 	switch (opt) {
 	case SCTP_RTOINFO:
 		((struct sctp_rtoinfo *)arg)->srto_assoc_id = id;

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 14:24:54 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 02D0BB93;
 Fri, 12 Jul 2013 14:24:54 +0000 (UTC)
 (envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id D8BEF195E;
 Fri, 12 Jul 2013 14:24:53 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CEOrnE028219;
 Fri, 12 Jul 2013 14:24:53 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CEOqZL028212;
 Fri, 12 Jul 2013 14:24:52 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201307121424.r6CEOqZL028212@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 12 Jul 2013 14:24:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253266 - in head: lib/libc/sparc64/gen
 lib/libthread_db/arch/sparc64 sys/sparc64/include sys/sparc64/sparc64
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 14:24:54 -0000

Author: marius
Date: Fri Jul 12 14:24:52 2013
New Revision: 253266
URL: http://svnweb.freebsd.org/changeset/base/253266

Log:
  Prefix the alias macros for members of struct __mcontext with an underscore
  in order to avoid a clash in the net80211 code.

Modified:
  head/lib/libc/sparc64/gen/makecontext.c
  head/lib/libc/sparc64/gen/signalcontext.c
  head/lib/libthread_db/arch/sparc64/libpthread_md.c
  head/sys/sparc64/include/ucontext.h
  head/sys/sparc64/sparc64/machdep.c

Modified: head/lib/libc/sparc64/gen/makecontext.c
==============================================================================
--- head/lib/libc/sparc64/gen/makecontext.c	Fri Jul 12 13:52:27 2013	(r253265)
+++ head/lib/libc/sparc64/gen/makecontext.c	Fri Jul 12 14:24:52 2013	(r253266)
@@ -54,12 +54,12 @@ __makecontext(ucontext_t *ucp, void (*st
 
 	mc = &ucp->uc_mcontext;
 	if (ucp == NULL ||
-	    (mc->mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION)
+	    (mc->_mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION)
 		return;
 	if ((argc < 0) || (argc > 6) ||
 	    (ucp->uc_stack.ss_sp == NULL) ||
 	    (ucp->uc_stack.ss_size < MINSIGSTKSZ)) {
-		mc->mc_flags = 0;
+		mc->_mc_flags = 0;
 		return;
 	}
 	mc = &ucp->uc_mcontext;
@@ -71,8 +71,8 @@ __makecontext(ucontext_t *ucp, void (*st
 	mc->mc_global[1] = (uint64_t)start;
 	mc->mc_global[2] = (uint64_t)ucp;
 	mc->mc_out[6] = sp - SPOFF - sizeof(struct frame);
-	mc->mc_tnpc = (uint64_t)_ctx_start + 4;
-	mc->mc_tpc = (uint64_t)_ctx_start;
+	mc->_mc_tnpc = (uint64_t)_ctx_start + 4;
+	mc->_mc_tpc = (uint64_t)_ctx_start;
 }
 
 void
@@ -82,7 +82,7 @@ _ctx_done(ucontext_t *ucp)
 	if (ucp->uc_link == NULL)
 		exit(0);
 	else {
-		ucp->uc_mcontext.mc_flags = 0;
+		ucp->uc_mcontext._mc_flags = 0;
 		setcontext((const ucontext_t *)ucp->uc_link);
 		abort();
 	}

Modified: head/lib/libc/sparc64/gen/signalcontext.c
==============================================================================
--- head/lib/libc/sparc64/gen/signalcontext.c	Fri Jul 12 13:52:27 2013	(r253265)
+++ head/lib/libc/sparc64/gen/signalcontext.c	Fri Jul 12 14:24:52 2013	(r253266)
@@ -52,7 +52,7 @@ __signalcontext(ucontext_t *ucp, int sig
 	mcontext_t *mc;
 
 	mc = &ucp->uc_mcontext;
-	sfp = (struct sigframe *)(mc->mc_sp + SPOFF) - 1;
+	sfp = (struct sigframe *)(mc->_mc_sp + SPOFF) - 1;
 	fp = (struct frame *)sfp - 1;
 
 	bzero(fp, sizeof(*fp));
@@ -67,8 +67,8 @@ __signalcontext(ucontext_t *ucp, int sig
 	mc->mc_out[1] = (uint64_t)&sfp->sf_si;
 	mc->mc_out[2] = (uint64_t)&sfp->sf_uc;
 	mc->mc_out[6] = (uint64_t)fp - SPOFF;
-	mc->mc_tnpc = (uint64_t)_ctx_start + 4;
-	mc->mc_tpc = (uint64_t)_ctx_start;
+	mc->_mc_tnpc = (uint64_t)_ctx_start + 4;
+	mc->_mc_tpc = (uint64_t)_ctx_start;
 
 	ucp->uc_link = &sfp->sf_uc;
 	sigdelset(&ucp->uc_sigmask, sig);

Modified: head/lib/libthread_db/arch/sparc64/libpthread_md.c
==============================================================================
--- head/lib/libthread_db/arch/sparc64/libpthread_md.c	Fri Jul 12 13:52:27 2013	(r253265)
+++ head/lib/libthread_db/arch/sparc64/libpthread_md.c	Fri Jul 12 14:24:52 2013	(r253266)
@@ -57,9 +57,9 @@ pt_fpreg_to_ucontext(const struct fpreg*
 
 	memcpy(mc->mc_fp, r->fr_regs, MIN(sizeof(mc->mc_fp),
 	    sizeof(r->fr_regs)));
-	mc->mc_fsr = r->fr_fsr;
-	mc->mc_gsr = r->fr_gsr;
-	mc->mc_fprs |= FPRS_FEF;
+	mc->_mc_fsr = r->fr_fsr;
+	mc->_mc_gsr = r->fr_gsr;
+	mc->_mc_fprs |= FPRS_FEF;
 }
 
 void
@@ -67,11 +67,11 @@ pt_ucontext_to_fpreg(const ucontext_t *u
 {
 	const mcontext_t *mc = &uc->uc_mcontext;
 
-	if ((mc->mc_fprs & FPRS_FEF) != 0) {
+	if ((mc->_mc_fprs & FPRS_FEF) != 0) {
 		memcpy(r->fr_regs, mc->mc_fp, MIN(sizeof(mc->mc_fp),
 		    sizeof(r->fr_regs)));
-		r->fr_fsr = mc->mc_fsr;
-		r->fr_gsr = mc->mc_gsr;
+		r->fr_fsr = mc->_mc_fsr;
+		r->fr_gsr = mc->_mc_gsr;
 	} else
 		memset(r, 0, sizeof(*r));
 }

Modified: head/sys/sparc64/include/ucontext.h
==============================================================================
--- head/sys/sparc64/include/ucontext.h	Fri Jul 12 13:52:27 2013	(r253265)
+++ head/sys/sparc64/include/ucontext.h	Fri Jul 12 14:24:52 2013	(r253266)
@@ -6,7 +6,7 @@
  * 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 
+ *    notice, this list of conditions and the following disclaimer
  *    in this position and unchanged.
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
@@ -42,16 +42,16 @@ struct __mcontext {
 
 typedef struct __mcontext mcontext_t;
 
-#define	mc_flags	mc_global[0]
-#define	mc_sp           mc_out[6]
-#define	mc_fprs         mc_local[0]
-#define	mc_fsr		mc_local[1]
-#define	mc_gsr		mc_local[2]
-#define	mc_tnpc         mc_in[0]
-#define	mc_tpc          mc_in[1]
-#define	mc_tstate       mc_in[2]
-#define	mc_y            mc_in[4]
-#define	mc_wstate	mc_in[5]
+#define	_mc_flags	mc_global[0]
+#define	_mc_sp		mc_out[6]
+#define	_mc_fprs	mc_local[0]
+#define	_mc_fsr		mc_local[1]
+#define	_mc_gsr		mc_local[2]
+#define	_mc_tnpc	mc_in[0]
+#define	_mc_tpc		mc_in[1]
+#define	_mc_tstate	mc_in[2]
+#define	_mc_y		mc_in[4]
+#define	_mc_wstate	mc_in[5]
 
 #define	_MC_VERSION_SHIFT	0
 #define	_MC_VERSION_BITS	32

Modified: head/sys/sparc64/sparc64/machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/machdep.c	Fri Jul 12 13:52:27 2013	(r253265)
+++ head/sys/sparc64/sparc64/machdep.c	Fri Jul 12 14:24:52 2013	(r253266)
@@ -736,7 +736,7 @@ sys_sigreturn(struct thread *td, struct 
 	kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0);
 
 	CTR4(KTR_SIG, "sigreturn: return td=%p pc=%#lx sp=%#lx tstate=%#lx",
-	    td, mc->mc_tpc, mc->mc_sp, mc->mc_tstate);
+	    td, mc->_mc_tpc, mc->_mc_sp, mc->_mc_tstate);
 	return (EJUSTRETURN);
 }
 
@@ -769,7 +769,7 @@ get_mcontext(struct thread *td, mcontext
 	 * Note that we skip %g7 which is used as the userland TLS register
 	 * and %wstate.
 	 */
-	mc->mc_flags = _MC_VERSION;
+	mc->_mc_flags = _MC_VERSION;
 	mc->mc_global[1] = tf->tf_global[1];
 	mc->mc_global[2] = tf->tf_global[2];
 	mc->mc_global[3] = tf->tf_global[3];
@@ -789,13 +789,13 @@ get_mcontext(struct thread *td, mcontext
 	mc->mc_out[5] = tf->tf_out[5];
 	mc->mc_out[6] = tf->tf_out[6];
 	mc->mc_out[7] = tf->tf_out[7];
-	mc->mc_fprs = tf->tf_fprs;
-	mc->mc_fsr = tf->tf_fsr;
-	mc->mc_gsr = tf->tf_gsr;
-	mc->mc_tnpc = tf->tf_tnpc;
-	mc->mc_tpc = tf->tf_tpc;
-	mc->mc_tstate = tf->tf_tstate;
-	mc->mc_y = tf->tf_y;
+	mc->_mc_fprs = tf->tf_fprs;
+	mc->_mc_fsr = tf->tf_fsr;
+	mc->_mc_gsr = tf->tf_gsr;
+	mc->_mc_tnpc = tf->tf_tnpc;
+	mc->_mc_tpc = tf->tf_tpc;
+	mc->_mc_tstate = tf->tf_tstate;
+	mc->_mc_y = tf->tf_y;
 	critical_enter();
 	if ((tf->tf_fprs & FPRS_FEF) != 0) {
 		savefpctx(pcb->pcb_ufp);
@@ -804,7 +804,7 @@ get_mcontext(struct thread *td, mcontext
 	}
 	if ((pcb->pcb_flags & PCB_FEF) != 0) {
 		bcopy(pcb->pcb_ufp, mc->mc_fp, sizeof(mc->mc_fp));
-		mc->mc_fprs |= FPRS_FEF;
+		mc->_mc_fprs |= FPRS_FEF;
 	}
 	critical_exit();
 	return (0);
@@ -816,8 +816,8 @@ set_mcontext(struct thread *td, const mc
 	struct trapframe *tf;
 	struct pcb *pcb;
 
-	if (!TSTATE_SECURE(mc->mc_tstate) ||
-	    (mc->mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION)
+	if (!TSTATE_SECURE(mc->_mc_tstate) ||
+	    (mc->_mc_flags & ((1L << _MC_VERSION_BITS) - 1)) != _MC_VERSION)
 		return (EINVAL);
 	tf = td->td_frame;
 	pcb = td->td_pcb;
@@ -843,14 +843,14 @@ set_mcontext(struct thread *td, const mc
 	tf->tf_out[5] = mc->mc_out[5];
 	tf->tf_out[6] = mc->mc_out[6];
 	tf->tf_out[7] = mc->mc_out[7];
-	tf->tf_fprs = mc->mc_fprs;
-	tf->tf_fsr = mc->mc_fsr;
-	tf->tf_gsr = mc->mc_gsr;
-	tf->tf_tnpc = mc->mc_tnpc;
-	tf->tf_tpc = mc->mc_tpc;
-	tf->tf_tstate = mc->mc_tstate;
-	tf->tf_y = mc->mc_y;
-	if ((mc->mc_fprs & FPRS_FEF) != 0) {
+	tf->tf_fprs = mc->_mc_fprs;
+	tf->tf_fsr = mc->_mc_fsr;
+	tf->tf_gsr = mc->_mc_gsr;
+	tf->tf_tnpc = mc->_mc_tnpc;
+	tf->tf_tpc = mc->_mc_tpc;
+	tf->tf_tstate = mc->_mc_tstate;
+	tf->tf_y = mc->_mc_y;
+	if ((mc->_mc_fprs & FPRS_FEF) != 0) {
 		tf->tf_fprs = 0;
 		bcopy(mc->mc_fp, pcb->pcb_ufp, sizeof(pcb->pcb_ufp));
 		pcb->pcb_flags |= PCB_FEF;

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 14:25:58 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id CD5B3CD4;
 Fri, 12 Jul 2013 14:25:58 +0000 (UTC)
 (envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id BE0BB1969;
 Fri, 12 Jul 2013 14:25:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CEPwmq028396;
 Fri, 12 Jul 2013 14:25:58 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CEPwjV028394;
 Fri, 12 Jul 2013 14:25:58 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201307121425.r6CEPwjV028394@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Fri, 12 Jul 2013 14:25:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253267 - head/share/man/man9
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 14:25:58 -0000

Author: glebius
Date: Fri Jul 12 14:25:58 2013
New Revision: 253267
URL: http://svnweb.freebsd.org/changeset/base/253267

Log:
  Add manual page for vmem(9). Obtained from NetBSD, modified to match
  our implementation.
  
  Obtained from:	NetBSD

Added:
  head/share/man/man9/vmem.9   (contents, props changed)
Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Fri Jul 12 14:24:52 2013	(r253266)
+++ head/share/man/man9/Makefile	Fri Jul 12 14:25:58 2013	(r253267)
@@ -339,6 +339,7 @@ MAN=	accept_filter.9 \
 	vm_page_wakeup.9 \
 	vm_page_wire.9 \
 	vm_set_page_size.9 \
+	vmem.9 \
 	vn_fullpath.9 \
 	vn_isdisk.9 \
 	vnode.9 \

Added: head/share/man/man9/vmem.9
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man9/vmem.9	Fri Jul 12 14:25:58 2013	(r253267)
@@ -0,0 +1,323 @@
+.\"	$NetBSD: vmem.9,v 1.15 2013/01/29 22:02:17 wiz Exp $
+.\"
+.\" Copyright (c)2006 YAMAMOTO Takashi,
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.\" ------------------------------------------------------------
+.Dd July 12, 2013
+.Dt VMEM 9
+.Os
+.\" ------------------------------------------------------------
+.Sh NAME
+.Nm vmem
+.Nd general purpose resource allocator
+.\" ------------------------------------------------------------
+.Sh SYNOPSIS
+.In sys/vmem.h
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Ft vmem_t *
+.Fn vmem_create \
+"const char *name" "vmem_addr_t base" "vmem_size_t size" "vmem_size_t quantum" \
+"vmem_size_t qcache_max" "int flags"
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Ft int
+.Fn vmem_add \
+"vmem_t *vm" "vmem_addr_t addr" "vmem_size_t size" "int flags"
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Ft int
+.Fn vmem_xalloc \
+"vmem_t *vm" "const vmem_size_t size" "vmem_size_t align" \
+"const vmem_size_t phase" "const vmem_size_t nocross" \
+"const vmem_addr_t minaddr" "const vmem_addr_t maxaddr" "int flags" \
+"vmem_addr_t *addrp"
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Ft void
+.Fn vmem_xfree "vmem_t *vm" "vmem_addr_t addr" "vmem_size_t size"
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Ft int
+.Fn vmem_alloc "vmem_t *vm" "vmem_size_t size" "int flags" "vmem_addr_t *addrp"
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Ft void
+.Fn vmem_free "vmem_t *vm" "vmem_addr_t addr" "vmem_size_t size"
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Ft void
+.Fn vmem_destroy "vmem_t *vm"
+.\" ------------------------------------------------------------
+.Sh DESCRIPTION
+The
+.Nm
+is a general purpose resource allocator.
+Despite its name, it can be used for arbitrary resources
+other than virtual memory.
+.Pp
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Fn vmem_create
+creates a new vmem arena.
+.Pp
+.Bl -tag -width qcache_max
+.It Fa name
+The string to describe the vmem.
+.It Fa base
+The start address of the initial span.
+Pass
+.Dv 0
+if no initial span is required.
+.It Fa size
+The size of the initial span.
+Pass
+.Dv 0
+if no initial span is required.
+.It Fa quantum
+The smallest unit of allocation.
+.It Fa qcache_max
+The largest size of allocations which can be served by quantum cache.
+It is merely a hint and can be ignored.
+.It Fa flags
+Combination of
+.Xr malloc 9
+wait flag and
+.Nm
+allocation strategy flag:
+.Bl -tag -width M_FIRSTFIT
+.It Dv M_FIRSTFIT
+Prefer allocation performance.
+.It Dv M_BESTFIT
+Prefer space efficiency.
+.El
+.El
+.Pp
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Fn vmem_add
+adds a span of size
+.Fa size
+starting at
+.Fa addr
+to the arena.
+Returns
+0
+on success,
+.Dv ENOMEM
+on failure.
+.Fa flags
+is
+.Xr malloc 9
+wait flag.
+.Pp
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Fn vmem_xalloc
+allocates a resource from the arena.
+.Pp
+.Bl -tag -width nocross
+.It Fa vm
+The arena which we allocate from.
+.It Fa size
+Specify the size of the allocation.
+.It Fa align
+If zero, don't care about the alignment of the allocation.
+Otherwise, request a resource segment starting at
+offset
+.Fa phase
+from an
+.Fa align
+aligned boundary.
+.It Fa phase
+See the above description of
+.Fa align .
+If
+.Fa align
+is zero,
+.Fa phase
+should be zero.
+Otherwise,
+.Fa phase
+should be smaller than
+.Fa align .
+.It Fa nocross
+Request a resource which doesn't cross
+.Fa nocross
+aligned boundary.
+.It Fa minaddr
+Specify the minimum address which can be allocated, or
+.Dv VMEM_ADDR_MIN
+if the caller does not care.
+.It Fa maxaddr
+Specify the maximum address which can be allocated, or
+.Dv VMEM_ADDR_MAX
+if the caller does not care.
+.It Fa flags
+A bitwise OR of an allocation strategy and a
+.Xr malloc 8
+wait flag.
+The allocation strategy is one of
+.Dv M_FIRSTFIT
+and
+.Dv M_BESTFIT .
+.It Fa addrp
+On success, if
+.Fa addrp
+is not
+.Dv NULL ,
+.Fn vmem_xalloc
+overwrites it with the start address of the allocated span.
+.El
+.Pp
+.\" ------------------------------------------------------------
+.Fn vmem_xfree
+frees resource allocated by
+.Fn vmem_xalloc
+to the arena.
+.Pp
+.Bl -tag -width addr
+.It Fa vm
+The arena which we free to.
+.It Fa addr
+The resource being freed.
+It must be the one returned by
+.Fn vmem_xalloc .
+Notably, it must not be the one from
+.Fn vmem_alloc .
+Otherwise, the behaviour is undefined.
+.It Fa size
+The size of the resource being freed.
+It must be the same as the
+.Fa size
+argument used for
+.Fn vmem_xalloc .
+.El
+.Pp
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Fn vmem_alloc
+allocates a resource from the arena.
+.Pp
+.Bl -tag -width flags
+.It Fa vm
+The arena which we allocate from.
+.It Fa size
+Specify the size of the allocation.
+.It Fa flags
+A bitwise OR of an
+.Nm
+allocation strategy flag (see above) and a
+.Xr malloc 9
+sleep flag.
+.It Fa addrp
+On success, if
+.Fa addrp
+is not
+.Dv NULL ,
+.Fn vmem_alloc
+overwrites it with the start address of the allocated span.
+.El
+.Pp
+.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+.Fn vmem_free
+frees resource allocated by
+.Fn vmem_alloc
+to the arena.
+.Pp
+.Bl -tag -width addr
+.It Fa vm
+The arena which we free to.
+.It Fa addr
+The resource being freed.
+It must be the one returned by
+.Fn vmem_alloc .
+Notably, it must not be the one from
+.Fn vmem_xalloc .
+Otherwise, the behaviour is undefined.
+.It Fa size
+The size of the resource being freed.
+It must be the same as the
+.Fa size
+argument used for
+.Fn vmem_alloc .
+.El
+.Pp
+.\" ------------------------------------------------------------
+.Fn vmem_destroy
+destroys a vmem arena.
+.Pp
+.Bl -tag -width vm
+.It Fa vm
+The vmem arena being destroyed.
+The caller should ensure that no one will use it anymore.
+.El
+.\" ------------------------------------------------------------
+.Sh RETURN VALUES
+.Fn vmem_create
+returns a pointer to the newly allocated vmem_t.
+Otherwise, it returns
+.Dv NULL .
+.Pp
+On success,
+.Fn vmem_xalloc
+and
+.Fn vmem_alloc
+return 0.
+Otherwise,
+.Dv ENOMEM
+is returned.
+.\" ------------------------------------------------------------
+.Sh CODE REFERENCES
+The
+.Nm
+subsystem is implemented within the file
+.Pa sys/kern/subr_vmem.c .
+.\" ------------------------------------------------------------
+.Sh SEE ALSO
+.Xr malloc 9
+.Rs
+.%A Jeff Bonwick
+.%A Jonathan Adams
+.%T "Magazines and Vmem: Extending the Slab Allocator to Many CPUs and Arbitrary Resources"
+.%J "2001 USENIX Annual Technical Conference"
+.%D 2001
+.Re
+.\" ------------------------------------------------------------
+.Sh HISTORY
+The
+.Nm
+allocator was originally implemented in
+.Nx .
+It was introduced in
+.Fx 10.0 .
+.Sh AUTHORS
+.An -nosplit
+Original implementation of
+.Nm
+was written by
+.An "YAMAMOTO Takashi" .
+The
+.Fx
+port was made by
+.An "Jeff Roberson" .
+.Sh BUGS
+.Pp
+.Nm
+relies on
+.Xr malloc 9 ,
+so it cannot be used as early during system bootstrap as
+.Xr extent 9 .

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 14:46:41 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 08A762A9;
 Fri, 12 Jul 2013 14:46:41 +0000 (UTC)
 (envelope-from glebius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id ED9921A53;
 Fri, 12 Jul 2013 14:46:40 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CEkeMY034068;
 Fri, 12 Jul 2013 14:46:40 GMT (envelope-from glebius@svn.freebsd.org)
Received: (from glebius@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CEkeBX034067;
 Fri, 12 Jul 2013 14:46:40 GMT (envelope-from glebius@svn.freebsd.org)
Message-Id: <201307121446.r6CEkeBX034067@svn.freebsd.org>
From: Gleb Smirnoff 
Date: Fri, 12 Jul 2013 14:46:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253268 - head/share/man/man9
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 14:46:41 -0000

Author: glebius
Date: Fri Jul 12 14:46:40 2013
New Revision: 253268
URL: http://svnweb.freebsd.org/changeset/base/253268

Log:
  Remove non existent in FreeBSD reference.

Modified:
  head/share/man/man9/vmem.9

Modified: head/share/man/man9/vmem.9
==============================================================================
--- head/share/man/man9/vmem.9	Fri Jul 12 14:25:58 2013	(r253267)
+++ head/share/man/man9/vmem.9	Fri Jul 12 14:46:40 2013	(r253268)
@@ -319,5 +319,4 @@ port was made by
 .Nm
 relies on
 .Xr malloc 9 ,
-so it cannot be used as early during system bootstrap as
-.Xr extent 9 .
+so it cannot be used as early during system bootstrap.

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 14:58:09 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id E3B2D5D6;
 Fri, 12 Jul 2013 14:58:09 +0000 (UTC)
 (envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id D5EE41AE3;
 Fri, 12 Jul 2013 14:58:09 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CEw9H5036989;
 Fri, 12 Jul 2013 14:58:09 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CEw98v036988;
 Fri, 12 Jul 2013 14:58:09 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201307121458.r6CEw98v036988@svn.freebsd.org>
From: Michael Tuexen 
Date: Fri, 12 Jul 2013 14:58:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253269 - stable/9/lib/libc/net
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 14:58:10 -0000

Author: tuexen
Date: Fri Jul 12 14:58:09 2013
New Revision: 253269
URL: http://svnweb.freebsd.org/changeset/base/253269

Log:
  MFC r253104:
  Fix a bug where SCTP_ENABLE_STREAM_RESET is not handled by
  sctp_opt_info().
  
  MFC r253105:
  Fix the handling of SCTP_CURRENT_ASSOC and SCTP_ALL_ASSOC in
  sctp_opt_info().
  
  Approved by: re@

Modified:
  stable/9/lib/libc/net/sctp_sys_calls.c
Directory Properties:
  stable/9/lib/   (props changed)
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/net/sctp_sys_calls.c
==============================================================================
--- stable/9/lib/libc/net/sctp_sys_calls.c	Fri Jul 12 14:46:40 2013	(r253268)
+++ stable/9/lib/libc/net/sctp_sys_calls.c	Fri Jul 12 14:58:09 2013	(r253269)
@@ -274,6 +274,11 @@ sctp_opt_info(int sd, sctp_assoc_t id, i
 		errno = EINVAL;
 		return (-1);
 	}
+	if ((id == SCTP_CURRENT_ASSOC) ||
+	    (id == SCTP_ALL_ASSOC)) {
+		errno = EINVAL;
+		return (-1);
+	}
 	switch (opt) {
 	case SCTP_RTOINFO:
 		((struct sctp_rtoinfo *)arg)->srto_assoc_id = id;
@@ -338,6 +343,9 @@ sctp_opt_info(int sd, sctp_assoc_t id, i
 	case SCTP_MAX_BURST:
 		((struct sctp_assoc_value *)arg)->assoc_id = id;
 		break;
+	case SCTP_ENABLE_STREAM_RESET:
+		((struct sctp_assoc_value *)arg)->assoc_id = id;
+		break;
 	default:
 		break;
 	}

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 15:08:38 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 374B594D;
 Fri, 12 Jul 2013 15:08:38 +0000 (UTC)
 (envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 0FA4B1B4B;
 Fri, 12 Jul 2013 15:08:38 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CF8bb4042951;
 Fri, 12 Jul 2013 15:08:37 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CF8bbd042950;
 Fri, 12 Jul 2013 15:08:37 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201307121508.r6CF8bbd042950@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Fri, 12 Jul 2013 15:08:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253270 - head/share/man/man9
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 15:08:38 -0000

Author: pluknet
Date: Fri Jul 12 15:08:37 2013
New Revision: 253270
URL: http://svnweb.freebsd.org/changeset/base/253270

Log:
  - mdoc: remove superfluous paragraph macros.
  - fix typo in xref manual section number.

Modified:
  head/share/man/man9/vmem.9

Modified: head/share/man/man9/vmem.9
==============================================================================
--- head/share/man/man9/vmem.9	Fri Jul 12 14:58:09 2013	(r253269)
+++ head/share/man/man9/vmem.9	Fri Jul 12 15:08:37 2013	(r253270)
@@ -76,7 +76,6 @@ other than virtual memory.
 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 .Fn vmem_create
 creates a new vmem arena.
-.Pp
 .Bl -tag -width qcache_max
 .It Fa name
 The string to describe the vmem.
@@ -129,7 +128,6 @@ wait flag.
 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 .Fn vmem_xalloc
 allocates a resource from the arena.
-.Pp
 .Bl -tag -width nocross
 .It Fa vm
 The arena which we allocate from.
@@ -169,7 +167,7 @@ Specify the maximum address which can be
 if the caller does not care.
 .It Fa flags
 A bitwise OR of an allocation strategy and a
-.Xr malloc 8
+.Xr malloc 9
 wait flag.
 The allocation strategy is one of
 .Dv M_FIRSTFIT
@@ -189,7 +187,6 @@ overwrites it with the start address of 
 frees resource allocated by
 .Fn vmem_xalloc
 to the arena.
-.Pp
 .Bl -tag -width addr
 .It Fa vm
 The arena which we free to.
@@ -211,7 +208,6 @@ argument used for
 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 .Fn vmem_alloc
 allocates a resource from the arena.
-.Pp
 .Bl -tag -width flags
 .It Fa vm
 The arena which we allocate from.
@@ -237,7 +233,6 @@ overwrites it with the start address of 
 frees resource allocated by
 .Fn vmem_alloc
 to the arena.
-.Pp
 .Bl -tag -width addr
 .It Fa vm
 The arena which we free to.
@@ -259,7 +254,6 @@ argument used for
 .\" ------------------------------------------------------------
 .Fn vmem_destroy
 destroys a vmem arena.
-.Pp
 .Bl -tag -width vm
 .It Fa vm
 The vmem arena being destroyed.
@@ -315,7 +309,6 @@ The
 port was made by
 .An "Jeff Roberson" .
 .Sh BUGS
-.Pp
 .Nm
 relies on
 .Xr malloc 9 ,

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 15:29:42 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 2CDAFD9A;
 Fri, 12 Jul 2013 15:29:42 +0000 (UTC)
 (envelope-from jilles@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 1DB441C15;
 Fri, 12 Jul 2013 15:29:42 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CFTfJN048985;
 Fri, 12 Jul 2013 15:29:41 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CFTftp048983;
 Fri, 12 Jul 2013 15:29:41 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201307121529.r6CFTftp048983@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Fri, 12 Jul 2013 15:29:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253271 - in head: bin/sh
 tools/regression/bin/sh/execution
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 15:29:42 -0000

Author: jilles
Date: Fri Jul 12 15:29:41 2013
New Revision: 253271
URL: http://svnweb.freebsd.org/changeset/base/253271

Log:
  sh: Do not read from stdin if an error occurs during -i -c cmd.
  
  Although using -i with -c does not seem very useful, it seems inappropriate
  to read commands from the terminal in this case.
  
  Side effect: if the -s -c extension is used and the -s option is turned off
  using 'set +s' during the interactive part, the shell now exits after an
  error or interrupt. Note that POSIX only specifies -s as option to sh, not
  to set.
  
  See also Austin Group issue #718.

Added:
  head/tools/regression/bin/sh/execution/int-cmd1.0   (contents, props changed)
Modified:
  head/bin/sh/main.c

Modified: head/bin/sh/main.c
==============================================================================
--- head/bin/sh/main.c	Fri Jul 12 15:08:37 2013	(r253270)
+++ head/bin/sh/main.c	Fri Jul 12 15:29:41 2013	(r253271)
@@ -170,8 +170,8 @@ state3:
 	if (minusc) {
 		evalstring(minusc, sflag ? 0 : EV_EXIT);
 	}
+state4:
 	if (sflag || minusc == NULL) {
-state4:	/* XXX ??? - why isn't this before the "if" statement */
 		cmdloop(1);
 	}
 	exitshell(exitstatus);

Added: head/tools/regression/bin/sh/execution/int-cmd1.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/execution/int-cmd1.0	Fri Jul 12 15:29:41 2013	(r253271)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+! echo echo bad | $SH -ic 'fi' 2>/dev/null

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 15:56:30 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id B36E68F7;
 Fri, 12 Jul 2013 15:56:30 +0000 (UTC)
 (envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id A5CEE1D77;
 Fri, 12 Jul 2013 15:56:30 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CFuUfC057123;
 Fri, 12 Jul 2013 15:56:30 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CFuU6i057122;
 Fri, 12 Jul 2013 15:56:30 GMT
 (envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201307121556.r6CFuU6i057122@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 12 Jul 2013 15:56:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253272 - head/sys/powerpc/aim
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 15:56:30 -0000

Author: nwhitehorn
Date: Fri Jul 12 15:56:30 2013
New Revision: 253272
URL: http://svnweb.freebsd.org/changeset/base/253272

Log:
  Fix check: bitwise and has only one &.
  
  MFC after:	1 week

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c	Fri Jul 12 15:29:41 2013	(r253271)
+++ head/sys/powerpc/aim/mmu_oea64.c	Fri Jul 12 15:56:30 2013	(r253272)
@@ -1978,7 +1978,7 @@ moea64_pvo_protect(mmu_t mmu,  pmap_t pm
 	 * removed write access.
 	 */
 	if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED && 
-	    (oldlo & LPTE_PP) != LPTE_BR && !(prot && VM_PROT_WRITE)) {
+	    (oldlo & LPTE_PP) != LPTE_BR && !(prot & VM_PROT_WRITE)) {
 		if (pg != NULL) {
 			if (pvo->pvo_pte.lpte.pte_lo & LPTE_CHG)
 				vm_page_dirty(pg);

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 15:57:32 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 4142FAC0;
 Fri, 12 Jul 2013 15:57:32 +0000 (UTC)
 (envelope-from nwhitehorn@freebsd.org)
Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119])
 by mx1.freebsd.org (Postfix) with ESMTP id 1C6511D8A;
 Fri, 12 Jul 2013 15:57:31 +0000 (UTC)
Received: from localhost (localhost.localdomain [127.0.0.1])
 by mail.icecube.wisc.edu (Postfix) with ESMTP id BEEB858380;
 Fri, 12 Jul 2013 10:57:25 -0500 (CDT)
X-Virus-Scanned: amavisd-new at icecube.wisc.edu
Received: from mail.icecube.wisc.edu ([127.0.0.1])
 by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030)
 with ESMTP id qQpR7FqM86Pl; Fri, 12 Jul 2013 10:57:25 -0500 (CDT)
Received: from terminus.icecube.wisc.edu (terminus.icecube.wisc.edu
 [172.16.223.97])
 by mail.icecube.wisc.edu (Postfix) with ESMTP id 8638E5837F;
 Fri, 12 Jul 2013 10:57:25 -0500 (CDT)
Message-ID: <51E02765.7010306@freebsd.org>
Date: Fri, 12 Jul 2013 10:57:25 -0500
From: Nathan Whitehorn 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:17.0) Gecko/20130627 Thunderbird/17.0.7
MIME-Version: 1.0
To: Nathan Whitehorn 
Subject: Re: svn commit: r253272 - head/sys/powerpc/aim
References: <201307121556.r6CFuU6i057122@svn.freebsd.org>
In-Reply-To: <201307121556.r6CFuU6i057122@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
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 15:57:32 -0000

On 07/12/13 10:56, Nathan Whitehorn wrote:
> Author: nwhitehorn
> Date: Fri Jul 12 15:56:30 2013
> New Revision: 253272
> URL: http://svnweb.freebsd.org/changeset/base/253272
>
> Log:
>    Fix check: bitwise and has only one &.
>    
>    MFC after:	1 week
>

Thanks to rdivacky for finding this!
-Nathan

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 16:41:59 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id B346112C;
 Fri, 12 Jul 2013 16:41:59 +0000 (UTC)
 (envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 951A71FB8;
 Fri, 12 Jul 2013 16:41:59 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CGfx4S071153;
 Fri, 12 Jul 2013 16:41:59 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CGfw9R071149;
 Fri, 12 Jul 2013 16:41:58 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201307121641.r6CGfw9R071149@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 12 Jul 2013 16:41:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253273 - stable/9/sys/dev/pci
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 16:41:59 -0000

Author: marius
Date: Fri Jul 12 16:41:58 2013
New Revision: 253273
URL: http://svnweb.freebsd.org/changeset/base/253273

Log:
  MFC: r253120
  
  - As it turns out, not only MSI-X is broken for devices passed through by
    VMware up to at least ESXi 5.1. Actually, using INTx in that case instead
    may still result in interrupt storms, with MSI being the only working
    option in some configurations. So introduce a PCI_QUIRK_DISABLE_MSIX quirk
    which only blacklists MSI-X but not also MSI and use it for the VMware
    PCI-PCI-bridges. Note that, currently, we still assume that if MSI doesn't
    work, MSI-X won't work either - but that's part of the internal logic and
    not guaranteed as part of the API contract. While at it, add and employ
    a pci_has_quirk() helper.
    Reported and tested by: Paul Bucher
  - Use NULL instead of 0 for pointers.
  
  Submitted by:	jhb (mostly)
  Approved by:	re (hrs), jhb

Modified:
  stable/9/sys/dev/pci/pci.c
  stable/9/sys/dev/pci/pci_pci.c
  stable/9/sys/dev/pci/pcib_private.h
  stable/9/sys/dev/pci/pcivar.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/pci/pci.c
==============================================================================
--- stable/9/sys/dev/pci/pci.c	Fri Jul 12 15:56:30 2013	(r253272)
+++ stable/9/sys/dev/pci/pci.c	Fri Jul 12 16:41:58 2013	(r253273)
@@ -89,6 +89,7 @@ __FBSDID("$FreeBSD$");
 	(((cfg)->hdrtype == PCIM_HDRTYPE_NORMAL && reg == PCIR_BIOS) ||	\
 	 ((cfg)->hdrtype == PCIM_HDRTYPE_BRIDGE && reg == PCIR_BIOS_1))
 
+static int		pci_has_quirk(uint32_t devid, int quirk);
 static pci_addr_t	pci_mapbase(uint64_t mapreg);
 static const char	*pci_maptype(uint64_t mapreg);
 static int		pci_mapsize(uint64_t testval);
@@ -130,6 +131,7 @@ static void		pci_enable_msix(device_t de
 static void		pci_mask_msix(device_t dev, u_int index);
 static void		pci_unmask_msix(device_t dev, u_int index);
 static int		pci_msi_blacklisted(void);
+static int		pci_msix_blacklisted(void);
 static void		pci_resume_msi(device_t dev);
 static void		pci_resume_msix(device_t dev);
 static int		pci_remap_intr_method(device_t bus, device_t dev,
@@ -193,7 +195,7 @@ static device_method_t pci_methods[] = {
 DEFINE_CLASS_0(pci, pci_driver, pci_methods, sizeof(struct pci_softc));
 
 static devclass_t pci_devclass;
-DRIVER_MODULE(pci, pcib, pci_driver, pci_devclass, pci_modevent, 0);
+DRIVER_MODULE(pci, pcib, pci_driver, pci_devclass, pci_modevent, NULL);
 MODULE_VERSION(pci, 1);
 
 static char	*pci_vendordata;
@@ -203,15 +205,16 @@ struct pci_quirk {
 	uint32_t devid;	/* Vendor/device of the card */
 	int	type;
 #define	PCI_QUIRK_MAP_REG	1 /* PCI map register in weird place */
-#define	PCI_QUIRK_DISABLE_MSI	2 /* MSI/MSI-X doesn't work */
+#define	PCI_QUIRK_DISABLE_MSI	2 /* Neither MSI nor MSI-X work */
 #define	PCI_QUIRK_ENABLE_MSI_VM	3 /* Older chipset in VM where MSI works */
 #define	PCI_QUIRK_UNMAP_REG	4 /* Ignore PCI map register */
+#define	PCI_QUIRK_DISABLE_MSIX	5 /* MSI-X doesn't work */
 	int	arg1;
 	int	arg2;
 };
 
 static const struct pci_quirk pci_quirks[] = {
-	/* The Intel 82371AB and 82443MX has a map register at offset 0x90. */
+	/* The Intel 82371AB and 82443MX have a map register at offset 0x90. */
 	{ 0x71138086, PCI_QUIRK_MAP_REG,	0x90,	 0 },
 	{ 0x719b8086, PCI_QUIRK_MAP_REG,	0x90,	 0 },
 	/* As does the Serverworks OSB4 (the SMBus mapping register) */
@@ -246,8 +249,8 @@ static const struct pci_quirk pci_quirks
 	 * MSI-X allocation doesn't work properly for devices passed through
 	 * by VMware up to at least ESXi 5.1.
 	 */
-	{ 0x079015ad, PCI_QUIRK_DISABLE_MSI,	0,	0 }, /* PCI/PCI-X */
-	{ 0x07a015ad, PCI_QUIRK_DISABLE_MSI,	0,	0 }, /* PCIe */
+	{ 0x079015ad, PCI_QUIRK_DISABLE_MSIX,	0,	0 }, /* PCI/PCI-X */
+	{ 0x07a015ad, PCI_QUIRK_DISABLE_MSIX,	0,	0 }, /* PCIe */
 
 	/*
 	 * Some virtualization environments emulate an older chipset
@@ -329,7 +332,7 @@ SYSCTL_INT(_hw_pci, OID_AUTO, enable_msi
 static int pci_honor_msi_blacklist = 1;
 TUNABLE_INT("hw.pci.honor_msi_blacklist", &pci_honor_msi_blacklist);
 SYSCTL_INT(_hw_pci, OID_AUTO, honor_msi_blacklist, CTLFLAG_RD,
-    &pci_honor_msi_blacklist, 1, "Honor chipset blacklist for MSI");
+    &pci_honor_msi_blacklist, 1, "Honor chipset blacklist for MSI/MSI-X");
 
 #if defined(__i386__) || defined(__amd64__)
 static int pci_usb_takeover = 1;
@@ -342,6 +345,18 @@ SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_
 Disable this if you depend on BIOS emulation of USB devices, that is\n\
 you use USB devices (like keyboard or mouse) but do not load USB drivers");
 
+static int
+pci_has_quirk(uint32_t devid, int quirk)
+{
+	const struct pci_quirk *q;
+
+	for (q = &pci_quirks[0]; q->devid; q++) {
+		if (q->devid == devid && q->type == quirk)
+			return (1);
+	}
+	return (0);
+}
+
 /* Find a device_t by bus/slot/function in domain 0 */
 
 device_t
@@ -1358,8 +1373,8 @@ pci_alloc_msix_method(device_t dev, devi
 	if (cfg->msi.msi_alloc != 0 || cfg->msix.msix_alloc != 0)
 		return (ENXIO);
 
-	/* If MSI is blacklisted for this system, fail. */
-	if (pci_msi_blacklisted())
+	/* If MSI-X is blacklisted for this system, fail. */
+	if (pci_msix_blacklisted())
 		return (ENXIO);
 
 	/* MSI-X capability present? */
@@ -1911,38 +1926,15 @@ pci_remap_intr_method(device_t bus, devi
 int
 pci_msi_device_blacklisted(device_t dev)
 {
-	const struct pci_quirk *q;
 
 	if (!pci_honor_msi_blacklist)
 		return (0);
 
-	for (q = &pci_quirks[0]; q->devid; q++) {
-		if (q->devid == pci_get_devid(dev) &&
-		    q->type == PCI_QUIRK_DISABLE_MSI)
-			return (1);
-	}
-	return (0);
-}
-
-/*
- * Returns true if a specified chipset supports MSI when it is
- * emulated hardware in a virtual machine.
- */
-static int
-pci_msi_vm_chipset(device_t dev)
-{
-	const struct pci_quirk *q;
-
-	for (q = &pci_quirks[0]; q->devid; q++) {
-		if (q->devid == pci_get_devid(dev) &&
-		    q->type == PCI_QUIRK_ENABLE_MSI_VM)
-			return (1);
-	}
-	return (0);
+	return (pci_has_quirk(pci_get_devid(dev), PCI_QUIRK_DISABLE_MSI));
 }
 
 /*
- * Determine if MSI is blacklisted globally on this sytem.  Currently,
+ * Determine if MSI is blacklisted globally on this system.  Currently,
  * we just check for blacklisted chipsets as represented by the
  * host-PCI bridge at device 0:0:0.  In the future, it may become
  * necessary to check other system attributes, such as the kenv values
@@ -1959,9 +1951,14 @@ pci_msi_blacklisted(void)
 	/* Blacklist all non-PCI-express and non-PCI-X chipsets. */
 	if (!(pcie_chipset || pcix_chipset)) {
 		if (vm_guest != VM_GUEST_NO) {
+			/*
+			 * Whitelist older chipsets in virtual
+			 * machines known to support MSI.
+			 */
 			dev = pci_find_bsf(0, 0, 0);
 			if (dev != NULL)
-				return (pci_msi_vm_chipset(dev) == 0);
+				return (!pci_has_quirk(pci_get_devid(dev),
+					PCI_QUIRK_ENABLE_MSI_VM));
 		}
 		return (1);
 	}
@@ -1973,6 +1970,45 @@ pci_msi_blacklisted(void)
 }
 
 /*
+ * Returns true if the specified device is blacklisted because MSI-X
+ * doesn't work.  Note that this assumes that if MSI doesn't work,
+ * MSI-X doesn't either.
+ */
+int
+pci_msix_device_blacklisted(device_t dev)
+{
+
+	if (!pci_honor_msi_blacklist)
+		return (0);
+
+	if (pci_has_quirk(pci_get_devid(dev), PCI_QUIRK_DISABLE_MSIX))
+		return (1);
+
+	return (pci_msi_device_blacklisted(dev));
+}
+
+/*
+ * Determine if MSI-X is blacklisted globally on this system.  If MSI
+ * is blacklisted, assume that MSI-X is as well.  Check for additional
+ * chipsets where MSI works but MSI-X does not.
+ */
+static int
+pci_msix_blacklisted(void)
+{
+	device_t dev;
+
+	if (!pci_honor_msi_blacklist)
+		return (0);
+
+	dev = pci_find_bsf(0, 0, 0);
+	if (dev != NULL && pci_has_quirk(pci_get_devid(dev),
+	    PCI_QUIRK_DISABLE_MSIX))
+		return (1);
+
+	return (pci_msi_blacklisted());
+}
+
+/*
  * Attempt to allocate *count MSI messages.  The actual number allocated is
  * returned in *count.  After this function returns, each message will be
  * available to the driver as SYS_RES_IRQ resources starting at a rid 1.

Modified: stable/9/sys/dev/pci/pci_pci.c
==============================================================================
--- stable/9/sys/dev/pci/pci_pci.c	Fri Jul 12 15:56:30 2013	(r253272)
+++ stable/9/sys/dev/pci/pci_pci.c	Fri Jul 12 16:41:58 2013	(r253273)
@@ -100,7 +100,7 @@ static device_method_t pcib_methods[] = 
 static devclass_t pcib_devclass;
 
 DEFINE_CLASS_0(pcib, pcib_driver, pcib_methods, sizeof(struct pcib_softc));
-DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, 0, 0);
+DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL);
 
 #ifdef NEW_PCIB
 /*
@@ -624,6 +624,9 @@ pcib_attach_common(device_t dev)
     if (pci_msi_device_blacklisted(dev))
 	sc->flags |= PCIB_DISABLE_MSI;
 
+    if (pci_msix_device_blacklisted(dev))
+	sc->flags |= PCIB_DISABLE_MSIX;
+
     /*
      * Intel 815, 845 and other chipsets say they are PCI-PCI bridges,
      * but have a ProgIF of 0x80.  The 82801 family (AA, AB, BAM/CAM,
@@ -1379,7 +1382,7 @@ pcib_alloc_msix(device_t pcib, device_t 
 	struct pcib_softc *sc = device_get_softc(pcib);
 	device_t bus;
 
-	if (sc->flags & PCIB_DISABLE_MSI)
+	if (sc->flags & PCIB_DISABLE_MSIX)
 		return (ENXIO);
 	bus = device_get_parent(pcib);
 	return (PCIB_ALLOC_MSIX(device_get_parent(bus), dev, irq));

Modified: stable/9/sys/dev/pci/pcib_private.h
==============================================================================
--- stable/9/sys/dev/pci/pcib_private.h	Fri Jul 12 15:56:30 2013	(r253272)
+++ stable/9/sys/dev/pci/pcib_private.h	Fri Jul 12 16:41:58 2013	(r253273)
@@ -91,6 +91,7 @@ struct pcib_softc 
     uint32_t	flags;		/* flags */
 #define	PCIB_SUBTRACTIVE	0x1
 #define	PCIB_DISABLE_MSI	0x2
+#define	PCIB_DISABLE_MSIX	0x4
     uint16_t	command;	/* command register */
     u_int	domain;		/* domain number */
     u_int	pribus;		/* primary bus number */

Modified: stable/9/sys/dev/pci/pcivar.h
==============================================================================
--- stable/9/sys/dev/pci/pcivar.h	Fri Jul 12 15:56:30 2013	(r253272)
+++ stable/9/sys/dev/pci/pcivar.h	Fri Jul 12 16:41:58 2013	(r253273)
@@ -463,6 +463,7 @@ device_t pci_find_class(uint8_t class, u
 int	pci_pending_msix(device_t dev, u_int index);
 
 int	pci_msi_device_blacklisted(device_t dev);
+int	pci_msix_device_blacklisted(device_t dev);
 
 void	pci_ht_map_msi(device_t dev, uint64_t addr);
 

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 17:09:50 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id DE82E68A;
 Fri, 12 Jul 2013 17:09:50 +0000 (UTC) (envelope-from ken@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id D08CF10D2;
 Fri, 12 Jul 2013 17:09:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CH9osA078054;
 Fri, 12 Jul 2013 17:09:50 GMT (envelope-from ken@svn.freebsd.org)
Received: (from ken@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CH9oZr078053;
 Fri, 12 Jul 2013 17:09:50 GMT (envelope-from ken@svn.freebsd.org)
Message-Id: <201307121709.r6CH9oZr078053@svn.freebsd.org>
From: "Kenneth D. Merry" 
Date: Fri, 12 Jul 2013 17:09:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253274 - head/sys/cam/scsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 17:09:51 -0000

Author: ken
Date: Fri Jul 12 17:09:50 2013
New Revision: 253274
URL: http://svnweb.freebsd.org/changeset/base/253274

Log:
  Fix a problem with READ ELEMENT STATUS that occurs on some
  changers that don't support the DVCID and CURDATA bits that were
  introduced in the SMC spec.
  
  These changers will return an Illegal Request type error if the
  bits are set.  This causes "chio status" to fail.
  
  The fix is two-fold.  First, for changers that claim to be SCSI-2
  or older, don't set the DVCID and CURDATA bits for READ ELEMENT
  STATUS.  For newer changers (SCSI-3 and newer), we default to
  setting the new bits, but back off and try the READ ELEMENT STATUS
  without the bits if we get an Illegal Request type error.
  
  This has been tested on a Qualstar TLS-8211, which is a SCSI-2
  changer that does not support the new bits, and a Spectra T-380,
  which is a SCSI-3 changer that does support the new bits.  In the
  absence of a SCSI-3 changer that does not support the bits, I
  tested that with some error injection code.  (The SMC spec says
  that support for CURDATA is mandatory, and DVCID is optional.)
  
  scsi_ch.c:	Add a new quirk, CH_Q_NO_DVCID that gets set for
  		SCSI-2 and older libraries, or newer libraries that
  		report errors when the DVCID/CURDATA bits are set.
  
  		In chgetelemstatus(), use the new quirk to
  		determine whether or not to set DVCID and CURDATA.
  		If we get an error with the bits set, back off and
  		try without the bits.  Set the quirk flag if the
  		read element status succeeds without the bits set.
  
  		Increase the READ ELEMENT STATUS timeout to 60
  		seconds after testing with a Spectra T-380.  The
  		previous value was 10 seconds, and too short for
  		the T-380.  This may be decreased later after
  		some additional testing and investigation.
  
  Tested by:	Andre Albsmeier 
  Sponsored by:	Spectra Logic
  MFC after:	3 days

Modified:
  head/sys/cam/scsi/scsi_ch.c

Modified: head/sys/cam/scsi/scsi_ch.c
==============================================================================
--- head/sys/cam/scsi/scsi_ch.c	Fri Jul 12 16:41:58 2013	(r253273)
+++ head/sys/cam/scsi/scsi_ch.c	Fri Jul 12 17:09:50 2013	(r253274)
@@ -102,7 +102,7 @@ static const u_int32_t	CH_TIMEOUT_MODE_S
 static const u_int32_t	CH_TIMEOUT_MOVE_MEDIUM               = 100000;
 static const u_int32_t	CH_TIMEOUT_EXCHANGE_MEDIUM           = 100000;
 static const u_int32_t	CH_TIMEOUT_POSITION_TO_ELEMENT       = 100000;
-static const u_int32_t	CH_TIMEOUT_READ_ELEMENT_STATUS       = 10000;
+static const u_int32_t	CH_TIMEOUT_READ_ELEMENT_STATUS       = 60000;
 static const u_int32_t	CH_TIMEOUT_SEND_VOLTAG		     = 10000;
 static const u_int32_t	CH_TIMEOUT_INITIALIZE_ELEMENT_STATUS = 500000;
 
@@ -122,12 +122,14 @@ typedef enum {
 
 typedef enum {
 	CH_Q_NONE	= 0x00,
-	CH_Q_NO_DBD	= 0x01
+	CH_Q_NO_DBD	= 0x01,
+	CH_Q_NO_DVCID	= 0x02
 } ch_quirks;
 
 #define CH_Q_BIT_STRING	\
 	"\020"		\
-	"\001NO_DBD"
+	"\001NO_DBD"	\
+	"\002NO_DVCID"
 
 #define ccb_state	ppriv_field0
 #define ccb_bp		ppriv_ptr1
@@ -396,6 +398,14 @@ chregister(struct cam_periph *periph, vo
 	periph->softc = softc;
 	softc->quirks = CH_Q_NONE;
 
+	/*
+	 * The DVCID and CURDATA bits were not introduced until the SMC
+	 * spec.  If this device claims SCSI-2 or earlier support, then it
+	 * very likely does not support these bits.
+	 */
+	if (cgd->inq_data.version <= SCSI_REV_2)
+		softc->quirks |= CH_Q_NO_DVCID;
+
 	bzero(&cpi, sizeof(cpi));
 	xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
 	cpi.ccb_h.func_code = XPT_PATH_INQ;
@@ -1208,6 +1218,8 @@ chgetelemstatus(struct cam_periph *perip
 	caddr_t data = NULL;
 	size_t size, desclen;
 	int avail, i, error = 0;
+	int curdata, dvcid, sense_flags;
+	int try_no_dvcid = 0;
 	struct changer_element_status *user_data = NULL;
 	struct ch_softc *softc;
 	union ccb *ccb;
@@ -1239,14 +1251,31 @@ chgetelemstatus(struct cam_periph *perip
 	cam_periph_lock(periph);
 	ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL);
 
+	sense_flags = SF_RETRY_UA;
+	if (softc->quirks & CH_Q_NO_DVCID) {
+		dvcid = 0;
+		curdata = 0;
+	} else {
+		dvcid = 1;
+		curdata = 1;
+		/*
+		 * Don't print anything for an Illegal Request, because
+		 * these flags can cause some changers to complain.  We'll
+		 * retry without them if we get an error.
+		 */
+		sense_flags |= SF_QUIET_IR;
+	}
+
+retry_einval:
+
 	scsi_read_element_status(&ccb->csio,
 				 /* retries */ 1,
 				 /* cbfcnp */ chdone,
 				 /* tag_action */ MSG_SIMPLE_Q_TAG,
 				 /* voltag */ want_voltags,
 				 /* sea */ softc->sc_firsts[chet],
-				 /* dvcid */ 1,
-				 /* curdata */ 1,
+				 /* dvcid */ dvcid,
+				 /* curdata */ curdata,
 				 /* count */ 1,
 				 /* data_ptr */ data,
 				 /* dxfer_len */ 1024,
@@ -1254,9 +1283,38 @@ chgetelemstatus(struct cam_periph *perip
 				 /* timeout */ CH_TIMEOUT_READ_ELEMENT_STATUS);
 
 	error = cam_periph_runccb(ccb, cherror, /*cam_flags*/ CAM_RETRY_SELTO,
-				  /*sense_flags*/ SF_RETRY_UA,
+				  /*sense_flags*/ sense_flags,
 				  softc->device_stats);
 
+	/*
+	 * An Illegal Request sense key (only used if there is no asc/ascq)
+	 * or 0x24,0x00 for an ASC/ASCQ both map to EINVAL.  If dvcid or
+	 * curdata are set (we set both or neither), try turning them off
+	 * and see if the command is successful.
+	 */
+	if ((error == EINVAL)
+	 && (dvcid || curdata))  {
+		dvcid = 0;
+		curdata = 0;
+		error = 0;
+		/* At this point we want to report any Illegal Request */
+		sense_flags &= ~SF_QUIET_IR;
+		try_no_dvcid = 1;
+		goto retry_einval;
+	}
+
+	/*
+	 * In this case, we tried a read element status with dvcid and
+	 * curdata set, and it failed.  We retried without those bits, and
+	 * it succeeded.  Suggest to the user that he set a quirk, so we
+	 * don't go through the retry process the first time in the future.
+	 * This should only happen on changers that claim SCSI-3 or higher,
+	 * but don't support these bits.
+	 */
+	if ((try_no_dvcid != 0)
+	 && (error == 0))
+		softc->quirks |= CH_Q_NO_DVCID;
+
 	if (error)
 		goto done;
 	cam_periph_unlock(periph);
@@ -1284,8 +1342,8 @@ chgetelemstatus(struct cam_periph *perip
 				 /* voltag */ want_voltags,
 				 /* sea */ softc->sc_firsts[chet]
 				 + cesr->cesr_element_base,
-				 /* dvcid */ 1,
-				 /* curdata */ 1,
+				 /* dvcid */ dvcid,
+				 /* curdata */ curdata,
 				 /* count */ cesr->cesr_element_count,
 				 /* data_ptr */ data,
 				 /* dxfer_len */ size,

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 17:11:01 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id EA158847;
 Fri, 12 Jul 2013 17:11:01 +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 9CA2510F5;
 Fri, 12 Jul 2013 17:11:01 +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 r6CHB0re000894;
 Fri, 12 Jul 2013 11:11:00 -0600 (MDT)
 (envelope-from ken@nargothrond.kdm.org)
Received: (from ken@localhost)
 by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r6CHB0xF000893;
 Fri, 12 Jul 2013 11:11:00 -0600 (MDT) (envelope-from ken)
Date: Fri, 12 Jul 2013 11:11:00 -0600
From: "Kenneth D. Merry" 
To: Andre Albsmeier 
Subject: Re: svn commit: r252214 - in stable/9: bin/chio sys/cam/scsi sys/sys
Message-ID: <20130712171100.GA287@nargothrond.kdm.org>
References: <201306252143.r5PLhoM0064338@svn.freebsd.org>
 <20130702055333.GA2729@bali> <20130703052236.GA65730@nargothrond.kdm.org>
 <20130703054349.GA13656@bali> <20130710184915.GA28790@nargothrond.kdm.org>
 <20130710185833.GA83135@bali> <20130711205332.GA26100@nargothrond.kdm.org>
 <20130711220211.GA30392@nargothrond.kdm.org> <20130712053950.GA97972@bali>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20130712053950.GA97972@bali>
User-Agent: Mutt/1.4.2i
Cc: "src-committers@freebsd.org" ,
 "asomers@freebsd.org" ,
 "svn-src-stable@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "svn-src-stable-9@freebsd.org" ,
 "gibbs@freebsd.org" 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 17:11:02 -0000

On Fri, Jul 12, 2013 at 07:39:50 +0200, Andre Albsmeier wrote:
> On Fri, 12-Jul-2013 at 00:02:11 +0200, Kenneth D. Merry wrote:
> > On Thu, Jul 11, 2013 at 14:53:32 -0600, Kenneth D. Merry wrote:
> > > On Wed, Jul 10, 2013 at 20:58:33 +0200, Andre Albsmeier wrote:
> > > > On Wed, 10-Jul-2013 at 20:49:15 +0200, Kenneth D. Merry wrote:
> > > > > On Wed, Jul 03, 2013 at 07:43:49 +0200, Andre Albsmeier wrote:
> > > > > > On Wed, 03-Jul-2013 at 07:22:36 +0200, Kenneth D. Merry wrote:
> > > > > > > On Tue, Jul 02, 2013 at 07:53:33 +0200, Andre Albsmeier wrote:
> > > > > > > > On Tue, 25-Jun-2013 at 23:43:50 +0200, Kenneth D. Merry wrote:
> > > > > > > > > Author: ken
> > > > > > > > > Date: Tue Jun 25 21:43:49 2013
> > > > > > > > > New Revision: 252214
> > > > > > > > > URL: http://svnweb.freebsd.org/changeset/base/252214
> > > > > > > > 
> > > > > > > > Hi Ken,
> > > > > > > > 
> > > > > > > > > Log:
> > > > > > > > >   MFC: 249658, 249701
> > > > > > > > > 
> > > > > > > > >   Update chio(1) and ch(4) to support reporting element designators.
> > > > > > > > > 
> > > > > > > > >   This allows mapping a tape drive in a changer (as reported by
> > > > > > > > >   'chio status') to a sa(4) driver instance by comparing the
> > > > > > > > >   serial numbers.
> > > > > > > > > 
> > > > > > > > >   The designators can be ASCII (which is printed out directly), binary
> > > > > > > > >   (which is printed in hex format) or UTF-8, which is printed in either
> > > > > > > > >   native UTF-8 format if the terminal can support it, or in %XX notation
> > > > > > > > >   for non-ASCII characters.  Thanks to Hiroki Sato  for the
> > > > > > > > >   explanation and example UTF-8 printing code.
> > > > > > > > > 
> > > > > > > > >   chio.h:               Modify the changer_element_status structure to add new
> > > > > > > > >                 fields and definitions from the SMC3r16 spec.
> > > > > > > > > 
> > > > > > > > >                 Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and
> > > > > > > > >                 define a new CHIOGSTATUS ioctl.
> > > > > > > > > 
> > > > > > > > >                 Clean up some tab/space issues.
> > > > > > > > > 
> > > > > > > > >   chio.c:       For the 'status' subcommand, print the designator field
> > > > > > > > >                 if it is supplied by a device.
> > > > > > > > > 
> > > > > > > > >   scsi_ch.h:    Add new flags for DVCID and CURDATA to the READ
> > > > > > > > >                 ELEMENT STATUS command structure.
> > > > > > > > > 
> > > > > > > > >                 Add a read_element_status_device_id structure
> > > > > > > > >                 for the data fields in the new standard. Add new
> > > > > > > > >                 unions, dt_or_obsolete and voltage_devid, to hold
> > > > > > > > >                 and address data from either SCSI-2 or newer devices.
> > > > > > > > > 
> > > > > > > > >   scsi_ch.c:    Implement support for fetching device IDs with READ
> > > > > > > > >                 ELEMENT STATUS data.
> > > > > > > > > 
> > > > > > > > >                 Add new arguments to scsi_read_element_status() to
> > > > > > > > >                 allow the user to request the DVCID and CURDATA bits.
> > > > > > > > 
> > > > > > > > This broke "chio status" when talking to my QUALSTAR TLS-8211 library:
> > > > > > > > 
> > > > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): READ ELEMENT STATUS. CDB: b8 10 fd e8 00 01 03 00 04 00 00 00
> > > > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): CAM status: SCSI Status Error
> > > > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): SCSI status: Check Condition
> > > > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB)
> > > > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): Command byte 6 is invalid
> > > > > > > > Jul  2 07:08:22  server kernel: (ch0:ahd3:0:1:0): Error 22, Unretryable error
> > > > > > > > 
> > > > > > > > scsi_cmd->flags (Byte 6) must be zero for this library so I had to use
> > > > > > > > this workaround to make it work again until a better solution is available:
> > > > > > > > 
> > > > > > > > --- sys/cam/scsi/scsi_ch.c.ORI	2013-06-26 13:38:54.000000000 +0200
> > > > > > > > +++ sys/cam/scsi/scsi_ch.c	2013-07-02 07:42:24.000000000 +0200
> > > > > > > > @@ -1245,8 +1245,8 @@
> > > > > > > >  				 /* tag_action */ MSG_SIMPLE_Q_TAG,
> > > > > > > >  				 /* voltag */ want_voltags,
> > > > > > > >  				 /* sea */ softc->sc_firsts[chet],
> > > > > > > > -				 /* dvcid */ 1,
> > > > > > > > -				 /* curdata */ 1,
> > > > > > > > +				 /* dvcid */ 0,
> > > > > > > > +				 /* curdata */ 0,
> > > > > > > >  				 /* count */ 1,
> > > > > > > >  				 /* data_ptr */ data,
> > > > > > > >  				 /* dxfer_len */ 1024,
> > > > > > > > @@ -1284,8 +1284,8 @@
> > > > > > > >  				 /* voltag */ want_voltags,
> > > > > > > >  				 /* sea */ softc->sc_firsts[chet]
> > > > > > > >  				 + cesr->cesr_element_base,
> > > > > > > > -				 /* dvcid */ 1,
> > > > > > > > -				 /* curdata */ 1,
> > > > > > > > +				 /* dvcid */ 0,
> > > > > > > > +				 /* curdata */ 0,
> > > > > > > >  				 /* count */ cesr->cesr_element_count,
> > > > > > > >  				 /* data_ptr */ data,
> > > > > > > >  				 /* dxfer_len */ size,
> > > > > > > > 
> > > > > > > > 	-Andre
> > > > > > > 
> > > > > > > Oops, sorry.
> > > > > > > 
> > > > > > > We need to check the SCSI version to see whether to set those bits, and
> > > > > > > also fall back in case it doesn't work.
> > > > > > > 
> > > > > > > I am on vacation and have very spotty net access.  I can't do anything
> > > > > > > about it until I get back next week.
> > > > > > > 
> > > > > > > Justin and Alan (CCed) can work on the fix, though.
> > > > > > 
> > > > > > Take your time, for me it's working right now
> > > > > > with the above patch...
> > > > > 
> > > > > Okay, I'm back and can take a look at this.
> > > > 
> > > > Welcome back ;-)
> > > > 
> > > > > 
> > > > > Can you send me:
> > > > 
> > > > Sure, I am happy to help.
> > > > 
> > > > > 
> > > > > camcontrol inquiry ch0 -v
> > > > 
> > > > pass17:  Removable Changer SCSI-2 device 
> > > > pass17: Serial Number 0021009613
> > > > pass17: 3.300MB/s transfers
> > > > 
> > > > > camcontrol cmd ch0 -v -c "12 0 0 0 ff 0" -i 255 "s58 i2 i2 i2 i2 i2 i2 i2 i2"
> > > > 
> > > > 0 0 0 0 0 0 0 0 
> > > 
> > > Okay, that was helpful, thanks!
> > > 
> > > > > 
> > > > > I want to see what SCSI version this changer reports.  The second command
> > > > > will print out the SCSI version descriptors, if any, that the changer
> > > > > reports.
> > > > 
> > > > In case you need more info just drop me a note.
> > > > 
> > > > Thanks for looking into this.
> > > 
> > > Can you try the attached patch, and see how it works for you?
> > > 
> > > It defaults to not setting those bits for changers that claim to be SCSI-2
> > > or below.  And if a SCSI-3 or higher changer returns an Illegal Request
> > > type error, it will retry with the bits cleared to see whether that works.
> > > 
> > > I also bumped the read element status timeout after some testing with a
> > > Spectra T-380.
> > > 
> > > The patch is against head, but stable/9 shouldn't be much different.
> > 
> > Oops, here is the patch.
> 
> Tried "chio status" and "chio move", both work!
> dmesg now added a quirk entry for ch0:
> 
>  ch0:  Removable Changer SCSI-2 device 
>  ch0: 3.300MB/s transfers
>  ch0: 11 slots, 1 drive, 1 picker, 1 portal
> +ch0: quirks=0x2
>  sa0 at ahd3 bus 0 scbus4 target 0 lun 0
>  sa0:  Removable Sequential Access SCSI-3 device 
>  sa0: 160.000MB/s transfers (80.000MHz DT, offset 126, 16bit)

Great, thanks for testing it!

I just committed the fix.

I'll put in the MFC request as soon as the 3 day waiting period is done.

Ken
-- 
Kenneth Merry
ken@FreeBSD.ORG

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 17:11:31 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 45E89981;
 Fri, 12 Jul 2013 17:11:31 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 3796210FE;
 Fri, 12 Jul 2013 17:11:31 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CHBVuf080142;
 Fri, 12 Jul 2013 17:11:31 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CHBUfX080136;
 Fri, 12 Jul 2013 17:11:30 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307121711.r6CHBUfX080136@svn.freebsd.org>
From: Hiroki Sato 
Date: Fri, 12 Jul 2013 17:11:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253275 - head/usr.bin/netstat
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 17:11:31 -0000

Author: hrs
Date: Fri Jul 12 17:11:30 2013
New Revision: 253275
URL: http://svnweb.freebsd.org/changeset/base/253275

Log:
  Add -F fibnum option to specify an FIB number for -r flag.

Modified:
  head/usr.bin/netstat/main.c
  head/usr.bin/netstat/netstat.1
  head/usr.bin/netstat/netstat.h
  head/usr.bin/netstat/route.c

Modified: head/usr.bin/netstat/main.c
==============================================================================
--- head/usr.bin/netstat/main.c	Fri Jul 12 17:09:50 2013	(r253274)
+++ head/usr.bin/netstat/main.c	Fri Jul 12 17:11:30 2013	(r253275)
@@ -363,10 +363,12 @@ main(int argc, char *argv[])
 {
 	struct protox *tp = NULL;  /* for printing cblocks & stats */
 	int ch;
+	int fib = -1;
+	char *endptr;
 
 	af = AF_UNSPEC;
 
-	while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:Qq:rSTsuWw:xz"))
+	while ((ch = getopt(argc, argv, "AaBbdF:f:ghI:iLlM:mN:np:Qq:rSTsuWw:xz"))
 	    != -1)
 		switch(ch) {
 		case 'A':
@@ -384,6 +386,12 @@ main(int argc, char *argv[])
 		case 'd':
 			dflag = 1;
 			break;
+		case 'F':
+			fib = strtol(optarg, &endptr, 0);
+			if (*endptr != '\0' ||
+			    (fib == 0 && (errno == EINVAL || errno == ERANGE)))
+				errx(1, "%s: invalid fib", optarg);
+			break;
 		case 'f':
 			if (strcmp(optarg, "ipx") == 0)
 				af = AF_IPX;
@@ -571,7 +579,7 @@ main(int argc, char *argv[])
 		if (sflag)
 			rt_stats(nl[N_RTSTAT].n_value, nl[N_RTTRASH].n_value);
 		else
-			routepr(nl[N_RTREE].n_value);
+			routepr(nl[N_RTREE].n_value, fib);
 		exit(0);
 	}
 	if (gflag) {

Modified: head/usr.bin/netstat/netstat.1
==============================================================================
--- head/usr.bin/netstat/netstat.1	Fri Jul 12 17:09:50 2013	(r253274)
+++ head/usr.bin/netstat/netstat.1	Fri Jul 12 17:11:30 2013	(r253275)
@@ -28,7 +28,7 @@
 .\"	@(#)netstat.1	8.8 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd March 10, 2013
+.Dd May 17, 2013
 .Dt NETSTAT 1
 .Os
 .Sh NAME
@@ -217,14 +217,29 @@ states.
 .Nm
 .Fl r
 .Op Fl AanW
+.Op Fl F Ar fibnum
 .Op Fl f Ar address_family
 .Op Fl M Ar core
 .Op Fl N Ar system
 .Ek
 .Xc
-Display the contents of all routing tables,
-or a routing table for a particular
-.Ar address_family .
+Display the contents of routing tables.
+When
+.Fl f
+is specified, a routing table for a particular
+.Ar address_family
+is displayed.
+When
+.Fl F
+is specified, a routing table with the number
+.Ar fibnum
+is displayed.
+If the specified
+.Ar fibnum
+is -1 or
+.Fl F
+is not specified,
+the default routing table is displayed.
 If
 .Fl A
 is also present,

Modified: head/usr.bin/netstat/netstat.h
==============================================================================
--- head/usr.bin/netstat/netstat.h	Fri Jul 12 17:09:50 2013	(r253274)
+++ head/usr.bin/netstat/netstat.h	Fri Jul 12 17:11:30 2013	(r253275)
@@ -135,7 +135,7 @@ char	*atalk_print(struct sockaddr *, int
 char	*atalk_print2(struct sockaddr *, struct sockaddr *, int);
 char	*ipx_print(struct sockaddr *);
 char	*ns_print(struct sockaddr *);
-void	routepr(u_long);
+void	routepr(u_long, int);
 
 void	ipxprotopr(u_long, const char *, int, int);
 void	spx_stats(u_long, const char *, int, int);

Modified: head/usr.bin/netstat/route.c
==============================================================================
--- head/usr.bin/netstat/route.c	Fri Jul 12 17:09:50 2013	(r253274)
+++ head/usr.bin/netstat/route.c	Fri Jul 12 17:11:30 2013	(r253275)
@@ -143,17 +143,20 @@ static void domask(char *, in_addr_t, u_
  * Print routing tables.
  */
 void
-routepr(u_long rtree)
+routepr(u_long rtree, int fibnum)
 {
 	struct radix_node_head **rnhp, *rnh, head;
 	size_t intsize;
-	int fam, fibnum, numfibs;
+	int fam, numfibs;
 
 	intsize = sizeof(int);
-	if (sysctlbyname("net.my_fibnum", &fibnum, &intsize, NULL, 0) == -1)
+	if (fibnum == -1 &&
+	    sysctlbyname("net.my_fibnum", &fibnum, &intsize, NULL, 0) == -1)
 		fibnum = 0;
 	if (sysctlbyname("net.fibs", &numfibs, &intsize, NULL, 0) == -1)
 		numfibs = 1;
+	if (fibnum < 0 || fibnum > numfibs - 1)
+		errx(EX_USAGE, "%d: invalid fib", fibnum);
 	rt_tables = calloc(numfibs * (AF_MAX+1),
 	    sizeof(struct radix_node_head *));
 	if (rt_tables == NULL)
@@ -166,7 +169,10 @@ routepr(u_long rtree)
 	if (clock_gettime(CLOCK_UPTIME, &uptime) < 0)
 		err(EX_OSERR, "clock_gettime() failed");
 
-	printf("Routing tables\n");
+	printf("Routing tables");
+	if (fibnum)
+		printf(" (fib: %d)", fibnum);
+	printf("\n");
 
 	if (Aflag == 0 && NewTree)
 		ntreestuff();

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 17:23:00 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 5B9AFE4D;
 Fri, 12 Jul 2013 17:23:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 4D6CF119D;
 Fri, 12 Jul 2013 17:23:00 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CHN0V8083295;
 Fri, 12 Jul 2013 17:23:00 GMT (envelope-from pfg@svn.freebsd.org)
Received: (from pfg@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CHMxAs083287;
 Fri, 12 Jul 2013 17:22:59 GMT (envelope-from pfg@svn.freebsd.org)
Message-Id: <201307121722.r6CHMxAs083287@svn.freebsd.org>
From: "Pedro F. Giffuni" 
Date: Fri, 12 Jul 2013 17:22:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253276 - head/sys/fs/fuse
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 17:23:00 -0000

Author: pfg
Date: Fri Jul 12 17:22:59 2013
New Revision: 253276
URL: http://svnweb.freebsd.org/changeset/base/253276

Log:
  Add creation timestamp (birthtime) support for fuse.
  
  This is based on similar support in MacFUSE.

Modified:
  head/sys/fs/fuse/fuse_internal.h
  head/sys/fs/fuse/fuse_kernel.h

Modified: head/sys/fs/fuse/fuse_internal.h
==============================================================================
--- head/sys/fs/fuse/fuse_internal.h	Fri Jul 12 17:11:30 2013	(r253275)
+++ head/sys/fs/fuse/fuse_internal.h	Fri Jul 12 17:22:59 2013	(r253276)
@@ -223,6 +223,8 @@ fuse_internal_attr_fat2vat(struct mount 
     vap->va_mtime.tv_nsec = fat->mtimensec;
     vap->va_ctime.tv_sec  = fat->ctime;
     vap->va_ctime.tv_nsec = fat->ctimensec;
+    vap->va_birthtime.tv_sec  = fat->crtime;
+    vap->va_birthtime.tv_nsec = fat->crtimensec;
     vap->va_blocksize = PAGE_SIZE;
     vap->va_type = IFTOVT(fat->mode);
 

Modified: head/sys/fs/fuse/fuse_kernel.h
==============================================================================
--- head/sys/fs/fuse/fuse_kernel.h	Fri Jul 12 17:11:30 2013	(r253275)
+++ head/sys/fs/fuse/fuse_kernel.h	Fri Jul 12 17:22:59 2013	(r253276)
@@ -69,9 +69,15 @@ struct fuse_attr {
 	__u64	atime;
 	__u64	mtime;
 	__u64	ctime;
+#ifdef __FreeBSD__
+	__u64	crtime;
+#endif
 	__u32	atimensec;
 	__u32	mtimensec;
 	__u32	ctimensec;
+#ifdef __FreeBSD__
+	__u32	crtimensec;
+#endif
 	__u32	mode;
 	__u32	nlink;
 	__u32	uid;

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 17:37:06 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 5A3E43EE;
 Fri, 12 Jul 2013 17:37:06 +0000 (UTC)
 (envelope-from schweikh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 4C823122A;
 Fri, 12 Jul 2013 17:37:06 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CHb69K086893;
 Fri, 12 Jul 2013 17:37:06 GMT
 (envelope-from schweikh@svn.freebsd.org)
Received: (from schweikh@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CHb6Bx086892;
 Fri, 12 Jul 2013 17:37:06 GMT
 (envelope-from schweikh@svn.freebsd.org)
Message-Id: <201307121737.r6CHb6Bx086892@svn.freebsd.org>
From: Jens Schweikhardt 
Date: Fri, 12 Jul 2013 17:37:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253277 - head/lib/libc/stdio
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 17:37:06 -0000

Author: schweikh
Date: Fri Jul 12 17:37:05 2013
New Revision: 253277
URL: http://svnweb.freebsd.org/changeset/base/253277

Log:
  Typo corrected.

Modified:
  head/lib/libc/stdio/fwrite.c

Modified: head/lib/libc/stdio/fwrite.c
==============================================================================
--- head/lib/libc/stdio/fwrite.c	Fri Jul 12 17:22:59 2013	(r253276)
+++ head/lib/libc/stdio/fwrite.c	Fri Jul 12 17:37:05 2013	(r253277)
@@ -65,7 +65,7 @@ fwrite(const void * __restrict buf, size
 	/*
 	 * Check for integer overflow.  As an optimization, first check that
 	 * at least one of {count, size} is at least 2^16, since if both
-	 * values are less than that, their product can't possible overflow
+	 * values are less than that, their product can't possibly overflow
 	 * (size_t is always at least 32 bits on FreeBSD).
 	 */
 	if (((count | size) > 0xFFFF) &&

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 18:02:11 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 1DDAAE4E;
 Fri, 12 Jul 2013 18:02:11 +0000 (UTC)
 (envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 0F084137B;
 Fri, 12 Jul 2013 18:02:11 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CI2A7l094956;
 Fri, 12 Jul 2013 18:02:10 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CI2Agj094955;
 Fri, 12 Jul 2013 18:02:10 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201307121802.r6CI2Agj094955@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 12 Jul 2013 18:02:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253278 - stable/9/sys/dev/pci
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 18:02:11 -0000

Author: marius
Date: Fri Jul 12 18:02:10 2013
New Revision: 253278
URL: http://svnweb.freebsd.org/changeset/base/253278

Log:
  MFC: r240981, r240990, r240992, r244695
  
  Add 32-bit ABI compat shims. Those are necessary for i386 binary-only
  tools like sysutils/hpacucli (HP P4xx RAID controller management
  suite) working on amd64 systems.
  
  PR:		139271
  Submitted by:	Kazumi MORINAGA, Eugene Grosbein
  Approved by:	re (kib)

Modified:
  stable/9/sys/dev/pci/pci_user.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/pci/pci_user.c
==============================================================================
--- stable/9/sys/dev/pci/pci_user.c	Fri Jul 12 17:37:05 2013	(r253277)
+++ stable/9/sys/dev/pci/pci_user.c	Fri Jul 12 18:02:10 2013	(r253278)
@@ -225,6 +225,51 @@ struct pci_io_old {
 	u_int32_t	pi_data;	/* data to write or result of read */
 };
 
+#ifdef COMPAT_FREEBSD32
+struct pci_conf_old32 {
+	struct pcisel_old pc_sel;	/* bus+slot+function */
+	uint8_t		pc_hdr;		/* PCI header type */
+	uint16_t	pc_subvendor;	/* card vendor ID */
+	uint16_t	pc_subdevice;	/* card device ID, assigned by
+					   card vendor */
+	uint16_t	pc_vendor;	/* chip vendor ID */
+	uint16_t	pc_device;	/* chip device ID, assigned by
+					   chip vendor */
+	uint8_t		pc_class;	/* chip PCI class */
+	uint8_t		pc_subclass;	/* chip PCI subclass */
+	uint8_t		pc_progif;	/* chip PCI programming interface */
+	uint8_t		pc_revid;	/* chip revision ID */
+	char		pd_name[PCI_MAXNAMELEN + 1]; /* device name */
+	uint32_t	pd_unit;	/* device unit number (u_long) */
+};
+
+struct pci_match_conf_old32 {
+	struct pcisel_old pc_sel;	/* bus+slot+function */
+	char		pd_name[PCI_MAXNAMELEN + 1]; /* device name */
+	uint32_t	pd_unit;	/* Unit number (u_long) */
+	uint16_t	pc_vendor;	/* PCI Vendor ID */
+	uint16_t	pc_device;	/* PCI Device ID */
+	uint8_t		pc_class;	/* PCI class */
+	pci_getconf_flags_old flags;	/* Matching expression */
+};
+
+struct pci_conf_io32 {
+	uint32_t	pat_buf_len;	/* pattern buffer length */
+	uint32_t	num_patterns;	/* number of patterns */
+	uint32_t	patterns;	/* pattern buffer
+					   (struct pci_match_conf_old32 *) */
+	uint32_t	match_buf_len;	/* match buffer length */
+	uint32_t	num_matches;	/* number of matches returned */
+	uint32_t	matches;	/* match buffer
+					   (struct pci_conf_old32 *) */
+	uint32_t	offset;		/* offset into device list */
+	uint32_t	generation;	/* device list generation */
+	pci_getconf_status status;	/* request status */
+};
+
+#define	PCIOCGETCONF_OLD32	_IOWR('p', 1, struct pci_conf_io32)
+#endif	/* COMPAT_FREEBSD32 */
+
 #define	PCIOCGETCONF_OLD	_IOWR('p', 1, struct pci_conf_io)
 #define	PCIOCREAD_OLD		_IOWR('p', 2, struct pci_io_old)
 #define	PCIOCWRITE_OLD		_IOWR('p', 3, struct pci_io_old)
@@ -295,7 +340,71 @@ pci_conf_match_old(struct pci_match_conf
 	return(1);
 }
 
-#endif
+#ifdef COMPAT_FREEBSD32
+static int
+pci_conf_match_old32(struct pci_match_conf_old32 *matches, int num_matches,
+    struct pci_conf *match_buf)
+{
+	int i;
+
+	if ((matches == NULL) || (match_buf == NULL) || (num_matches <= 0))
+		return(1);
+
+	for (i = 0; i < num_matches; i++) {
+		if (match_buf->pc_sel.pc_domain != 0)
+			continue;
+
+		/*
+		 * I'm not sure why someone would do this...but...
+		 */
+		if (matches[i].flags == PCI_GETCONF_NO_MATCH_OLD)
+			continue;
+
+		/*
+		 * Look at each of the match flags.  If it's set, do the
+		 * comparison.  If the comparison fails, we don't have a
+		 * match, go on to the next item if there is one.
+		 */
+		if (((matches[i].flags & PCI_GETCONF_MATCH_BUS_OLD) != 0) &&
+		    (match_buf->pc_sel.pc_bus != matches[i].pc_sel.pc_bus))
+			continue;
+
+		if (((matches[i].flags & PCI_GETCONF_MATCH_DEV_OLD) != 0) &&
+		    (match_buf->pc_sel.pc_dev != matches[i].pc_sel.pc_dev))
+			continue;
+
+		if (((matches[i].flags & PCI_GETCONF_MATCH_FUNC_OLD) != 0) &&
+		    (match_buf->pc_sel.pc_func != matches[i].pc_sel.pc_func))
+			continue;
+
+		if (((matches[i].flags & PCI_GETCONF_MATCH_VENDOR_OLD) != 0) &&
+		    (match_buf->pc_vendor != matches[i].pc_vendor))
+			continue;
+
+		if (((matches[i].flags & PCI_GETCONF_MATCH_DEVICE_OLD) != 0) &&
+		    (match_buf->pc_device != matches[i].pc_device))
+			continue;
+
+		if (((matches[i].flags & PCI_GETCONF_MATCH_CLASS_OLD) != 0) &&
+		    (match_buf->pc_class != matches[i].pc_class))
+			continue;
+
+		if (((matches[i].flags & PCI_GETCONF_MATCH_UNIT_OLD) != 0) &&
+		    ((u_int32_t)match_buf->pd_unit != matches[i].pd_unit))
+			continue;
+
+		if (((matches[i].flags & PCI_GETCONF_MATCH_NAME_OLD) != 0) &&
+		    (strncmp(matches[i].pd_name, match_buf->pd_name,
+		    sizeof(match_buf->pd_name)) != 0))
+			continue;
+
+		return (0);
+	}
+
+	return (1);
+}
+#endif	/* COMPAT_FREEBSD32 */
+#endif	/* PRE7_COMPAT */
 
 static int
 pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
@@ -304,7 +413,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 	void *confdata;
 	const char *name;
 	struct devlist *devlist_head;
-	struct pci_conf_io *cio;
+	struct pci_conf_io *cio = NULL;
 	struct pci_devinfo *dinfo;
 	struct pci_io *io;
 	struct pci_bar_io *bio;
@@ -313,13 +422,17 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 	size_t confsz, iolen, pbufsz;
 	int error, ionum, i, num_patterns;
 #ifdef PRE7_COMPAT
+#ifdef COMPAT_FREEBSD32
+	struct pci_conf_io32 *cio32 = NULL;
+	struct pci_conf_old32 conf_old32;
+	struct pci_match_conf_old32 *pattern_buf_old32 = NULL;
+#endif
 	struct pci_conf_old conf_old;
 	struct pci_io iodata;
 	struct pci_io_old *io_old;
-	struct pci_match_conf_old *pattern_buf_old;
+	struct pci_match_conf_old *pattern_buf_old = NULL;
 
 	io_old = NULL;
-	pattern_buf_old = NULL;
 
 	if (!(flag & FWRITE) && cmd != PCIOCGETBAR &&
 	    cmd != PCIOCGETCONF && cmd != PCIOCGETCONF_OLD)
@@ -331,11 +444,36 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 
 	switch(cmd) {
 #ifdef PRE7_COMPAT
+#ifdef COMPAT_FREEBSD32
+       case PCIOCGETCONF_OLD32:
+               cio32 = (struct pci_conf_io32 *)data;
+               cio = malloc(sizeof(struct pci_conf_io), M_TEMP, M_WAITOK);
+               cio->pat_buf_len = cio32->pat_buf_len;
+               cio->num_patterns = cio32->num_patterns;
+               cio->patterns = (void *)(uintptr_t)cio32->patterns;
+               cio->match_buf_len = cio32->match_buf_len;
+               cio->num_matches = cio32->num_matches;
+               cio->matches = (void *)(uintptr_t)cio32->matches;
+               cio->offset = cio32->offset;
+               cio->generation = cio32->generation;
+               cio->status = cio32->status;
+               cio32->num_matches = 0;
+               break;
+#endif
 	case PCIOCGETCONF_OLD:
-		/* FALLTHROUGH */
 #endif
 	case PCIOCGETCONF:
 		cio = (struct pci_conf_io *)data;
+	}
+
+	switch(cmd) {
+#ifdef PRE7_COMPAT
+#ifdef COMPAT_FREEBSD32
+	case PCIOCGETCONF_OLD32:
+#endif
+	case PCIOCGETCONF_OLD:
+#endif
+	case PCIOCGETCONF:
 
 		pattern_buf = NULL;
 		num_patterns = 0;
@@ -353,7 +491,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 		 && (cio->generation != pci_generation)){
 			cio->status = PCI_GETCONF_LIST_CHANGED;
 			error = 0;
-			break;
+			goto getconfexit;
 		}
 
 		/*
@@ -363,7 +501,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 		if (cio->offset >= pci_numdevs) {
 			cio->status = PCI_GETCONF_LAST_DEVICE;
 			error = 0;
-			break;
+			goto getconfexit;
 		}
 
 		/* get the head of the device queue */
@@ -376,6 +514,11 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 		 * didn't specify a multiple of that size.
 		 */
 #ifdef PRE7_COMPAT
+#ifdef COMPAT_FREEBSD32
+		if (cmd == PCIOCGETCONF_OLD32)
+			confsz = sizeof(struct pci_conf_old32);
+		else
+#endif
 		if (cmd == PCIOCGETCONF_OLD)
 			confsz = sizeof(struct pci_conf_old);
 		else
@@ -410,6 +553,11 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 			 * updated their kernel but not their userland.
 			 */
 #ifdef PRE7_COMPAT
+#ifdef COMPAT_FREEBSD32
+			if (cmd == PCIOCGETCONF_OLD32)
+				pbufsz = sizeof(struct pci_match_conf_old32);
+			else
+#endif
 			if (cmd == PCIOCGETCONF_OLD)
 				pbufsz = sizeof(struct pci_match_conf_old);
 			else
@@ -419,20 +567,28 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 				/* The user made a mistake, return an error. */
 				cio->status = PCI_GETCONF_ERROR;
 				error = EINVAL;
-				break;
+				goto getconfexit;
 			}
 
 			/*
 			 * Allocate a buffer to hold the patterns.
 			 */
 #ifdef PRE7_COMPAT
+#ifdef COMPAT_FREEBSD32
+			if (cmd == PCIOCGETCONF_OLD32) {
+				pattern_buf_old32 = malloc(cio->pat_buf_len,
+				    M_TEMP, M_WAITOK);
+				error = copyin(cio->patterns,
+				    pattern_buf_old32, cio->pat_buf_len);
+			} else
+#endif /* COMPAT_FREEBSD32 */
 			if (cmd == PCIOCGETCONF_OLD) {
 				pattern_buf_old = malloc(cio->pat_buf_len,
 				    M_TEMP, M_WAITOK);
 				error = copyin(cio->patterns,
 				    pattern_buf_old, cio->pat_buf_len);
 			} else
-#endif
+#endif /* PRE7_COMPAT */
 			{
 				pattern_buf = malloc(cio->pat_buf_len, M_TEMP,
 				    M_WAITOK);
@@ -451,7 +607,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 			 */
 			cio->status = PCI_GETCONF_ERROR;
 			error = EINVAL;
-			break;
+                       goto getconfexit;
 		}
 
 		/*
@@ -483,7 +639,14 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 			}
 
 #ifdef PRE7_COMPAT
-			if ((cmd == PCIOCGETCONF_OLD &&
+			if (
+#ifdef COMPAT_FREEBSD32
+			    (cmd == PCIOCGETCONF_OLD32 &&
+			    (pattern_buf_old32 == NULL ||
+			    pci_conf_match_old32(pattern_buf_old32,
+			    num_patterns, &dinfo->conf) == 0)) ||
+#endif
+			    (cmd == PCIOCGETCONF_OLD &&
 			    (pattern_buf_old == NULL ||
 			    pci_conf_match_old(pattern_buf_old, num_patterns,
 			    &dinfo->conf) == 0)) ||
@@ -508,6 +671,40 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 					break;
 
 #ifdef PRE7_COMPAT
+#ifdef COMPAT_FREEBSD32
+				if (cmd == PCIOCGETCONF_OLD32) {
+					conf_old32.pc_sel.pc_bus =
+					    dinfo->conf.pc_sel.pc_bus;
+					conf_old32.pc_sel.pc_dev =
+					    dinfo->conf.pc_sel.pc_dev;
+					conf_old32.pc_sel.pc_func =
+					    dinfo->conf.pc_sel.pc_func;
+					conf_old32.pc_hdr = dinfo->conf.pc_hdr;
+					conf_old32.pc_subvendor =
+					    dinfo->conf.pc_subvendor;
+					conf_old32.pc_subdevice =
+					    dinfo->conf.pc_subdevice;
+					conf_old32.pc_vendor =
+					    dinfo->conf.pc_vendor;
+					conf_old32.pc_device =
+					    dinfo->conf.pc_device;
+					conf_old32.pc_class =
+					    dinfo->conf.pc_class;
+					conf_old32.pc_subclass =
+					    dinfo->conf.pc_subclass;
+					conf_old32.pc_progif =
+					    dinfo->conf.pc_progif;
+					conf_old32.pc_revid =
+					    dinfo->conf.pc_revid;
+					strncpy(conf_old32.pd_name,
+					    dinfo->conf.pd_name,
+					    sizeof(conf_old32.pd_name));
+					conf_old32.pd_name[PCI_MAXNAMELEN] = 0;
+					conf_old32.pd_unit =
+					    (uint32_t)dinfo->conf.pd_unit;
+					confdata = &conf_old32;
+				} else
+#endif /* COMPAT_FREEBSD32 */
 				if (cmd == PCIOCGETCONF_OLD) {
 					conf_old.pc_sel.pc_bus =
 					    dinfo->conf.pc_sel.pc_bus;
@@ -540,7 +737,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 					    dinfo->conf.pd_unit;
 					confdata = &conf_old;
 				} else
-#endif
+#endif /* PRE7_COMPAT */
 					confdata = &dinfo->conf;
 				/* Only if we can copy it out do we count it. */
 				if (!(error = copyout(confdata,
@@ -574,12 +771,23 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 			cio->status = PCI_GETCONF_MORE_DEVS;
 
 getconfexit:
-		if (pattern_buf != NULL)
-			free(pattern_buf, M_TEMP);
 #ifdef PRE7_COMPAT
+#ifdef COMPAT_FREEBSD32
+		if (cmd == PCIOCGETCONF_OLD32) {
+			cio32->status = cio->status;
+			cio32->generation = cio->generation;
+			cio32->offset = cio->offset;
+			cio32->num_matches = cio->num_matches;
+			free(cio, M_TEMP);
+		}
+		if (pattern_buf_old32 != NULL)
+			free(pattern_buf_old32, M_TEMP);
+#endif
 		if (pattern_buf_old != NULL)
 			free(pattern_buf_old, M_TEMP);
 #endif
+		if (pattern_buf != NULL)
+			free(pattern_buf, M_TEMP);
 
 		break;
 

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 18:13:41 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id AC2998ED;
 Fri, 12 Jul 2013 18:13:41 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 9EEC61646;
 Fri, 12 Jul 2013 18:13:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CIDfHk098401;
 Fri, 12 Jul 2013 18:13:41 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CIDfbd098400;
 Fri, 12 Jul 2013 18:13:41 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307121813.r6CIDfbd098400@svn.freebsd.org>
From: Jim Harris 
Date: Fri, 12 Jul 2013 18:13:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253279 - head/sbin/nvmecontrol
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 18:13:41 -0000

Author: jimharris
Date: Fri Jul 12 18:13:41 2013
New Revision: 253279
URL: http://svnweb.freebsd.org/changeset/base/253279

Log:
  %d should be used for printing int32_t instead of %zd.
  
  clang does not complain about this - only gcc.
  
  MFC after:	3 days

Modified:
  head/sbin/nvmecontrol/firmware.c

Modified: head/sbin/nvmecontrol/firmware.c
==============================================================================
--- head/sbin/nvmecontrol/firmware.c	Fri Jul 12 18:02:10 2013	(r253278)
+++ head/sbin/nvmecontrol/firmware.c	Fri Jul 12 18:13:41 2013	(r253279)
@@ -94,7 +94,7 @@ read_image_file(char *path, void **buf, 
 		    path, (intmax_t)sb.st_size);
 	filesize = (int32_t)sb.st_size;
 	if ((*buf = malloc(filesize)) == NULL)
-		errx(1, "unable to malloc %zd bytes", filesize);
+		errx(1, "unable to malloc %d bytes", filesize);
 	if ((*size = read(fd, *buf, filesize)) < 0)
 		err(1, "error reading '%s'", path);
 	/* XXX assuming no short reads */

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 18:24:12 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 9B5DAF5D;
 Fri, 12 Jul 2013 18:24:12 +0000 (UTC)
 (envelope-from adrian.chadd@gmail.com)
Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com
 [IPv6:2a00:1450:400c:c00::22f])
 by mx1.freebsd.org (Postfix) with ESMTP id B605C1732;
 Fri, 12 Jul 2013 18:24:11 +0000 (UTC)
Received: by mail-wg0-f47.google.com with SMTP id l18so8520100wgh.14
 for ; Fri, 12 Jul 2013 11:24:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date
 :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
 bh=LpouerqnmCVB0yQRMDIzjqh1a4K0K00A51oQxHoZO4A=;
 b=EeVcLhoysFTIiPOMO20+MUyClDbhistpqDjf5LxtS42URDRFifFwRUpOYXp2sGubmh
 L8BI67W3GvVjHbuCbcbCyHDMMdXNJ6VZiDA+lSkldB24rVhQT4O+toK4ODsNKc/R0bMi
 x8gZprAgBAGWvy7W8AXX/bWAuWbZEI4q1dADnodz+Lw1cacj8S2as+PsN8p7cAujtf3o
 gRdJWirU0e9uLPbdUUlEoxMAc9CHyPkHXlUyHR/Ca4EfwbxmgrJ4ZsnJXmwOMhUyYes5
 yNJjoIlZy7AL51lamTv7dylhvXaxKdUGxLN1WxYuQ0yHJTLLgXb4WClfU3hX+wDEaDym
 Mffg==
MIME-Version: 1.0
X-Received: by 10.180.94.67 with SMTP id da3mr2403564wib.30.1373653450568;
 Fri, 12 Jul 2013 11:24:10 -0700 (PDT)
Sender: adrian.chadd@gmail.com
Received: by 10.217.94.132 with HTTP; Fri, 12 Jul 2013 11:24:10 -0700 (PDT)
In-Reply-To: <201307120803.r6C83ACp016523@svn.freebsd.org>
References: <201307120803.r6C83ACp016523@svn.freebsd.org>
Date: Fri, 12 Jul 2013 11:24:10 -0700
X-Google-Sender-Auth: O_QhX3dlDFVqRPGW7zApcXlfjFI
Message-ID: 
Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt
From: Adrian Chadd 
To: Craig Rodrigues 
Content-Type: text/plain; charset=ISO-8859-1
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 18:24:12 -0000

Hm, I just found a patch in my local collection which works for all
netgraph nodes.

Maybe we should do that instead of this?

http://people.freebsd.org/~adrian/ath/20130712-netgraph-vimage.diff

That should solve it for all dynamic netgraph stuff, rather than just bluetooth.



-adrian

On 12 July 2013 01:03, Craig Rodrigues  wrote:
> Author: rodrigc
> Date: Fri Jul 12 08:03:10 2013
> New Revision: 253255
> URL: http://svnweb.freebsd.org/changeset/base/253255
>
> Log:
>   PR: kern/168520
>   Submitted by: "YAMAMOTO, Shigeru" 
>   Reviewed by: adrian
>
>   In PC-BSD 9.1, VIMAGE is enabled in the kernel config.
>   For laptops with Bluetooth capability, such as the HP Elitebook 8460p,
>   the kernel will panic upon bootup, because curthread->td_vnet
>   is not initialized.
>
>   Properly initialize curthread->td_vnet when initializing the Bluetooth stack.
>
>   This allows laptops such as the HP Elitebook 8460p laptop
>   to properly boot with VIMAGE kernels.
>
> Modified:
>   head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
>
> Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
> ==============================================================================
> --- head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c    Fri Jul 12 07:43:56 2013        (r253254)
> +++ head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c    Fri Jul 12 08:03:10 2013        (r253255)
> @@ -109,7 +109,9 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
> +#include 
>
>  #include "usbdevs.h"
>  #include 
> @@ -123,6 +125,7 @@
>  #include 
>  #include 
>
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -487,13 +490,14 @@ ubt_attach(device_t dev)
>
>         sc->sc_dev = dev;
>         sc->sc_debug = NG_UBT_WARN_LEVEL;
> -
> +       CURVNET_SET(TD_TO_VNET(curthread));
>         /*
>          * Create Netgraph node
>          */
>
>         if (ng_make_node_common(&typestruct, &sc->sc_node) != 0) {
>                 UBT_ALERT(sc, "could not create Netgraph node\n");
> +               CURVNET_RESTORE();
>                 return (ENXIO);
>         }
>
> @@ -501,10 +505,12 @@ ubt_attach(device_t dev)
>         if (ng_name_node(sc->sc_node, device_get_nameunit(dev)) != 0) {
>                 UBT_ALERT(sc, "could not name Netgraph node\n");
>                 NG_NODE_UNREF(sc->sc_node);
> +               CURVNET_RESTORE();
>                 return (ENXIO);
>         }
>         NG_NODE_SET_PRIVATE(sc->sc_node, sc);
>         NG_NODE_FORCE_WRITER(sc->sc_node);
> +       CURVNET_RESTORE();
>
>         /*
>          * Initialize device softc structure
> @@ -631,8 +637,10 @@ ubt_detach(device_t dev)
>         /* Destroy Netgraph node */
>         if (node != NULL) {
>                 sc->sc_node = NULL;
> +               CURVNET_SET(node->nd_vnet);
>                 NG_NODE_REALLY_DIE(node);
>                 ng_rmnode_self(node);
> +               CURVNET_RESTORE();
>         }
>
>         /* Make sure ubt_task in gone */

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 18:25:17 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 653D214B;
 Fri, 12 Jul 2013 18:25:17 +0000 (UTC)
 (envelope-from adrian.chadd@gmail.com)
Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com
 [IPv6:2a00:1450:400c:c05::235])
 by mx1.freebsd.org (Postfix) with ESMTP id 7DC44174B;
 Fri, 12 Jul 2013 18:25:16 +0000 (UTC)
Received: by mail-wi0-f181.google.com with SMTP id hq4so993927wib.8
 for ; Fri, 12 Jul 2013 11:25:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date
 :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
 bh=se+VAbCuomFiF4vr4nOfgqOJvYsSnY/gFkXejOtyAmQ=;
 b=mSiYaKsGEzi9kGRx8ncBG06lMvh0kqcz8Vf6ILZPz6xwWmSAKgpJjJ/zDlfUm0DxRP
 /tlu9CacfTszjnTZ+P9Byyv7pgWmuOTzNO5ssZadVYGJlCT8tRXFAZXnIcs6cGscDK7Z
 iPNq+b9LWn01klN7LHHBJOUF69/JsbR6IVSlgLnBeaQHR9j+yorWMYEJq++LQK+Wy04V
 oTfhkE/yjBu+jplI0xyeEj2Ei2Cyu9zA5BI7YmaQmuP02zmaSHgI1szHUwooO7rCXGX/
 e/12lRyK22ZxNV2uBdYh+iBJZqT3oUkozQy4to2ZFnkTFzuTn2bcWzF5LZGNjeOoS4mG
 Bs+Q==
MIME-Version: 1.0
X-Received: by 10.180.160.165 with SMTP id xl5mr2347061wib.46.1373653515475;
 Fri, 12 Jul 2013 11:25:15 -0700 (PDT)
Sender: adrian.chadd@gmail.com
Received: by 10.217.94.132 with HTTP; Fri, 12 Jul 2013 11:25:15 -0700 (PDT)
In-Reply-To: 
References: <201307120803.r6C83ACp016523@svn.freebsd.org>
 
Date: Fri, 12 Jul 2013 11:25:15 -0700
X-Google-Sender-Auth: nrSr7tk6SwxkEx56byD8yi4FDqQ
Message-ID: 
Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt
From: Adrian Chadd 
To: Craig Rodrigues 
Content-Type: text/plain; charset=ISO-8859-1
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 18:25:17 -0000

.. oh, and this particular patch is for destroying netgraph nodes, not
just upon attach.



-adrian

On 12 July 2013 11:24, Adrian Chadd  wrote:
> Hm, I just found a patch in my local collection which works for all
> netgraph nodes.
>
> Maybe we should do that instead of this?
>
> http://people.freebsd.org/~adrian/ath/20130712-netgraph-vimage.diff
>
> That should solve it for all dynamic netgraph stuff, rather than just bluetooth.
>
>
>
> -adrian
>
> On 12 July 2013 01:03, Craig Rodrigues  wrote:
>> Author: rodrigc
>> Date: Fri Jul 12 08:03:10 2013
>> New Revision: 253255
>> URL: http://svnweb.freebsd.org/changeset/base/253255
>>
>> Log:
>>   PR: kern/168520
>>   Submitted by: "YAMAMOTO, Shigeru" 
>>   Reviewed by: adrian
>>
>>   In PC-BSD 9.1, VIMAGE is enabled in the kernel config.
>>   For laptops with Bluetooth capability, such as the HP Elitebook 8460p,
>>   the kernel will panic upon bootup, because curthread->td_vnet
>>   is not initialized.
>>
>>   Properly initialize curthread->td_vnet when initializing the Bluetooth stack.
>>
>>   This allows laptops such as the HP Elitebook 8460p laptop
>>   to properly boot with VIMAGE kernels.
>>
>> Modified:
>>   head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
>>
>> Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
>> ==============================================================================
>> --- head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c    Fri Jul 12 07:43:56 2013        (r253254)
>> +++ head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c    Fri Jul 12 08:03:10 2013        (r253255)
>> @@ -109,7 +109,9 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>>  #include 
>> +#include 
>>
>>  #include "usbdevs.h"
>>  #include 
>> @@ -123,6 +125,7 @@
>>  #include 
>>  #include 
>>
>> +#include 
>>  #include 
>>  #include 
>>  #include 
>> @@ -487,13 +490,14 @@ ubt_attach(device_t dev)
>>
>>         sc->sc_dev = dev;
>>         sc->sc_debug = NG_UBT_WARN_LEVEL;
>> -
>> +       CURVNET_SET(TD_TO_VNET(curthread));
>>         /*
>>          * Create Netgraph node
>>          */
>>
>>         if (ng_make_node_common(&typestruct, &sc->sc_node) != 0) {
>>                 UBT_ALERT(sc, "could not create Netgraph node\n");
>> +               CURVNET_RESTORE();
>>                 return (ENXIO);
>>         }
>>
>> @@ -501,10 +505,12 @@ ubt_attach(device_t dev)
>>         if (ng_name_node(sc->sc_node, device_get_nameunit(dev)) != 0) {
>>                 UBT_ALERT(sc, "could not name Netgraph node\n");
>>                 NG_NODE_UNREF(sc->sc_node);
>> +               CURVNET_RESTORE();
>>                 return (ENXIO);
>>         }
>>         NG_NODE_SET_PRIVATE(sc->sc_node, sc);
>>         NG_NODE_FORCE_WRITER(sc->sc_node);
>> +       CURVNET_RESTORE();
>>
>>         /*
>>          * Initialize device softc structure
>> @@ -631,8 +637,10 @@ ubt_detach(device_t dev)
>>         /* Destroy Netgraph node */
>>         if (node != NULL) {
>>                 sc->sc_node = NULL;
>> +               CURVNET_SET(node->nd_vnet);
>>                 NG_NODE_REALLY_DIE(node);
>>                 ng_rmnode_self(node);
>> +               CURVNET_RESTORE();
>>         }
>>
>>         /* Make sure ubt_task in gone */

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 18:39:37 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 856455B4;
 Fri, 12 Jul 2013 18:39:37 +0000 (UTC)
 (envelope-from crodr001@gmail.com)
Received: from mail-la0-x230.google.com (mail-la0-x230.google.com
 [IPv6:2a00:1450:4010:c03::230])
 by mx1.freebsd.org (Postfix) with ESMTP id 59957181B;
 Fri, 12 Jul 2013 18:39:36 +0000 (UTC)
Received: by mail-la0-f48.google.com with SMTP id lx15so8006414lab.35
 for ; Fri, 12 Jul 2013 11:39:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date
 :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
 bh=RSDoJCG4kNetOijkLE/tKQEfB2S0ZwaQahBWew0QeWg=;
 b=h0V1GG97OW8F/y5H0x0mS2HP4z+E7DfS0hJ8kZihlL/yUbh+fHKmlPsRgcSioGK5rF
 RkrqPPS/C7gsxdCqdeUC2Gy74w2dCybRL1gN+IKPq486lNos9E7JvIoaLgQ2nmPJ3Wm3
 yyiRzM/RduxNxn0EV3sbZiT8xMBkBzxTO+qRhW/53sparX1AAPwNq5bppP+ekY8eVdKZ
 Sk/b/ptuBnB2FrQZTt7LOiN5ebCtlQqDIP2Xt0p3Szz5r6o781zryYZZuWcCuUAkL4OH
 h8813kNabrGEC3KgRXvxvudHYjHKZ1p4DOYaBE0COOOtSRXVTVLMbQhBTN0Bbiqe4It9
 kKwQ==
MIME-Version: 1.0
X-Received: by 10.112.29.17 with SMTP id f17mr19989193lbh.20.1373654375017;
 Fri, 12 Jul 2013 11:39:35 -0700 (PDT)
Sender: crodr001@gmail.com
Received: by 10.112.149.38 with HTTP; Fri, 12 Jul 2013 11:39:34 -0700 (PDT)
In-Reply-To: 
References: <201307120803.r6C83ACp016523@svn.freebsd.org>
 
Date: Fri, 12 Jul 2013 11:39:34 -0700
X-Google-Sender-Auth: XPN-FqzKBTyLYIvReG9hSo6sHlU
Message-ID: 
Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt
From: Craig Rodrigues 
To: Adrian Chadd 
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.14
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers@freebsd.org
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 18:39:37 -0000

I like your patch.  It may be worth having one more Netgraph person review
it and give a sanity check, but
I think we should commit your patch ASAP.
I am new to VNET, but I am wondering if in your patch we can KASSERT if
node->vnet is NULL.  That would make
things easier to debug.

The part of my patch which which does CURVNET_SET is still necessary upon
attach in Bluetooth.
However, with your patch, we can get rid of the part of my patch which does
CURVNET_SET upon Bluetooth detach.

--
Craig



On Fri, Jul 12, 2013 at 11:24 AM, Adrian Chadd  wrote:

> Hm, I just found a patch in my local collection which works for all
> netgraph nodes.
>
> Maybe we should do that instead of this?
>
> http://people.freebsd.org/~adrian/ath/20130712-netgraph-vimage.diff
>
> That should solve it for all dynamic netgraph stuff, rather than just
> bluetooth.
>
>
>
> -adrian
>
> On 12 July 2013 01:03, Craig Rodrigues  wrote:
> > Author: rodrigc
> > Date: Fri Jul 12 08:03:10 2013
> > New Revision: 253255
> > URL: http://svnweb.freebsd.org/changeset/base/253255
> >
> > Log:
> >   PR: kern/168520
> >   Submitted by: "YAMAMOTO, Shigeru" 
> >   Reviewed by: adrian
> >
> >   In PC-BSD 9.1, VIMAGE is enabled in the kernel config.
> >   For laptops with Bluetooth capability, such as the HP Elitebook 8460p,
> >   the kernel will panic upon bootup, because curthread->td_vnet
> >   is not initialized.
> >
> >   Properly initialize curthread->td_vnet when initializing the Bluetooth
> stack.
> >
> >   This allows laptops such as the HP Elitebook 8460p laptop
> >   to properly boot with VIMAGE kernels.
> >
> > Modified:
> >   head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
> >
> > Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
> >
> ==============================================================================
> > --- head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c    Fri Jul 12
> 07:43:56 2013        (r253254)
> > +++ head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c    Fri Jul 12
> 08:03:10 2013        (r253255)
> > @@ -109,7 +109,9 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> > +#include 
> >
> >  #include "usbdevs.h"
> >  #include 
> > @@ -123,6 +125,7 @@
> >  #include 
> >  #include 
> >
> > +#include 
> >  #include 
> >  #include 
> >  #include 
> > @@ -487,13 +490,14 @@ ubt_attach(device_t dev)
> >
> >         sc->sc_dev = dev;
> >         sc->sc_debug = NG_UBT_WARN_LEVEL;
> > -
> > +       CURVNET_SET(TD_TO_VNET(curthread));
> >         /*
> >          * Create Netgraph node
> >          */
> >
> >         if (ng_make_node_common(&typestruct, &sc->sc_node) != 0) {
> >                 UBT_ALERT(sc, "could not create Netgraph node\n");
> > +               CURVNET_RESTORE();
> >                 return (ENXIO);
> >         }
> >
> > @@ -501,10 +505,12 @@ ubt_attach(device_t dev)
> >         if (ng_name_node(sc->sc_node, device_get_nameunit(dev)) != 0) {
> >                 UBT_ALERT(sc, "could not name Netgraph node\n");
> >                 NG_NODE_UNREF(sc->sc_node);
> > +               CURVNET_RESTORE();
> >                 return (ENXIO);
> >         }
> >         NG_NODE_SET_PRIVATE(sc->sc_node, sc);
> >         NG_NODE_FORCE_WRITER(sc->sc_node);
> > +       CURVNET_RESTORE();
> >
> >         /*
> >          * Initialize device softc structure
> > @@ -631,8 +637,10 @@ ubt_detach(device_t dev)
> >         /* Destroy Netgraph node */
> >         if (node != NULL) {
> >                 sc->sc_node = NULL;
> > +               CURVNET_SET(node->nd_vnet);
> >                 NG_NODE_REALLY_DIE(node);
> >                 ng_rmnode_self(node);
> > +               CURVNET_RESTORE();
> >         }
> >
> >         /* Make sure ubt_task in gone */
>

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 18:52:33 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 98B1AA35;
 Fri, 12 Jul 2013 18:52:33 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8B18818C4;
 Fri, 12 Jul 2013 18:52:33 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CIqXgf009825;
 Fri, 12 Jul 2013 18:52:33 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CIqXGg009824;
 Fri, 12 Jul 2013 18:52:33 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201307121852.r6CIqXGg009824@svn.freebsd.org>
From: Konstantin Belousov 
Date: Fri, 12 Jul 2013 18:52:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253280 - head/sys/ufs/ffs
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 18:52:33 -0000

Author: kib
Date: Fri Jul 12 18:52:33 2013
New Revision: 253280
URL: http://svnweb.freebsd.org/changeset/base/253280

Log:
  Only copy as much bytes as there in superblock, instead of the full
  block copy, when copying the superblock into the snapshot.  UFS1 does
  not align superblock on the block boundary, and bcopy runs off the end
  of the buffer.
  
  Reported by:	Andre Albsmeier 
  Reviewed by:	mckusick
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/ufs/ffs/ffs_snapshot.c

Modified: head/sys/ufs/ffs/ffs_snapshot.c
==============================================================================
--- head/sys/ufs/ffs/ffs_snapshot.c	Fri Jul 12 18:13:41 2013	(r253279)
+++ head/sys/ufs/ffs/ffs_snapshot.c	Fri Jul 12 18:52:33 2013	(r253280)
@@ -792,7 +792,7 @@ out1:
 		brelse(nbp);
 	} else {
 		loc = blkoff(fs, fs->fs_sblockloc);
-		bcopy((char *)copy_fs, &nbp->b_data[loc], fs->fs_bsize);
+		bcopy((char *)copy_fs, &nbp->b_data[loc], (u_int)fs->fs_sbsize);
 		bawrite(nbp);
 	}
 	/*

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 18:54:49 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 5EF2FBA6;
 Fri, 12 Jul 2013 18:54:49 +0000 (UTC)
 (envelope-from trociny@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 40F0718DD;
 Fri, 12 Jul 2013 18:54:49 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CIsn05010091;
 Fri, 12 Jul 2013 18:54:49 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CIsmXx010086;
 Fri, 12 Jul 2013 18:54:48 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201307121854.r6CIsmXx010086@svn.freebsd.org>
From: Mikolaj Golub 
Date: Fri, 12 Jul 2013 18:54:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253281 - in stable/9/sys: netinet netinet6
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 18:54:49 -0000

Author: trociny
Date: Fri Jul 12 18:54:47 2013
New Revision: 253281
URL: http://svnweb.freebsd.org/changeset/base/253281

Log:
  MFC r252710:
  
  In r227207, to fix the issue with possible NULL inp_socket pointer
  dereferencing, when checking for SO_REUSEPORT option (and SO_REUSEADDR
  for multicast), INP_REUSEPORT flag was introduced to cache the socket
  option.  It was decided then that one flag would be enough to cache
  both SO_REUSEPORT and SO_REUSEADDR: when processing SO_REUSEADDR
  setsockopt(2), it was checked if it was called for a multicast address
  and INP_REUSEPORT was set accordingly.
  
  Unfortunately that approach does not work when setsockopt(2) is called
  before binding to a multicast address: the multicast check fails and
  INP_REUSEPORT is not set.
  
  Fix this by adding INP_REUSEADDR flag to unconditionally cache
  SO_REUSEADDR.
  
  PR:		179901
  Submitted by:	Michael Gmelin freebsd grem.de (initial version)
  Reviewed by:	rwatson
  Approved by:	re (kib)

Modified:
  stable/9/sys/netinet/in_pcb.c
  stable/9/sys/netinet/in_pcb.h
  stable/9/sys/netinet/ip_output.c
  stable/9/sys/netinet6/in6_pcb.c
  stable/9/sys/netinet6/ip6_output.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netinet/in_pcb.c
==============================================================================
--- stable/9/sys/netinet/in_pcb.c	Fri Jul 12 18:52:33 2013	(r253280)
+++ stable/9/sys/netinet/in_pcb.c	Fri Jul 12 18:54:47 2013	(r253281)
@@ -466,6 +466,23 @@ in_pcb_lport(struct inpcb *inp, struct i
 
 	return (0);
 }
+
+/*
+ * Return cached socket options.
+ */
+short
+inp_so_options(const struct inpcb *inp)
+{
+   short so_options;
+
+   so_options = 0;
+
+   if ((inp->inp_flags2 & INP_REUSEPORT) != 0)
+	   so_options |= SO_REUSEPORT;
+   if ((inp->inp_flags2 & INP_REUSEADDR) != 0)
+	   so_options |= SO_REUSEADDR;
+   return (so_options);
+}
 #endif /* INET || INET6 */
 
 #ifdef INET
@@ -594,8 +611,7 @@ in_pcbbind_setup(struct inpcb *inp, stru
 				if (tw == NULL ||
 				    (reuseport & tw->tw_so_options) == 0)
 					return (EADDRINUSE);
-			} else if (t && (reuseport == 0 ||
-			    (t->inp_flags2 & INP_REUSEPORT) == 0)) {
+			} else if (t && (reuseport & inp_so_options(t)) == 0) {
 #ifdef INET6
 				if (ntohl(sin->sin_addr.s_addr) !=
 				    INADDR_ANY ||

Modified: stable/9/sys/netinet/in_pcb.h
==============================================================================
--- stable/9/sys/netinet/in_pcb.h	Fri Jul 12 18:52:33 2013	(r253280)
+++ stable/9/sys/netinet/in_pcb.h	Fri Jul 12 18:54:47 2013	(r253281)
@@ -442,6 +442,7 @@ struct tcpcb *
 	inp_inpcbtotcpcb(struct inpcb *inp);
 void 	inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp,
 		uint32_t *faddr, uint16_t *fp);
+short	inp_so_options(const struct inpcb *inp);
 
 #endif /* _KERNEL */
 
@@ -543,6 +544,7 @@ void 	inp_4tuple_get(struct inpcb *inp, 
 #define	INP_PCBGROUPWILD	0x00000004 /* in pcbgroup wildcard list */
 #define	INP_REUSEPORT		0x00000008 /* SO_REUSEPORT option is set */
 #define	INP_FREED		0x00000010 /* inp itself is not valid */
+#define	INP_REUSEADDR		0x00000020 /* SO_REUSEADDR option is set */
 
 /*
  * Flags passed to in_pcblookup*() functions.

Modified: stable/9/sys/netinet/ip_output.c
==============================================================================
--- stable/9/sys/netinet/ip_output.c	Fri Jul 12 18:52:33 2013	(r253280)
+++ stable/9/sys/netinet/ip_output.c	Fri Jul 12 18:54:47 2013	(r253281)
@@ -899,13 +899,10 @@ ip_ctloutput(struct socket *so, struct s
 			switch (sopt->sopt_name) {
 			case SO_REUSEADDR:
 				INP_WLOCK(inp);
-				if (IN_MULTICAST(ntohl(inp->inp_laddr.s_addr))) {
-					if ((so->so_options &
-					    (SO_REUSEADDR | SO_REUSEPORT)) != 0)
-						inp->inp_flags2 |= INP_REUSEPORT;
-					else
-						inp->inp_flags2 &= ~INP_REUSEPORT;
-				}
+				if ((so->so_options & SO_REUSEADDR) != 0)
+					inp->inp_flags2 |= INP_REUSEADDR;
+				else
+					inp->inp_flags2 &= ~INP_REUSEADDR;
 				INP_WUNLOCK(inp);
 				error = 0;
 				break;

Modified: stable/9/sys/netinet6/in6_pcb.c
==============================================================================
--- stable/9/sys/netinet6/in6_pcb.c	Fri Jul 12 18:52:33 2013	(r253280)
+++ stable/9/sys/netinet6/in6_pcb.c	Fri Jul 12 18:54:47 2013	(r253281)
@@ -245,8 +245,7 @@ in6_pcbbind(register struct inpcb *inp, 
 				if (tw == NULL ||
 				    (reuseport & tw->tw_so_options) == 0)
 					return (EADDRINUSE);
-			} else if (t && (reuseport == 0 ||
-			    (t->inp_flags2 & INP_REUSEPORT) == 0)) {
+			} else if (t && (reuseport & inp_so_options(t)) == 0) {
 				return (EADDRINUSE);
 			}
 #ifdef INET
@@ -267,8 +266,8 @@ in6_pcbbind(register struct inpcb *inp, 
 					     INP_IPV6PROTO) ==
 					     (t->inp_vflag & INP_IPV6PROTO))))
 						return (EADDRINUSE);
-				} else if (t && (reuseport == 0 ||
-				    (t->inp_flags2 & INP_REUSEPORT) == 0) &&
+				} else if (t &&
+				    (reuseport & inp_so_options(t)) == 0 &&
 				    (ntohl(t->inp_laddr.s_addr) != INADDR_ANY ||
 				    (t->inp_vflag & INP_IPV6PROTO) != 0))
 					return (EADDRINUSE);

Modified: stable/9/sys/netinet6/ip6_output.c
==============================================================================
--- stable/9/sys/netinet6/ip6_output.c	Fri Jul 12 18:52:33 2013	(r253280)
+++ stable/9/sys/netinet6/ip6_output.c	Fri Jul 12 18:54:47 2013	(r253281)
@@ -1491,13 +1491,10 @@ ip6_ctloutput(struct socket *so, struct 
 			switch (sopt->sopt_name) {
 			case SO_REUSEADDR:
 				INP_WLOCK(in6p);
-				if (IN_MULTICAST(ntohl(in6p->inp_laddr.s_addr))) {
-					if ((so->so_options &
-					    (SO_REUSEADDR | SO_REUSEPORT)) != 0)
-						in6p->inp_flags2 |= INP_REUSEPORT;
-					else
-						in6p->inp_flags2 &= ~INP_REUSEPORT;
-				}
+				if ((so->so_options & SO_REUSEADDR) != 0)
+					in6p->inp_flags2 |= INP_REUSEADDR;
+				else
+					in6p->inp_flags2 &= ~INP_REUSEADDR;
 				INP_WUNLOCK(in6p);
 				error = 0;
 				break;

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 19:08:34 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 2816BF92;
 Fri, 12 Jul 2013 19:08:34 +0000 (UTC)
 (envelope-from trociny@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 01DAD19AD;
 Fri, 12 Jul 2013 19:08:34 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CJ8XJ6013720;
 Fri, 12 Jul 2013 19:08:33 GMT (envelope-from trociny@svn.freebsd.org)
Received: (from trociny@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CJ8Xof013718;
 Fri, 12 Jul 2013 19:08:33 GMT (envelope-from trociny@svn.freebsd.org)
Message-Id: <201307121908.r6CJ8Xof013718@svn.freebsd.org>
From: Mikolaj Golub 
Date: Fri, 12 Jul 2013 19:08:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253282 - in head/sys: netinet netinet6
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 19:08:34 -0000

Author: trociny
Date: Fri Jul 12 19:08:33 2013
New Revision: 253282
URL: http://svnweb.freebsd.org/changeset/base/253282

Log:
  A complete duplication of binding should be allowed if on both new and
  duplicated sockets a multicast address is bound and either
  SO_REUSEPORT or SO_REUSEADDR is set.
  
  But actually it works for the following combinations:
  
    * SO_REUSEPORT is set for the fist socket and SO_REUSEPORT for the new;
    * SO_REUSEADDR is set for the fist socket and SO_REUSEADDR for the new;
    * SO_REUSEPORT is set for the fist socket and SO_REUSEADDR for the new;
  
  and fails for this:
  
    * SO_REUSEADDR is set for the fist socket and SO_REUSEPORT for the new.
  
  Fix the last case.
  
  PR:		179901
  MFC after:	1 month

Modified:
  head/sys/netinet/in_pcb.c
  head/sys/netinet6/in6_pcb.c

Modified: head/sys/netinet/in_pcb.c
==============================================================================
--- head/sys/netinet/in_pcb.c	Fri Jul 12 18:54:47 2013	(r253281)
+++ head/sys/netinet/in_pcb.c	Fri Jul 12 19:08:33 2013	(r253282)
@@ -554,7 +554,7 @@ in_pcbbind_setup(struct inpcb *inp, stru
 			 * and a multicast address is bound on both
 			 * new and duplicated sockets.
 			 */
-			if (so->so_options & SO_REUSEADDR)
+			if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) != 0)
 				reuseport = SO_REUSEADDR|SO_REUSEPORT;
 		} else if (sin->sin_addr.s_addr != INADDR_ANY) {
 			sin->sin_port = 0;		/* yech... */

Modified: head/sys/netinet6/in6_pcb.c
==============================================================================
--- head/sys/netinet6/in6_pcb.c	Fri Jul 12 18:54:47 2013	(r253281)
+++ head/sys/netinet6/in6_pcb.c	Fri Jul 12 19:08:33 2013	(r253282)
@@ -156,7 +156,7 @@ in6_pcbbind(register struct inpcb *inp, 
 			 * and a multicast address is bound on both
 			 * new and duplicated sockets.
 			 */
-			if (so->so_options & SO_REUSEADDR)
+			if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) != 0)
 				reuseport = SO_REUSEADDR|SO_REUSEPORT;
 		} else if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
 			struct ifaddr *ifa;

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 20:06:53 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 78BEFB84;
 Fri, 12 Jul 2013 20:06:53 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 6AB181CA5;
 Fri, 12 Jul 2013 20:06:53 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CK6rRD030841;
 Fri, 12 Jul 2013 20:06:53 GMT (envelope-from dim@svn.freebsd.org)
Received: (from dim@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CK6rY7030839;
 Fri, 12 Jul 2013 20:06:53 GMT (envelope-from dim@svn.freebsd.org)
Message-Id: <201307122006.r6CK6rY7030839@svn.freebsd.org>
From: Dimitry Andric 
Date: Fri, 12 Jul 2013 20:06:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253283 - stable/9/lib/clang
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 20:06:53 -0000

Author: dim
Date: Fri Jul 12 20:06:52 2013
New Revision: 253283
URL: http://svnweb.freebsd.org/changeset/base/253283

Log:
  Update clang's target triple for FreeBSD 9.2-PRERELEASE.
  
  Approved by:	re (delphij)

Modified:
  stable/9/lib/clang/clang.build.mk

Modified: stable/9/lib/clang/clang.build.mk
==============================================================================
--- stable/9/lib/clang/clang.build.mk	Fri Jul 12 19:08:33 2013	(r253282)
+++ stable/9/lib/clang/clang.build.mk	Fri Jul 12 20:06:52 2013	(r253283)
@@ -27,8 +27,8 @@ TARGET_ABI=	gnueabi
 TARGET_ABI=	unknown
 .endif
 
-TARGET_TRIPLE?=	${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd9.1
-BUILD_TRIPLE?=	${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd9.1
+TARGET_TRIPLE?=	${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd9.2
+BUILD_TRIPLE?=	${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd9.2
 CFLAGS+=	-DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \
 		-DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \
 		-DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 20:27:18 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id BEA6074;
 Fri, 12 Jul 2013 20:27:18 +0000 (UTC)
 (envelope-from to.my.trociny@gmail.com)
Received: from mail-lb0-x236.google.com (mail-lb0-x236.google.com
 [IPv6:2a00:1450:4010:c04::236])
 by mx1.freebsd.org (Postfix) with ESMTP id 7A5F81D71;
 Fri, 12 Jul 2013 20:27:17 +0000 (UTC)
Received: by mail-lb0-f182.google.com with SMTP id r11so7993230lbv.13
 for ; Fri, 12 Jul 2013 13:27:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=8f4gDBddKqeWw+3cet36rBc1u/LgCKj2dRiWB8y04ZQ=;
 b=WkJSzphz2l39qiwYRj1urAUmyut/UlaOrj36dAhXyJ0hhd5RhfK0QFH23oIRqCGPAa
 J6QMR5nreuqSaNUzoi36CThihhqJRmmH2s53WR2wSZkgoxdiNud7PeNTw5mIWqo/fRRR
 uGmpRH5cIc7OooTo+2uDWW+QtytzjHkkwVj1N0RgR0ixiViWHpZtw9pXs5rafacL0CgW
 kwUAg0MfLcs8LQroITdFznpGB9gZ3DXNV+BY6eaCRZe5HcWZqRF2/WZtCB0FIqtPT9MU
 inTweWCzgZFm6ckI3FD4jcEoA0zNOmzGjUVI08Vq5bB53EiKiKF7mjDnYIclp+4fJccO
 Xyyg==
X-Received: by 10.152.21.99 with SMTP id u3mr20607353lae.18.1373660835579;
 Fri, 12 Jul 2013 13:27:15 -0700 (PDT)
Received: from localhost ([178.150.115.244])
 by mx.google.com with ESMTPSA id et10sm14505281lbc.6.2013.07.12.13.27.13
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Fri, 12 Jul 2013 13:27:14 -0700 (PDT)
Sender: Mikolaj Golub 
Date: Fri, 12 Jul 2013 23:27:12 +0300
From: Mikolaj Golub 
To: Craig Rodrigues 
Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt
Message-ID: <20130712202710.GB2757@gmail.com>
References: <201307120803.r6C83ACp016523@svn.freebsd.org>
 
 
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 Adrian Chadd , src-committers@freebsd.org,
 Marko Zec 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 20:27:18 -0000

On Fri, Jul 12, 2013 at 11:39:34AM -0700, Craig Rodrigues wrote:
> I like your patch.  It may be worth having one more Netgraph person review
> it and give a sanity check, but
> I think we should commit your patch ASAP.
> I am new to VNET, but I am wondering if in your patch we can KASSERT if
> node->vnet is NULL.  That would make
> things easier to debug.
> 
> The part of my patch which which does CURVNET_SET is still necessary upon
> attach in Bluetooth.
> However, with your patch, we can get rid of the part of my patch which does
> CURVNET_SET upon Bluetooth detach.

Some time ago there was a long discussion about VIMAGE issue with
hotplugabble network devices:

http://lists.freebsd.org/pipermail/freebsd-hackers/2012-October/040784.html

(I wander why Adrian did not mention it as he was deeply involved)

Then Marko came up with a patch that mihght fix the issue in a more
generic way:

http://lists.freebsd.org/pipermail/freebsd-hackers/2012-November/041120.html

Unfortunately it was not tested. I think it would be very interesting
to try it with hotplugabble devices. (I don't have any so can't test).

-- 
Mikolaj Golub

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 21:14:43 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 6AA43C6D;
 Fri, 12 Jul 2013 21:14:43 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 5B7961F51;
 Fri, 12 Jul 2013 21:14:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CLEhNg051072;
 Fri, 12 Jul 2013 21:14:43 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CLEhFk051071;
 Fri, 12 Jul 2013 21:14:43 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201307122114.r6CLEhFk051071@svn.freebsd.org>
From: Jack F Vogel 
Date: Fri, 12 Jul 2013 21:14:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253284 - head/sys/dev/ixgbe
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 21:14:43 -0000

Author: jfv
Date: Fri Jul 12 21:14:42 2013
New Revision: 253284
URL: http://svnweb.freebsd.org/changeset/base/253284

Log:
  Remove the conditional define around the option headers,
  when building the driver as a module the result of the present
  system results in INET and INET6 being undefined, and will cause
  the panic in ixgbe_tso_setup(). The Makefile in the module directory
  now renders the conditional in the source unnecessary and wrong.
  
  MFC after: ASAP - the panic as a module must not get into 9.2

Modified:
  head/sys/dev/ixgbe/ixgbe.c

Modified: head/sys/dev/ixgbe/ixgbe.c
==============================================================================
--- head/sys/dev/ixgbe/ixgbe.c	Fri Jul 12 20:06:52 2013	(r253283)
+++ head/sys/dev/ixgbe/ixgbe.c	Fri Jul 12 21:14:42 2013	(r253284)
@@ -33,11 +33,8 @@
 /*$FreeBSD$*/
 
 
-#ifdef HAVE_KERNEL_OPTION_HEADERS
 #include "opt_inet.h"
 #include "opt_inet6.h"
-#endif
-
 #include "ixgbe.h"
 
 /*********************************************************************

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 21:21:15 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id B8745EF8;
 Fri, 12 Jul 2013 21:21:15 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id AA9A81FBA;
 Fri, 12 Jul 2013 21:21:15 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CLLFKp053457;
 Fri, 12 Jul 2013 21:21:15 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CLLFus053456;
 Fri, 12 Jul 2013 21:21:15 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201307122121.r6CLLFus053456@svn.freebsd.org>
From: Jack F Vogel 
Date: Fri, 12 Jul 2013 21:21:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253285 - head/sys/dev/ixgbe
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 21:21:15 -0000

Author: jfv
Date: Fri Jul 12 21:21:15 2013
New Revision: 253285
URL: http://svnweb.freebsd.org/changeset/base/253285

Log:
  Opps, need to change the VF code as well.
  
  MFC after:	ASAP

Modified:
  head/sys/dev/ixgbe/ixv.c

Modified: head/sys/dev/ixgbe/ixv.c
==============================================================================
--- head/sys/dev/ixgbe/ixv.c	Fri Jul 12 21:14:42 2013	(r253284)
+++ head/sys/dev/ixgbe/ixv.c	Fri Jul 12 21:21:15 2013	(r253285)
@@ -32,11 +32,8 @@
 ******************************************************************************/
 /*$FreeBSD$*/
 
-#ifdef HAVE_KERNEL_OPTION_HEADERS
 #include "opt_inet.h"
 #include "opt_inet6.h"
-#endif
-
 #include "ixv.h"
 
 /*********************************************************************

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 21:36:29 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id EF44E600;
 Fri, 12 Jul 2013 21:36:29 +0000 (UTC)
 (envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id E0FAF108B;
 Fri, 12 Jul 2013 21:36:29 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CLaTE9056938;
 Fri, 12 Jul 2013 21:36:29 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CLaT2D056937;
 Fri, 12 Jul 2013 21:36:29 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201307122136.r6CLaT2D056937@svn.freebsd.org>
From: Xin LI 
Date: Fri, 12 Jul 2013 21:36:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253288 - head/sys/dev/hptnr
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 21:36:30 -0000

Author: delphij
Date: Fri Jul 12 21:36:29 2013
New Revision: 253288
URL: http://svnweb.freebsd.org/changeset/base/253288

Log:
  Merge from hpt27xx, r249468 (mav):
  
  MFprojects/camlock r248982:
  Stop abusing xpt_periph in random plases that really have no periph related
  to CCB, for example, bus scanning.  NULL value is fine in such cases and it
  is correctly logged in debug messages as "noperiph".  If at some point we
  need some real XPT periphs (alike to pmpX now), quite likely they will be
  per-bus, and not a single global instance as xpt_periph now.

Modified:
  head/sys/dev/hptnr/hptnr_osm_bsd.c

Modified: head/sys/dev/hptnr/hptnr_osm_bsd.c
==============================================================================
--- head/sys/dev/hptnr/hptnr_osm_bsd.c	Fri Jul 12 21:27:23 2013	(r253287)
+++ head/sys/dev/hptnr/hptnr_osm_bsd.c	Fri Jul 12 21:36:29 2013	(r253288)
@@ -1347,7 +1347,7 @@ static int	hpt_rescan_bus(void)
 		{
 			return(ENOMEM);
 		}
-		if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(vbus_ext->sim),
+		if (xpt_create_path(&ccb->ccb_h.path, NULL, cam_sim_path(vbus_ext->sim),
 			CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP)	
 		{
 			xpt_free_ccb(ccb);

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:01:19 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 62A95C45;
 Fri, 12 Jul 2013 22:01:19 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 436411199;
 Fri, 12 Jul 2013 22:01:19 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CM1Jve064822;
 Fri, 12 Jul 2013 22:01:19 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CM1IcV064819;
 Fri, 12 Jul 2013 22:01:18 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307122201.r6CM1IcV064819@svn.freebsd.org>
From: Jim Harris 
Date: Fri, 12 Jul 2013 22:01:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253289 - stable/9/share/man/man4
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:01:19 -0000

Author: jimharris
Date: Fri Jul 12 22:01:18 2013
New Revision: 253289
URL: http://svnweb.freebsd.org/changeset/base/253289

Log:
  MFC r241431:
  
  Add man pages for nvme(4) and nvd(4).
  
  Approved by:	re (kib)

Added:
  stable/9/share/man/man4/nvd.4
     - copied unchanged from r241431, head/share/man/man4/nvd.4
  stable/9/share/man/man4/nvme.4
     - copied unchanged from r241431, head/share/man/man4/nvme.4
Modified:
  stable/9/share/man/man4/Makefile
Directory Properties:
  stable/9/share/man/man4/   (props changed)

Modified: stable/9/share/man/man4/Makefile
==============================================================================
--- stable/9/share/man/man4/Makefile	Fri Jul 12 21:36:29 2013	(r253288)
+++ stable/9/share/man/man4/Makefile	Fri Jul 12 22:01:18 2013	(r253289)
@@ -329,7 +329,9 @@ MAN=	aac.4 \
 	nmdm.4 \
 	nsp.4 \
 	null.4 \
+	${_nvd.4} \
 	${_nve.4} \
+	${_nvme.4} \
 	${_nvram.4} \
 	${_nvram2env.4} \
 	${_nxge.4} \
@@ -742,7 +744,9 @@ _linux.4=	linux.4
 _ndis.4=	ndis.4
 _nfe.4=		nfe.4
 _nfsmb.4=	nfsmb.4
+_nvd.4=		nvd.4
 _nve.4=		nve.4
+_nvme.4=	nvme.4
 _nvram.4=	nvram.4
 _nxge.4=	nxge.4
 _virtio.4=	virtio.4

Copied: stable/9/share/man/man4/nvd.4 (from r241431, head/share/man/man4/nvd.4)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/9/share/man/man4/nvd.4	Fri Jul 12 22:01:18 2013	(r253289, copy of r241431, head/share/man/man4/nvd.4)
@@ -0,0 +1,91 @@
+.\"
+.\" Copyright (c) 2012 Intel Corporation
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions, and the following disclaimer,
+.\"    without modification.
+.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
+.\"    substantially similar to the "NO WARRANTY" disclaimer below
+.\"    ("Disclaimer") and any redistribution must be conditioned upon
+.\"    including a substantially similar Disclaimer requirement for further
+.\"    binary redistribution.
+.\"
+.\" NO WARRANTY
+.\" 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 MERCHANTIBILITY AND FITNESS FOR
+.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
+.\"
+.\" nvd driver man page.
+.\"
+.\" Author: Jim Harris 
+.\"
+.\" $FreeBSD$
+.\"
+.Dd October 10, 2012
+.Dt NVD 4
+.Os
+.Sh NAME
+.Nm nvd
+.Nd NVM Express disk driver
+.Sh SYNOPSIS
+To compile this driver into your kernel,
+place the following lines in your kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device nvme"
+.Cd "device nvd"
+.Ed
+.Pp
+Or, to load the driver as a module at boot, place the following lines in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+nvme_load="YES"
+nvd_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver exposes NVM Express (NVMe) namespaces as disks to the kernel disk
+storage API.
+It depends on the
+.Xr nvme 4
+driver for notification of existing NVMe namespaces and submission of NVM
+I/O commands.
+.Sh SEE ALSO
+.Xr nvme 4 ,
+.Xr nvmecontrol 8 , 
+.Xr disk 9 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was developed by Intel and originally written by
+.An Jim Harris Aq jimharris@FreeBSD.org ,
+with contributions from Joe Golio at EMC.
+.Pp
+This man page was written by
+.An Jim Harris Aq jimharris@FreeBSD.org .
+.Sh BUGS
+The
+.Nm
+driver is considered experimental.
+Development and testing have been primarily focused on amd64.
+The following areas of development and testing are in progress:
+.Bl -bullet
+.It
+testing on i386
+.It 
+command timeout error handling
+.El
+

Copied: stable/9/share/man/man4/nvme.4 (from r241431, head/share/man/man4/nvme.4)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/9/share/man/man4/nvme.4	Fri Jul 12 22:01:18 2013	(r253289, copy of r241431, head/share/man/man4/nvme.4)
@@ -0,0 +1,175 @@
+.\"
+.\" Copyright (c) 2012 Intel Corporation
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions, and the following disclaimer,
+.\"    without modification.
+.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
+.\"    substantially similar to the "NO WARRANTY" disclaimer below
+.\"    ("Disclaimer") and any redistribution must be conditioned upon
+.\"    including a substantially similar Disclaimer requirement for further
+.\"    binary redistribution.
+.\"
+.\" NO WARRANTY
+.\" 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 MERCHANTIBILITY AND FITNESS FOR
+.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
+.\"
+.\" nvme driver man page.
+.\"
+.\" Author: Jim Harris 
+.\"
+.\" $FreeBSD$
+.\"
+.Dd October 10, 2012
+.Dt NVME 4
+.Os
+.Sh NAME
+.Nm nvme
+.Nd NVM Express core driver
+.Sh SYNOPSIS
+To compile this driver into your kernel,
+place the following line in your kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device nvme"
+.Ed
+.Pp
+Or, to load the driver as a module at boot, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+nvme_load="YES"
+.Ed
+.Pp
+Most users will also want to enable
+.Xr nvd 4
+to surface NVM Express namespaces as disk devices.
+Note that in NVM Express terms, a namespace is roughly equivalent to a
+SCSI LUN.
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for NVM Express (NVMe) controllers, such as:
+.Bl -bullet
+.It
+Hardware initialization
+.It
+Per-CPU IO queue pairs
+.It
+API for registering NVMe namespace consumers such as
+.Xr nvd 4
+.It
+API for submitting NVM commands to namespaces
+.It
+Ioctls for controller and namespace configuration and management
+.Nm
+creates controller devices in the format /dev/nvmeX and namespace devices in
+the format /dev/nvmeXnsY.
+Note that the NVM Express specification starts numbering namespaces at 1,
+not 0, and this driver follows that convention.
+.El
+.Sh CONFIGURATION
+By default,
+.Nm
+will create an I/O queue pair for each CPU, provided enough MSI-X vectors
+can be allocated.
+To force a single I/O queue pair shared by all CPUs, set the following
+tunable value in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+hw.nvme.per_cpu_io_queues=0
+.Ed
+.Pp
+To force legacy interrupts for all
+.Nm
+driver instances, set the following tunable value in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+hw.nvme.force_intx=1
+.Ed
+.Pp
+Note that use of INTx implies disabling of per-CPU I/O queue pairs.
+.Sh SYSCTL VARIABLES
+The following controller-level sysctls are currently implemented:
+.Bl -tag -width indent
+.It Va dev.nvme.0.int_coal_time
+(R/W) Interrupt coalescing timer period in microseconds.  Set to 0 to disable.
+.It Va dev.nvme.0.int_coal_threshold
+(R/W) Interrupt coalescing threshold in number of command completions.
+Set to 0 to disable.
+.El
+.Pp
+The following queue pair-level sysctls are currently implemented.
+Admin queue sysctls take the format of dev.nvme.0.adminq and I/O queue sysctls
+take the format of dev.nvme.0.ioq0.
+.Bl -tag -width indent
+.It Va dev.nvme.0.ioq0.num_entries
+(R) Number of entries in this queue pair's command and completion queue.
+.It Va dev.nvme.0.ioq0.num_tr
+(R) Number of nvme_tracker structures currently allocated for this queue pair.
+.It Va dev.nvme.0.ioq0.num_prp_list
+(R) Number of nvme_prp_list structures currently allocated for this queue pair.
+.It Va dev.nvme.0.ioq0.sq_head
+(R) Current location of the submission queue head pointer as observed by
+the driver.
+The head pointer is incremented by the controller as it takes commands off
+of the submission queue.
+.It Va dev.nvme.0.ioq0.sq_tail
+(R) Current location of the submission queue tail pointer as observed by
+the driver.
+The driver increments the tail pointer after writing a command
+into the submission queue to signal that a new command is ready to be
+processed.
+.It Va dev.nvme.0.ioq0.cq_head
+(R) Current location of the completion queue head pointer as observed by
+the driver.
+The driver increments the head pointer after finishing
+with a completion entry that was posted by the controller.
+.It Va dev.nvme.0.ioq0.num_cmds
+(R) Number of commands that have been submitted on this queue pair.
+.It Va dev.nvme.0.ioq0.dump_debug
+(W) Writing 1 to this sysctl will dump the full contents of the submission
+and completion queues to the console.
+.El
+.Sh SEE ALSO
+.Xr nvd 4 ,
+.Xr pci 4 ,
+.Xr nvmecontrol 8 ,
+.Xr disk 9 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was developed by Intel and originally written by
+.An Jim Harris Aq jimharris@FreeBSD.org , 
+with contributions from Joe Golio at EMC.
+.Pp
+This man page was written by
+.An Jim Harris Aq jimharris@FreeBSD.org .
+.Sh BUGS
+The
+.Nm
+driver is considered experimental.
+Development and testing have been primarily focused on amd64.
+The following areas of development and testing are in progress:
+.Bl -bullet
+.It
+testing on i386
+.It
+asynchronous error reporting
+.It
+command timeout error handling
+.It
+controller-level resets
+.El

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:02:12 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 15828D72;
 Fri, 12 Jul 2013 22:02:12 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 043FF119E;
 Fri, 12 Jul 2013 22:02:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CM2B9L065025;
 Fri, 12 Jul 2013 22:02:11 GMT (envelope-from gjb@svn.freebsd.org)
Received: (from gjb@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CM2BwY065024;
 Fri, 12 Jul 2013 22:02:11 GMT (envelope-from gjb@svn.freebsd.org)
Message-Id: <201307122202.r6CM2BwY065024@svn.freebsd.org>
From: Glen Barber 
Date: Fri, 12 Jul 2013 22:02:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253290 - head/share/man/man5
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:02:12 -0000

Author: gjb
Date: Fri Jul 12 22:02:11 2013
New Revision: 253290
URL: http://svnweb.freebsd.org/changeset/base/253290

Log:
  Document that a literal jail name of 0 (zero) is not allowed.
  
  PR:		174436
  Submitted by:	Robert Schulze
  Reviewed by:	mjg
  MFC after:	3 days

Modified:
  head/share/man/man5/rc.conf.5

Modified: head/share/man/man5/rc.conf.5
==============================================================================
--- head/share/man/man5/rc.conf.5	Fri Jul 12 22:01:18 2013	(r253289)
+++ head/share/man/man5/rc.conf.5	Fri Jul 12 22:02:11 2013	(r253290)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 9, 2013
+.Dd July 12, 2013
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -3875,6 +3875,11 @@ configure multiple jails.
 The names specified in this list will be used to
 identify settings common to an instance of a jail,
 and should contain alphanumeric characters only.
+The literal jail name of
+.Dq Li 0
+.Pq zero
+is not allowed.
+.Pp
 Assuming that the jail in question was named
 .Li vjail ,
 you would have the following dependent variables:

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:02:35 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id E037AEAB;
 Fri, 12 Jul 2013 22:02:35 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id D142E11A2;
 Fri, 12 Jul 2013 22:02:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CM2Z3R065115;
 Fri, 12 Jul 2013 22:02:35 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CM2ZOD065113;
 Fri, 12 Jul 2013 22:02:35 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307122202.r6CM2ZOD065113@svn.freebsd.org>
From: Jim Harris 
Date: Fri, 12 Jul 2013 22:02:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253291 - stable/9/share/man/man4
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:02:36 -0000

Author: jimharris
Date: Fri Jul 12 22:02:35 2013
New Revision: 253291
URL: http://svnweb.freebsd.org/changeset/base/253291

Log:
  MFC r241479:
  
  Remove whitespace.
  
  Approved by:	re (kib)

Modified:
  stable/9/share/man/man4/nvd.4
  stable/9/share/man/man4/nvme.4
Directory Properties:
  stable/9/share/man/man4/   (props changed)

Modified: stable/9/share/man/man4/nvd.4
==============================================================================
--- stable/9/share/man/man4/nvd.4	Fri Jul 12 22:02:11 2013	(r253290)
+++ stable/9/share/man/man4/nvd.4	Fri Jul 12 22:02:35 2013	(r253291)
@@ -64,7 +64,7 @@ driver for notification of existing NVMe
 I/O commands.
 .Sh SEE ALSO
 .Xr nvme 4 ,
-.Xr nvmecontrol 8 , 
+.Xr nvmecontrol 8 ,
 .Xr disk 9 .
 .Sh AUTHORS
 .An -nosplit
@@ -85,7 +85,6 @@ The following areas of development and t
 .Bl -bullet
 .It
 testing on i386
-.It 
+.It
 command timeout error handling
 .El
-

Modified: stable/9/share/man/man4/nvme.4
==============================================================================
--- stable/9/share/man/man4/nvme.4	Fri Jul 12 22:02:11 2013	(r253290)
+++ stable/9/share/man/man4/nvme.4	Fri Jul 12 22:02:35 2013	(r253291)
@@ -152,7 +152,7 @@ and completion queues to the console.
 The
 .Nm
 driver was developed by Intel and originally written by
-.An Jim Harris Aq jimharris@FreeBSD.org , 
+.An Jim Harris Aq jimharris@FreeBSD.org ,
 with contributions from Joe Golio at EMC.
 .Pp
 This man page was written by

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:03:33 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 95A95FE;
 Fri, 12 Jul 2013 22:03:33 +0000 (UTC)
 (envelope-from melifaro@FreeBSD.org)
Received: from mail.ipfw.ru (unknown [IPv6:2a01:4f8:120:6141::2])
 by mx1.freebsd.org (Postfix) with ESMTP id 5D5DA11B9;
 Fri, 12 Jul 2013 22:03:33 +0000 (UTC)
Received: from v6.mpls.in ([2a02:978:2::5] helo=ws.su29.net)
 by mail.ipfw.ru with esmtpsa (TLSv1:CAMELLIA256-SHA:256)
 (Exim 4.76 (FreeBSD)) (envelope-from )
 id 1UxlUE-000BYw-Tf; Sat, 13 Jul 2013 02:06:46 +0400
Message-ID: <51E07D20.9040309@FreeBSD.org>
Date: Sat, 13 Jul 2013 02:03:12 +0400
From: "Alexander V. Chernikov" 
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64;
 rv:9.0) Gecko/20120121 Thunderbird/9.0
MIME-Version: 1.0
To: Hiroki Sato 
Subject: Re: svn commit: r253262 - in head: lib/libc/gen sys/net
References: <201307121236.r6CCaDCW095414@svn.freebsd.org>
In-Reply-To: <201307121236.r6CCaDCW095414@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
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:03:33 -0000

On 12.07.2013 16:36, Hiroki Sato wrote:
> Author: hrs
> Date: Fri Jul 12 12:36:12 2013
> New Revision: 253262
> URL: http://svnweb.freebsd.org/changeset/base/253262
>
> Log:
>    Add a leaf node CTL_NET.PF_ROUTE.0.AF.NET_RT_DUMP.0.FIB.  This returns
>    routing table with the specified FIB number, not td->td_proc->p_fibnum.
Thanks! I had plans to do the same :)
>
> Modified:
>    head/lib/libc/gen/sysctl.3
>    head/sys/net/rtsock.c
>
> Modified: head/lib/libc/gen/sysctl.3
> ==============================================================================
> --- head/lib/libc/gen/sysctl.3	Fri Jul 12 12:18:07 2013	(r253261)
> +++ head/lib/libc/gen/sysctl.3	Fri Jul 12 12:36:12 2013	(r253262)
> @@ -28,7 +28,7 @@
>   .\"	@(#)sysctl.3	8.4 (Berkeley) 5/9/95
>   .\" $FreeBSD$
>   .\"
> -.Dd February 11, 2012
> +.Dd May 17, 2013
>   .Dt SYSCTL 3
>   .Os
>   .Sh NAME
> @@ -547,14 +547,14 @@ The length of each message is contained
>   The third level name is a protocol number, which is currently always 0.
>   The fourth level name is an address family, which may be set to 0 to
>   select all address families.
> -The fifth and sixth level names are as follows:
> -.Bl -column "Fifth level nameXXXXXX" "Sixth level is:XXX" -offset indent
> -.It Sy "Fifth level name	Sixth level is:"
> -.It "NET_RT_FLAGS	rtflags"
> -.It "NET_RT_DUMP	None"
> -.It "NET_RT_IFLIST	0 or if_index"
> -.It "NET_RT_IFMALIST	0 or if_index"
> -.It "NET_RT_IFLISTL	0 or if_index"
> +The fifth, sixth, and seventh level names are as follows:
> +.Bl -column "Fifth level	" "Sixth level	" -offset indent
> +.It Sy "Fifth level	Sixth level	Seventh level"
> +.It "NET_RT_FLAGS	rtflags			None"
> +.It "NET_RT_DUMP	None			None or fib number"
> +.It "NET_RT_IFLIST	0 or if_index		None"
> +.It "NET_RT_IFMALIST	0 or if_index		None"
> +.It "NET_RT_IFLISTL	0 or if_index		None"
>   .El
>   .Pp
>   The
>
> Modified: head/sys/net/rtsock.c
> ==============================================================================
> --- head/sys/net/rtsock.c	Fri Jul 12 12:18:07 2013	(r253261)
> +++ head/sys/net/rtsock.c	Fri Jul 12 12:36:12 2013	(r253262)
> @@ -1905,6 +1905,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS)
>   	u_int	namelen = arg2;
>   	struct radix_node_head *rnh = NULL; /* silence compiler. */
>   	int	i, lim, error = EINVAL;
> +	int	fib = 0;
>   	u_char	af;
>   	struct	walkarg w;
>
> @@ -1912,7 +1913,17 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS)
>   	namelen--;
>   	if (req->newptr)
>   		return (EPERM);
> -	if (namelen != 3)
> +	if (name[1] == NET_RT_DUMP) {
> +		if (namelen == 3)
> +			fib = req->td->td_proc->p_fibnum;
> +		else if (namelen == 4)
> +			fib = (name[3] == -1) ?
> +			    req->td->td_proc->p_fibnum : name[3];
> +		else
> +			return ((namelen<  3) ? EISDIR : ENOTDIR);
> +		if (fib<  0 || fib>= rt_numfibs)
> +			return (EINVAL);
> +	} else if (namelen != 3)
>   		return ((namelen<  3) ? EISDIR : ENOTDIR);
>   	af = name[0];
>   	if (af>  AF_MAX)
> @@ -1951,7 +1962,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS)
>   		 * take care of routing entries
>   		 */
>   		for (error = 0; error == 0&&  i<= lim; i++) {
> -			rnh = rt_tables_get_rnh(req->td->td_proc->p_fibnum, i);
> +			rnh = rt_tables_get_rnh(fib, i);
>   			if (rnh != NULL) {
>   				RADIX_NODE_HEAD_RLOCK(rnh);
>   			    	error = rnh->rnh_walktree(rnh,
>


From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:03:43 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 592CC1C9;
 Fri, 12 Jul 2013 22:03:41 +0000 (UTC)
 (envelope-from remko@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id B14A411BE;
 Fri, 12 Jul 2013 22:03:41 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CM3f3V065384;
 Fri, 12 Jul 2013 22:03:41 GMT (envelope-from remko@svn.freebsd.org)
Received: (from remko@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CM3fUk065381;
 Fri, 12 Jul 2013 22:03:41 GMT (envelope-from remko@svn.freebsd.org)
Message-Id: <201307122203.r6CM3fUk065381@svn.freebsd.org>
From: Remko Lodder 
Date: Fri, 12 Jul 2013 22:03:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253292 - in stable/9/sys/dev/usb: . serial
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:03:43 -0000

Author: remko
Date: Fri Jul 12 22:03:41 2013
New Revision: 253292
URL: http://svnweb.freebsd.org/changeset/base/253292

Log:
  MFC r252294 and r252295:
  
  Add support for the NTT Docomo L-02C Card
  
  PR:		180017
  Submitted by:	Masaharu FUJITA
  Glanced at by:	imp
  Approved by:	re (delphij)

Modified:
  stable/9/sys/dev/usb/serial/u3g.c
  stable/9/sys/dev/usb/usbdevs

Modified: stable/9/sys/dev/usb/serial/u3g.c
==============================================================================
--- stable/9/sys/dev/usb/serial/u3g.c	Fri Jul 12 22:02:35 2013	(r253291)
+++ stable/9/sys/dev/usb/serial/u3g.c	Fri Jul 12 22:03:41 2013	(r253292)
@@ -391,6 +391,7 @@ static const STRUCT_USB_HOST_ID u3g_devs
 	U3G_DEV(QISDA, H20_2, 0),
 	U3G_DEV(QISDA, H21_1, 0),
 	U3G_DEV(QISDA, H21_2, 0),
+	U3G_DEV(QUALCOMM, NTT_L02C_MODEM, U3GINIT_SCSIEJECT),
 	U3G_DEV(QUALCOMM2, AC8700, 0),
 	U3G_DEV(QUALCOMM2, MF330, 0),
 	U3G_DEV(QUALCOMM2, SIM5218, 0),

Modified: stable/9/sys/dev/usb/usbdevs
==============================================================================
--- stable/9/sys/dev/usb/usbdevs	Fri Jul 12 22:02:35 2013	(r253291)
+++ stable/9/sys/dev/usb/usbdevs	Fri Jul 12 22:03:41 2013	(r253292)
@@ -3363,6 +3363,8 @@ product QISDA H20_2		0x4519	3G modem
 
 /* Qualcomm products */
 product QUALCOMM CDMA_MSM	0x6000	CDMA Technologies MSM phone
+product QUALCOMM NTT_L02C_MODEM	0x618f	NTT DOCOMO L-02C
+product QUALCOMM NTT_L02C_STORAGE	0x61dd	NTT DOCOMO L-02C
 product QUALCOMM2 MF330		0x6613	MF330
 product QUALCOMM2 RWT_FCT	0x3100	RWT FCT-CDMA 2000 1xRTT modem
 product QUALCOMM2 CDMA_MSM	0x3196	CDMA Technologies MSM modem

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:03:47 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 620C0268;
 Fri, 12 Jul 2013 22:03:47 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 3B8B011C0;
 Fri, 12 Jul 2013 22:03:47 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CM3lk0065435;
 Fri, 12 Jul 2013 22:03:47 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CM3kBY065433;
 Fri, 12 Jul 2013 22:03:46 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307122203.r6CM3kBY065433@svn.freebsd.org>
From: Jim Harris 
Date: Fri, 12 Jul 2013 22:03:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253293 - stable/9/share/man/man4
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:03:47 -0000

Author: jimharris
Date: Fri Jul 12 22:03:46 2013
New Revision: 253293
URL: http://svnweb.freebsd.org/changeset/base/253293

Log:
  MFC r253111:
  
  Update nvme(4) and nvd(4) to reflect recent work and upcoming inclusion
  in 9.2 release.
  
  Approved by:	re (kib)

Modified:
  stable/9/share/man/man4/nvd.4
  stable/9/share/man/man4/nvme.4
Directory Properties:
  stable/9/share/man/man4/   (props changed)

Modified: stable/9/share/man/man4/nvd.4
==============================================================================
--- stable/9/share/man/man4/nvd.4	Fri Jul 12 22:03:41 2013	(r253292)
+++ stable/9/share/man/man4/nvd.4	Fri Jul 12 22:03:46 2013	(r253293)
@@ -1,5 +1,5 @@
 .\"
-.\" Copyright (c) 2012 Intel Corporation
+.\" Copyright (c) 2012-2013 Intel Corporation
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -66,6 +66,11 @@ I/O commands.
 .Xr nvme 4 ,
 .Xr nvmecontrol 8 ,
 .Xr disk 9 .
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Fx 9.2.
 .Sh AUTHORS
 .An -nosplit
 The
@@ -76,15 +81,3 @@ with contributions from Joe Golio at EMC
 .Pp
 This man page was written by
 .An Jim Harris Aq jimharris@FreeBSD.org .
-.Sh BUGS
-The
-.Nm
-driver is considered experimental.
-Development and testing have been primarily focused on amd64.
-The following areas of development and testing are in progress:
-.Bl -bullet
-.It
-testing on i386
-.It
-command timeout error handling
-.El

Modified: stable/9/share/man/man4/nvme.4
==============================================================================
--- stable/9/share/man/man4/nvme.4	Fri Jul 12 22:03:41 2013	(r253292)
+++ stable/9/share/man/man4/nvme.4	Fri Jul 12 22:03:46 2013	(r253293)
@@ -1,5 +1,5 @@
 .\"
-.\" Copyright (c) 2012 Intel Corporation
+.\" Copyright (c) 2012-2013 Intel Corporation
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -147,6 +147,11 @@ and completion queues to the console.
 .Xr pci 4 ,
 .Xr nvmecontrol 8 ,
 .Xr disk 9 .
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Fx 9.2.
 .Sh AUTHORS
 .An -nosplit
 The
@@ -157,19 +162,3 @@ with contributions from Joe Golio at EMC
 .Pp
 This man page was written by
 .An Jim Harris Aq jimharris@FreeBSD.org .
-.Sh BUGS
-The
-.Nm
-driver is considered experimental.
-Development and testing have been primarily focused on amd64.
-The following areas of development and testing are in progress:
-.Bl -bullet
-.It
-testing on i386
-.It
-asynchronous error reporting
-.It
-command timeout error handling
-.It
-controller-level resets
-.El

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:05:17 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 99205504;
 Fri, 12 Jul 2013 22:05:17 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8B16811CE;
 Fri, 12 Jul 2013 22:05:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CM5HJ9065758;
 Fri, 12 Jul 2013 22:05:17 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CM5Hlo065756;
 Fri, 12 Jul 2013 22:05:17 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307122205.r6CM5Hlo065756@svn.freebsd.org>
From: Jim Harris 
Date: Fri, 12 Jul 2013 22:05:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253294 - stable/9/sys/dev/nvme
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:05:17 -0000

Author: jimharris
Date: Fri Jul 12 22:05:17 2013
New Revision: 253294
URL: http://svnweb.freebsd.org/changeset/base/253294

Log:
  MFC r253107:
  
    Add pci_enable_busmaster() and pci_disable_busmaster() calls in
    nvme_attach() and nvme_detach() respectively.
  
  Approved by:	re (kib)

Modified:
  stable/9/sys/dev/nvme/nvme.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/nvme/nvme.c
==============================================================================
--- stable/9/sys/dev/nvme/nvme.c	Fri Jul 12 22:03:46 2013	(r253293)
+++ stable/9/sys/dev/nvme/nvme.c	Fri Jul 12 22:05:17 2013	(r253294)
@@ -255,6 +255,8 @@ nvme_attach(device_t dev)
 
 	nvme_sysctl_initialize_ctrlr(ctrlr);
 
+	pci_enable_busmaster(dev);
+
 	ctrlr->config_hook.ich_func = nvme_ctrlr_start_config_hook;
 	ctrlr->config_hook.ich_arg = ctrlr;
 
@@ -269,6 +271,7 @@ nvme_detach (device_t dev)
 	struct nvme_controller	*ctrlr = DEVICE2SOFTC(dev);
 
 	nvme_ctrlr_destruct(ctrlr, dev);
+	pci_disable_busmaster(dev);
 	return (0);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:06:18 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 501B463B;
 Fri, 12 Jul 2013 22:06:18 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 41B5D11D7;
 Fri, 12 Jul 2013 22:06:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CM6INb065960;
 Fri, 12 Jul 2013 22:06:18 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CM6IJU065959;
 Fri, 12 Jul 2013 22:06:18 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307122206.r6CM6IJU065959@svn.freebsd.org>
From: Jim Harris 
Date: Fri, 12 Jul 2013 22:06:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253295 - stable/9/sys/dev/nvme
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:06:18 -0000

Author: jimharris
Date: Fri Jul 12 22:06:17 2013
New Revision: 253295
URL: http://svnweb.freebsd.org/changeset/base/253295

Log:
  MFC r253108:
  
    Do not retry failed async event requests.
  
  Approved by:	re (kib)

Modified:
  stable/9/sys/dev/nvme/nvme_ctrlr.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/nvme/nvme_ctrlr.c
==============================================================================
--- stable/9/sys/dev/nvme/nvme_ctrlr.c	Fri Jul 12 22:05:17 2013	(r253294)
+++ stable/9/sys/dev/nvme/nvme_ctrlr.c	Fri Jul 12 22:06:17 2013	(r253295)
@@ -649,12 +649,12 @@ nvme_ctrlr_async_event_cb(void *arg, con
 {
 	struct nvme_async_event_request	*aer = arg;
 
-	if (cpl->status.sc == NVME_SC_ABORTED_SQ_DELETION) {
+	if (nvme_completion_is_error(cpl)) {
 		/*
-		 *  This is simulated when controller is being shut down, to
-		 *  effectively abort outstanding asynchronous event requests
-		 *  and make sure all memory is freed.  Do not repost the
-		 *  request in this case.
+		 *  Do not retry failed async event requests.  This avoids
+		 *  infinite loops where a new async event request is submitted
+		 *  to replace the one just failed, only to fail again and
+		 *  perpetuate the loop.
 		 */
 		return;
 	}

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:07:35 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id A8D2A77D;
 Fri, 12 Jul 2013 22:07:35 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8A64411E2;
 Fri, 12 Jul 2013 22:07:35 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CM7Zn9066203;
 Fri, 12 Jul 2013 22:07:35 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CM7XIC066192;
 Fri, 12 Jul 2013 22:07:33 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307122207.r6CM7XIC066192@svn.freebsd.org>
From: Jim Harris 
Date: Fri, 12 Jul 2013 22:07:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253296 - in stable/9/sys/dev: nvd nvme
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:07:35 -0000

Author: jimharris
Date: Fri Jul 12 22:07:33 2013
New Revision: 253296
URL: http://svnweb.freebsd.org/changeset/base/253296

Log:
  MFC r253112:
  
    Update copyright dates.
  
  Approved by:	re (kib)

Modified:
  stable/9/sys/dev/nvd/nvd.c
  stable/9/sys/dev/nvme/nvme.c
  stable/9/sys/dev/nvme/nvme.h
  stable/9/sys/dev/nvme/nvme_ctrlr.c
  stable/9/sys/dev/nvme/nvme_ctrlr_cmd.c
  stable/9/sys/dev/nvme/nvme_ns.c
  stable/9/sys/dev/nvme/nvme_private.h
  stable/9/sys/dev/nvme/nvme_qpair.c
  stable/9/sys/dev/nvme/nvme_sysctl.c
  stable/9/sys/dev/nvme/nvme_test.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/nvd/nvd.c
==============================================================================
--- stable/9/sys/dev/nvd/nvd.c	Fri Jul 12 22:06:17 2013	(r253295)
+++ stable/9/sys/dev/nvd/nvd.c	Fri Jul 12 22:07:33 2013	(r253296)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/9/sys/dev/nvme/nvme.c
==============================================================================
--- stable/9/sys/dev/nvme/nvme.c	Fri Jul 12 22:06:17 2013	(r253295)
+++ stable/9/sys/dev/nvme/nvme.c	Fri Jul 12 22:07:33 2013	(r253296)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/9/sys/dev/nvme/nvme.h
==============================================================================
--- stable/9/sys/dev/nvme/nvme.h	Fri Jul 12 22:06:17 2013	(r253295)
+++ stable/9/sys/dev/nvme/nvme.h	Fri Jul 12 22:07:33 2013	(r253296)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/9/sys/dev/nvme/nvme_ctrlr.c
==============================================================================
--- stable/9/sys/dev/nvme/nvme_ctrlr.c	Fri Jul 12 22:06:17 2013	(r253295)
+++ stable/9/sys/dev/nvme/nvme_ctrlr.c	Fri Jul 12 22:07:33 2013	(r253296)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/9/sys/dev/nvme/nvme_ctrlr_cmd.c
==============================================================================
--- stable/9/sys/dev/nvme/nvme_ctrlr_cmd.c	Fri Jul 12 22:06:17 2013	(r253295)
+++ stable/9/sys/dev/nvme/nvme_ctrlr_cmd.c	Fri Jul 12 22:07:33 2013	(r253296)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/9/sys/dev/nvme/nvme_ns.c
==============================================================================
--- stable/9/sys/dev/nvme/nvme_ns.c	Fri Jul 12 22:06:17 2013	(r253295)
+++ stable/9/sys/dev/nvme/nvme_ns.c	Fri Jul 12 22:07:33 2013	(r253296)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/9/sys/dev/nvme/nvme_private.h
==============================================================================
--- stable/9/sys/dev/nvme/nvme_private.h	Fri Jul 12 22:06:17 2013	(r253295)
+++ stable/9/sys/dev/nvme/nvme_private.h	Fri Jul 12 22:07:33 2013	(r253296)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/9/sys/dev/nvme/nvme_qpair.c
==============================================================================
--- stable/9/sys/dev/nvme/nvme_qpair.c	Fri Jul 12 22:06:17 2013	(r253295)
+++ stable/9/sys/dev/nvme/nvme_qpair.c	Fri Jul 12 22:07:33 2013	(r253296)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/9/sys/dev/nvme/nvme_sysctl.c
==============================================================================
--- stable/9/sys/dev/nvme/nvme_sysctl.c	Fri Jul 12 22:06:17 2013	(r253295)
+++ stable/9/sys/dev/nvme/nvme_sysctl.c	Fri Jul 12 22:07:33 2013	(r253296)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: stable/9/sys/dev/nvme/nvme_test.c
==============================================================================
--- stable/9/sys/dev/nvme/nvme_test.c	Fri Jul 12 22:06:17 2013	(r253295)
+++ stable/9/sys/dev/nvme/nvme_test.c	Fri Jul 12 22:07:33 2013	(r253296)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (C) 2012 Intel Corporation
+ * Copyright (C) 2012-2013 Intel Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:08:24 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id B21FF8AC;
 Fri, 12 Jul 2013 22:08:24 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id A3C0E11E6;
 Fri, 12 Jul 2013 22:08:24 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CM8OZw066386;
 Fri, 12 Jul 2013 22:08:24 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CM8OiJ066385;
 Fri, 12 Jul 2013 22:08:24 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307122208.r6CM8OiJ066385@svn.freebsd.org>
From: Jim Harris 
Date: Fri, 12 Jul 2013 22:08:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253297 - stable/9/sys/dev/nvme
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:08:24 -0000

Author: jimharris
Date: Fri Jul 12 22:08:24 2013
New Revision: 253297
URL: http://svnweb.freebsd.org/changeset/base/253297

Log:
  MFC r253113:
  
    Add comment explaining why CACHE_LINE_SIZE is defined in nvme_private.h
    if not already defined elsewhere.
  
  Approved by:	re (kib)

Modified:
  stable/9/sys/dev/nvme/nvme_private.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/nvme/nvme_private.h
==============================================================================
--- stable/9/sys/dev/nvme/nvme_private.h	Fri Jul 12 22:07:33 2013	(r253296)
+++ stable/9/sys/dev/nvme/nvme_private.h	Fri Jul 12 22:08:24 2013	(r253297)
@@ -109,6 +109,10 @@ MALLOC_DECLARE(M_NVME);
 /* Maximum log page size to fetch for AERs. */
 #define NVME_MAX_AER_LOG_SIZE		(4096)
 
+/*
+ * Define CACHE_LINE_SIZE here for older FreeBSD versions that do not define
+ *  it.
+ */
 #ifndef CACHE_LINE_SIZE
 #define CACHE_LINE_SIZE		(64)
 #endif

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:12:50 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 66079A55;
 Fri, 12 Jul 2013 22:12:50 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 47F791210;
 Fri, 12 Jul 2013 22:12:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CMCoIn068776;
 Fri, 12 Jul 2013 22:12:50 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CMCnUc068768;
 Fri, 12 Jul 2013 22:12:49 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307122212.r6CMCnUc068768@svn.freebsd.org>
From: Jim Harris 
Date: Fri, 12 Jul 2013 22:12:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253298 - stable/9/sbin/nvmecontrol
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:12:50 -0000

Author: jimharris
Date: Fri Jul 12 22:12:48 2013
New Revision: 253298
URL: http://svnweb.freebsd.org/changeset/base/253298

Log:
  MFC r253109, r253279:
  
  r253109:
    Incorporate feedback from bde@ based on r252672 changes:
  
    * Use 0/1 instead of sysexits.  Man pages are confusing on this topic,
      but 0/1 is sufficient for nvmecontrol.
    * Use err function family where possible instead of fprintf/exit.
    * Fix some typing errors.
    * Clean up some error message inconsistencies.
  
  r253279:
    %d should be used for printing int32_t instead of %zd.
  
    clang does not complain about this - only gcc.
  
  Incorporated r253279 prior to MFC timeout because it is required for gcc
  builds.
  
  Approved by:	re (kib)

Modified:
  stable/9/sbin/nvmecontrol/devlist.c
  stable/9/sbin/nvmecontrol/firmware.c
  stable/9/sbin/nvmecontrol/identify.c
  stable/9/sbin/nvmecontrol/logpage.c
  stable/9/sbin/nvmecontrol/nvmecontrol.c
  stable/9/sbin/nvmecontrol/perftest.c
  stable/9/sbin/nvmecontrol/reset.c
Directory Properties:
  stable/9/sbin/nvmecontrol/   (props changed)

Modified: stable/9/sbin/nvmecontrol/devlist.c
==============================================================================
--- stable/9/sbin/nvmecontrol/devlist.c	Fri Jul 12 22:08:24 2013	(r253297)
+++ stable/9/sbin/nvmecontrol/devlist.c	Fri Jul 12 22:12:48 2013	(r253298)
@@ -29,13 +29,12 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "nvmecontrol.h"
@@ -45,7 +44,7 @@ devlist_usage(void)
 {
 	fprintf(stderr, "usage:\n");
 	fprintf(stderr, DEVLIST_USAGE);
-	exit(EX_USAGE);
+	exit(1);
 }
 
 static inline uint32_t
@@ -62,9 +61,7 @@ devlist(int argc, char *argv[])
 	struct nvme_namespace_data	nsdata;
 	char				name[64];
 	uint32_t			i;
-	int				ch, ctrlr, exit_code, fd, found;
-
-	exit_code = EX_OK;
+	int				ch, ctrlr, fd, found, ret;
 
 	while ((ch = getopt(argc, argv, "")) != -1) {
 		switch ((char)ch) {
@@ -80,14 +77,14 @@ devlist(int argc, char *argv[])
 		ctrlr++;
 		sprintf(name, "%s%d", NVME_CTRLR_PREFIX, ctrlr);
 
-		exit_code = open_dev(name, &fd, 0, 0);
+		ret = open_dev(name, &fd, 0, 0);
 
-		if (exit_code == EX_NOINPUT)
-			break;
-		else if (exit_code == EX_NOPERM) {
-			printf("Could not open /dev/%s, errno = %d (%s)\n",
-			    name, errno, strerror(errno));
-			continue;
+		if (ret != 0) {
+			if (fd < 0) {
+				warnx("could not open /dev/%s\n", name);
+				continue;
+			} else
+				break;
 		}
 
 		found++;
@@ -111,5 +108,5 @@ devlist(int argc, char *argv[])
 	if (found == 0)
 		printf("No NVMe controllers found.\n");
 
-	exit(EX_OK);
+	exit(1);
 }

Modified: stable/9/sbin/nvmecontrol/firmware.c
==============================================================================
--- stable/9/sbin/nvmecontrol/firmware.c	Fri Jul 12 22:08:24 2013	(r253297)
+++ stable/9/sbin/nvmecontrol/firmware.c	Fri Jul 12 22:12:48 2013	(r253298)
@@ -36,14 +36,14 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "nvmecontrol.h"
@@ -64,60 +64,58 @@ slot_has_valid_firmware(int fd, int slot
 }
 
 static void
-read_image_file(char *path, void **buf, ssize_t *size)
+read_image_file(char *path, void **buf, int32_t *size)
 {
 	struct stat	sb;
+	int32_t		filesize;
 	int		fd;
 
 	*size = 0;
 	*buf = NULL;
 
-	if ((fd = open(path, O_RDONLY)) < 0) {
-		fprintf(stderr, "Unable to open '%s'.\n", path);
-		exit(EX_IOERR);
-	}
-	if (fstat(fd, &sb) < 0) {
-		fprintf(stderr, "Unable to stat '%s'.\n", path);
-		close(fd);
-		exit(EX_IOERR);
-	}
-	if ((*buf = malloc(sb.st_size)) == NULL) {
-		fprintf(stderr, "Unable to malloc %jd bytes.\n",
-		    sb.st_size);
-		close(fd);
-		exit(EX_IOERR);
-	}
-	if ((*size = read(fd, *buf, sb.st_size)) < 0) {
-		fprintf(stderr, "Error reading '%s', errno=%d (%s)\n",
-		    path, errno, strerror(errno));
-		close(fd);
-		exit(EX_IOERR);
-	}
-	if (*size != sb.st_size) {
-		fprintf(stderr, "Error reading '%s', "
-		    "read %zd bytes, requested %jd bytes\n",
-		    path, *size, sb.st_size);
-		close(fd);
-		exit(EX_IOERR);
-	}
+	if ((fd = open(path, O_RDONLY)) < 0)
+		err(1, "unable to open '%s'", path);
+	if (fstat(fd, &sb) < 0)
+		err(1, "unable to stat '%s'", path);
+
+	/*
+	 * The NVMe spec does not explicitly state a maximum firmware image
+	 *  size, although one can be inferred from the dword size limitation
+	 *  for the size and offset fields in the Firmware Image Download
+	 *  command.
+	 *
+	 * Technically, the max is UINT32_MAX * sizeof(uint32_t), since the
+	 *  size and offsets are specified in terms of dwords (not bytes), but
+	 *  realistically INT32_MAX is sufficient here and simplifies matters
+	 *  a bit.
+	 */
+	if (sb.st_size > INT32_MAX)
+		errx(1, "size of file '%s' is too large (%jd bytes)",
+		    path, (intmax_t)sb.st_size);
+	filesize = (int32_t)sb.st_size;
+	if ((*buf = malloc(filesize)) == NULL)
+		errx(1, "unable to malloc %d bytes", filesize);
+	if ((*size = read(fd, *buf, filesize)) < 0)
+		err(1, "error reading '%s'", path);
+	/* XXX assuming no short reads */
+	if (*size != filesize)
+		errx(1,
+		    "error reading '%s' (read %d bytes, requested %d bytes)",
+		    path, *size, filesize);
 }
 
 static void
-update_firmware(int fd, uint8_t *payload, uint32_t payload_size)
+update_firmware(int fd, uint8_t *payload, int32_t payload_size)
 {
 	struct nvme_pt_command	pt;
-	size_t			size;
+	int32_t			off, resid, size;
 	void			*chunk;
-	uint32_t		off, resid;
-	int			exit_code = EX_OK;
 
 	off = 0;
 	resid = payload_size;
 
-	if ((chunk = malloc((size_t)NVME_MAX_XFER_SIZE)) == NULL) {
-		printf("Unable to malloc %d bytes.\n", NVME_MAX_XFER_SIZE);
-		exit(EX_IOERR);
-	}
+	if ((chunk = malloc(NVME_MAX_XFER_SIZE)) == NULL)
+		errx(1, "unable to malloc %d bytes", NVME_MAX_XFER_SIZE);
 
 	while (resid > 0) {
 		size = (resid >= NVME_MAX_XFER_SIZE) ?
@@ -132,26 +130,15 @@ update_firmware(int fd, uint8_t *payload
 		pt.len = size;
 		pt.is_read = 0;
 
-		if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) {
-			printf("Firmware image download request failed. "
-			    "errno=%d (%s)\n",
-			    errno, strerror(errno));
-			exit_code = EX_IOERR;
-			break;
-		}
+		if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
+			err(1, "firmware download request failed");
 
-		if (nvme_completion_is_error(&pt.cpl)) {
-			printf("Passthrough command returned error.\n");
-			exit_code = EX_IOERR;
-			break;
-		}
+		if (nvme_completion_is_error(&pt.cpl))
+			errx(1, "firmware download request returned error");
 
 		resid -= size;
 		off += size;
 	}
-	
-	if (exit_code != EX_OK)
-		exit(exit_code);
 }
 
 static void
@@ -164,16 +151,11 @@ activate_firmware(int fd, int slot, int 
 	pt.cmd.cdw10 = (activate_action << 3) | slot;
 	pt.is_read = 0;
 
-	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) {
-		printf("Firmware activate request failed. errno=%d (%s)\n",
-		    errno, strerror(errno));
-		exit(EX_IOERR);
-	}
+	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
+		err(1, "firmware activate request failed");
 
-	if (nvme_completion_is_error(&pt.cpl)) {
-		printf("Passthrough command returned error.\n");
-		exit(EX_IOERR);
-	}
+	if (nvme_completion_is_error(&pt.cpl))
+		errx(1, "firmware activate request returned error");
 }
 
 static void
@@ -181,7 +163,7 @@ firmware_usage(void)
 {
 	fprintf(stderr, "usage:\n");
 	fprintf(stderr, FIRMWARE_USAGE);
-	exit(EX_USAGE);
+	exit(1);
 }
 
 void
@@ -192,7 +174,7 @@ firmware(int argc, char *argv[])
 	char				ch, *p, *image = NULL;
 	char				*controller = NULL, prompt[64];
 	void				*buf = NULL;
-	ssize_t				size;
+	int32_t				size = 0;
 	struct nvme_controller_data	cdata;
 
 	a_flag = s_flag = f_flag = false;
@@ -252,34 +234,24 @@ firmware(int argc, char *argv[])
 	open_dev(controller, &fd, 1, 1);
 	read_controller_data(fd, &cdata);
 
-	if (cdata.oacs.firmware == 0) {
-		fprintf(stderr, 
-		    "Controller does not support firmware "
-		    "activate/download.\n");
-		exit(EX_IOERR);
-	}
-
-	if (f_flag && slot == 1 && cdata.frmw.slot1_ro) {
-		fprintf(stderr, "Slot %d is marked as read only.\n", slot);
-		exit(EX_IOERR);
-	}
-
-	if (slot > cdata.frmw.num_slots) {
-		fprintf(stderr,
-		    "Slot %d was specified but controller only "
-		    "supports %d firmware slots.\n",
+	if (cdata.oacs.firmware == 0)
+		errx(1,
+		    "controller does not support firmware activate/download");
+
+	if (f_flag && slot == 1 && cdata.frmw.slot1_ro)
+		errx(1, "slot %d is marked as read only", slot);
+
+	if (slot > cdata.frmw.num_slots)
+		errx(1,
+		    "slot %d specified but controller only supports %d slots",
 		    slot, cdata.frmw.num_slots);
-		exit(EX_IOERR);
-	}
 
-	if (!slot_has_valid_firmware(fd, slot)) {
-		fprintf(stderr,
-		    "Slot %d does not contain valid firmware.\n"
-		    "Try 'nvmecontrol logpage -p 3 %s' to get a list "
-		    "of available firmware images.\n",
+	if (!slot_has_valid_firmware(fd, slot))
+		errx(1,
+		    "slot %d does not contain valid firmware,\n"
+		    "try 'nvmecontrol logpage -p 3 %s' to get a list "
+		    "of available images\n",
 		    slot, controller);
-		exit(EX_IOERR);
-	}
 
 	if (f_flag && a_flag)
 		printf("You are about to download and activate "
@@ -305,7 +277,7 @@ firmware(int argc, char *argv[])
 		if (strncasecmp(prompt, "yes", 3) == 0)
 			break;
 		if (strncasecmp(prompt, "no", 2) == 0)
-			exit(EX_OK);
+			exit(1);
 		printf("Please answer \"yes\" or \"no\". ");
 	}
 
@@ -331,5 +303,5 @@ firmware(int argc, char *argv[])
 	}
 
 	close(fd);
-	exit(EX_OK);
+	exit(0);
 }

Modified: stable/9/sbin/nvmecontrol/identify.c
==============================================================================
--- stable/9/sbin/nvmecontrol/identify.c	Fri Jul 12 22:08:24 2013	(r253297)
+++ stable/9/sbin/nvmecontrol/identify.c	Fri Jul 12 22:12:48 2013	(r253298)
@@ -30,13 +30,13 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "nvmecontrol.h"
@@ -139,7 +139,7 @@ identify_usage(void)
 {
 	fprintf(stderr, "usage:\n");
 	fprintf(stderr, IDENTIFY_USAGE);
-	exit(EX_USAGE);
+	exit(1);
 }
 
 static void
@@ -177,16 +177,16 @@ identify_ctrlr(int argc, char *argv[])
 			hexlength = offsetof(struct nvme_controller_data,
 			    reserved5);
 		print_hex(&cdata, hexlength);
-		exit(EX_OK);
+		exit(0);
 	}
 
 	if (verboseflag == 1) {
-		printf("-v not currently supported without -x.\n");
+		fprintf(stderr, "-v not currently supported without -x\n");
 		identify_usage();
 	}
 
 	print_controller(&cdata);
-	exit(EX_OK);
+	exit(0);
 }
 
 static void
@@ -231,10 +231,8 @@ identify_ns(int argc, char *argv[])
 	nsloc = strnstr(argv[optind], NVME_NS_PREFIX, 10);
 	if (nsloc != NULL)
 		nsid = strtol(nsloc + 2, NULL, 10);
-	if (nsloc == NULL || (nsid == 0 && errno != 0)) {
-		printf("Invalid namespace ID %s.\n", argv[optind]);
-		exit(EX_IOERR);
-	}
+	if (nsloc == NULL || (nsid == 0 && errno != 0))
+		errx(1, "invalid namespace ID '%s'", argv[optind]);
 
 	/*
 	 * We send IDENTIFY commands to the controller, not the namespace,
@@ -253,16 +251,16 @@ identify_ns(int argc, char *argv[])
 			hexlength = offsetof(struct nvme_namespace_data,
 			    reserved6);
 		print_hex(&nsdata, hexlength);
-		exit(EX_OK);
+		exit(0);
 	}
 
 	if (verboseflag == 1) {
-		printf("-v not currently supported without -x.\n");
+		fprintf(stderr, "-v not currently supported without -x\n");
 		identify_usage();
 	}
 
 	print_namespace(&nsdata);
-	exit(EX_OK);
+	exit(0);
 }
 
 void

Modified: stable/9/sbin/nvmecontrol/logpage.c
==============================================================================
--- stable/9/sbin/nvmecontrol/logpage.c	Fri Jul 12 22:08:24 2013	(r253297)
+++ stable/9/sbin/nvmecontrol/logpage.c	Fri Jul 12 22:12:48 2013	(r253298)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -41,7 +42,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "nvmecontrol.h"
@@ -52,14 +52,13 @@ __FBSDID("$FreeBSD$");
 typedef void (*print_fn_t)(void *buf, uint32_t size);
 
 static void *
-get_log_buffer(size_t size)
+get_log_buffer(uint32_t size)
 {
 	void	*buf;
 
-	if ((buf = malloc(size)) == NULL) {
-		fprintf(stderr, "Unable to malloc %zd bytes\n", size);
-		exit(EX_IOERR);
-	}
+	if ((buf = malloc(size)) == NULL)
+		errx(1, "unable to malloc %u bytes", size);
+
 	memset(buf, 0, size);
 	return (buf);
 }
@@ -79,16 +78,11 @@ read_logpage(int fd, uint8_t log_page, i
 	pt.len = payload_size;
 	pt.is_read = 1;
 
-	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) {
-		printf("Get log page request failed. errno=%d (%s)\n",
-		    errno, strerror(errno));
-		exit(EX_IOERR);
-	}
+	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
+		err(1, "get log page request failed");
 
-	if (nvme_completion_is_error(&pt.cpl)) {
-		printf("Passthrough command returned error.\n");
-		exit(EX_IOERR);
-	}
+	if (nvme_completion_is_error(&pt.cpl))
+		errx(1, "get log page request returned error");
 }
 
 static void
@@ -242,7 +236,7 @@ logpage_usage(void)
 {
 	fprintf(stderr, "usage:\n");
 	fprintf(stderr, LOGPAGE_USAGE);
-	exit(EX_USAGE);
+	exit(1);
 }
 
 void
@@ -254,7 +248,7 @@ logpage(int argc, char *argv[])
 	int				allow_ns = false;
 	char				ch, *p, *nsloc = NULL;
 	char				*cname = NULL;
-	size_t				size;
+	uint32_t			size;
 	void				*buf;
 	struct logpage_function		*f;
 	struct nvme_controller_data	cdata;
@@ -313,28 +307,20 @@ logpage(int argc, char *argv[])
 	/* If a namespace id was specified, validate it's use */
 	if (strstr(argv[optind], NVME_NS_PREFIX) != NULL) {
 		if (!allow_ns) {
-			if (log_page != NVME_LOG_HEALTH_INFORMATION) {
-				fprintf(stderr,
-				    "Namespace ID not valid for log page %d.\n",
+			if (log_page != NVME_LOG_HEALTH_INFORMATION)
+				errx(1,
+				    "log page %d valid only at controller level",
 				    log_page);
-			} else if (cdata.lpa.ns_smart == 0) {
-				fprintf(stderr,
-				    "Controller does not support per "
-				    "namespace SMART/Health information.\n");
-			}
-			close(fd);
-			exit(EX_IOERR);
+			else if (cdata.lpa.ns_smart == 0)
+				errx(1,
+				    "controller does not support per "
+				    "namespace smart/health information");
 		}
 		nsloc = strnstr(argv[optind], NVME_NS_PREFIX, 10);
 		if (nsloc != NULL)
 			nsid = strtol(nsloc + 2, NULL, 10);
-		if (nsloc == NULL || (nsid == 0 && errno != 0)) {
-			fprintf(stderr,
-			    "Invalid namespace ID %s.\n",
-			    argv[optind]);
-			close(fd);
-			exit(EX_IOERR);
-		}
+		if (nsloc == NULL || (nsid == 0 && errno != 0))
+			errx(1, "invalid namespace id '%s'", argv[optind]);
 
 		/*
 		 * User is asking for per namespace log page information
@@ -384,5 +370,5 @@ logpage(int argc, char *argv[])
 	print_fn(buf, size);
 
 	close(fd);
-	exit(EX_OK);
+	exit(0);
 }

Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c
==============================================================================
--- stable/9/sbin/nvmecontrol/nvmecontrol.c	Fri Jul 12 22:08:24 2013	(r253297)
+++ stable/9/sbin/nvmecontrol/nvmecontrol.c	Fri Jul 12 22:12:48 2013	(r253298)
@@ -32,14 +32,13 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "nvmecontrol.h"
@@ -71,7 +70,7 @@ usage(void)
 		fprintf(stderr, "%s", f->usage);
 		f++;
 	}
-	exit(EX_USAGE);
+	exit(1);
 }
 
 static void
@@ -134,16 +133,11 @@ read_controller_data(int fd, struct nvme
 	pt.len = sizeof(*cdata);
 	pt.is_read = 1;
 
-	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) {
-		printf("Identify request failed. errno=%d (%s)\n",
-		    errno, strerror(errno));
-		exit(EX_IOERR);
-	}
+	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
+		err(1, "identify request failed");
 
-	if (nvme_completion_is_error(&pt.cpl)) {
-		printf("Passthrough command returned error.\n");
-		exit(EX_IOERR);
-	}
+	if (nvme_completion_is_error(&pt.cpl))
+		errx(1, "identify request returned error");
 }
 
 void
@@ -158,16 +152,11 @@ read_namespace_data(int fd, int nsid, st
 	pt.len = sizeof(*nsdata);
 	pt.is_read = 1;
 
-	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) {
-		printf("Identify request failed. errno=%d (%s)\n",
-		    errno, strerror(errno));
-		exit(EX_IOERR);
-	}
+	if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0)
+		err(1, "identify request failed");
 
-	if (nvme_completion_is_error(&pt.cpl)) {
-		printf("Passthrough command returned error.\n");
-		exit(EX_IOERR);
-	}
+	if (nvme_completion_is_error(&pt.cpl))
+		errx(1, "identify request returned error");
 }
 
 int
@@ -178,38 +167,35 @@ open_dev(const char *str, int *fd, int s
 
 	if (!strnstr(str, NVME_CTRLR_PREFIX, strlen(NVME_CTRLR_PREFIX))) {
 		if (show_error)
-			fprintf(stderr,
-			    "Controller/namespace IDs must begin with '%s'.\n",
+			warnx("controller/namespace ids must begin with '%s'",
 			    NVME_CTRLR_PREFIX);
 		if (exit_on_error)
-			exit(EX_USAGE);
+			exit(1);
 		else
-			return (EX_USAGE);
+			return (1);
 	}
 
 	snprintf(full_path, sizeof(full_path), "/dev/%s", str);
 	if (stat(full_path, &devstat) != 0) {
 		if (show_error)
-			fprintf(stderr, "Could not stat %s. errno=%d (%s)\n",
-			    full_path, errno, strerror(errno));
+			warn("could not stat %s", full_path);
 		if (exit_on_error)
-			exit(EX_NOINPUT);
+			exit(1);
 		else
-			return (EX_NOINPUT);
+			return (1);
 	}
 
 	*fd = open(full_path, O_RDWR);
 	if (*fd < 0) {
 		if (show_error)
-			fprintf(stderr, "Could not open %s. errno=%d (%s)\n",
-			    full_path, errno, strerror(errno));
+			warn("could not open %s", full_path);
 		if (exit_on_error)
-			exit(EX_NOPERM);
+			exit(1);
 		else
-			return (EX_NOPERM);
+			return (1);
 	}
 
-	return (EX_OK);
+	return (0);
 }
 
 int

Modified: stable/9/sbin/nvmecontrol/perftest.c
==============================================================================
--- stable/9/sbin/nvmecontrol/perftest.c	Fri Jul 12 22:08:24 2013	(r253297)
+++ stable/9/sbin/nvmecontrol/perftest.c	Fri Jul 12 22:12:48 2013	(r253298)
@@ -31,14 +31,13 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "nvmecontrol.h"
@@ -72,7 +71,7 @@ perftest_usage(void)
 {
 	fprintf(stderr, "usage:\n");
 	fprintf(stderr, PERFTEST_USAGE);
-	exit(EX_USAGE);
+	exit(1);
 }
 
 void
@@ -168,14 +167,10 @@ perftest(int argc, char *argv[])
 		perftest_usage();
 
 	open_dev(argv[optind], &fd, 1, 1);
-	if (ioctl(fd, ioctl_cmd, &io_test) < 0) {
-		fprintf(stderr, "NVME_IO_TEST failed. errno=%d (%s)\n", errno,
-		    strerror(errno));
-		close(fd);
-		exit(EX_IOERR);
-	}
+	if (ioctl(fd, ioctl_cmd, &io_test) < 0)
+		err(1, "ioctl NVME_IO_TEST failed");
 
 	close(fd);
 	print_perftest(&io_test, perthread);
-	exit(EX_OK);
+	exit(0);
 }

Modified: stable/9/sbin/nvmecontrol/reset.c
==============================================================================
--- stable/9/sbin/nvmecontrol/reset.c	Fri Jul 12 22:08:24 2013	(r253297)
+++ stable/9/sbin/nvmecontrol/reset.c	Fri Jul 12 22:12:48 2013	(r253298)
@@ -30,12 +30,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "nvmecontrol.h"
@@ -45,7 +44,7 @@ reset_usage(void)
 {
 	fprintf(stderr, "usage:\n");
 	fprintf(stderr, RESET_USAGE);
-	exit(EX_USAGE);
+	exit(1);
 }
 
 void
@@ -65,11 +64,8 @@ reset(int argc, char *argv[])
 		reset_usage();
 
 	open_dev(argv[optind], &fd, 1, 1);
-	if (ioctl(fd, NVME_RESET_CONTROLLER) < 0) {
-		printf("Reset request to %s failed. errno=%d (%s)\n",
-		    argv[optind], errno, strerror(errno));
-		exit(EX_IOERR);
-	}
+	if (ioctl(fd, NVME_RESET_CONTROLLER) < 0)
+		err(1, "reset request to %s failed", argv[optind]);
 
-	exit(EX_OK);
+	exit(0);
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:13:46 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id CE3D6B9E;
 Fri, 12 Jul 2013 22:13:46 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id BFF7D121D;
 Fri, 12 Jul 2013 22:13:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CMDkf9068968;
 Fri, 12 Jul 2013 22:13:46 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CMDknq068967;
 Fri, 12 Jul 2013 22:13:46 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307122213.r6CMDknq068967@svn.freebsd.org>
From: Jim Harris 
Date: Fri, 12 Jul 2013 22:13:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253299 - stable/9/sbin/nvmecontrol
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:13:46 -0000

Author: jimharris
Date: Fri Jul 12 22:13:46 2013
New Revision: 253299
URL: http://svnweb.freebsd.org/changeset/base/253299

Log:
  MFC r253110:
  
    Try to read firmware image before prompting the user to confirm
    firmware download.  This correctly prints an error and exits for
    an incorrect firmware image name before prompting the user to
    confirm the download.
  
  Approved by:	re (kib)

Modified:
  stable/9/sbin/nvmecontrol/firmware.c
Directory Properties:
  stable/9/sbin/nvmecontrol/   (props changed)

Modified: stable/9/sbin/nvmecontrol/firmware.c
==============================================================================
--- stable/9/sbin/nvmecontrol/firmware.c	Fri Jul 12 22:12:48 2013	(r253298)
+++ stable/9/sbin/nvmecontrol/firmware.c	Fri Jul 12 22:13:46 2013	(r253299)
@@ -253,6 +253,9 @@ firmware(int argc, char *argv[])
 		    "of available images\n",
 		    slot, controller);
 
+	if (f_flag)
+		read_image_file(image, &buf, &size);
+
 	if (f_flag && a_flag)
 		printf("You are about to download and activate "
 		       "firmware image (%s) to controller %s.\n"
@@ -282,7 +285,6 @@ firmware(int argc, char *argv[])
 	}
 
 	if (f_flag) {
-		read_image_file(image, &buf, &size);
 		update_firmware(fd, buf, size);
 		if (a_flag)
 			activate_firmware(fd, slot,

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:14:58 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 66B3DDC0;
 Fri, 12 Jul 2013 22:14:58 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 57F0B122A;
 Fri, 12 Jul 2013 22:14:58 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CMEwTb069166;
 Fri, 12 Jul 2013 22:14:58 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CMEvQQ069162;
 Fri, 12 Jul 2013 22:14:57 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307122214.r6CMEvQQ069162@svn.freebsd.org>
From: Jim Harris 
Date: Fri, 12 Jul 2013 22:14:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253300 - stable/9/sbin/nvmecontrol
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:14:58 -0000

Author: jimharris
Date: Fri Jul 12 22:14:57 2013
New Revision: 253300
URL: http://svnweb.freebsd.org/changeset/base/253300

Log:
  MFC r253114:
  
    Send per-namespace logpage commands to the controller devnode, so they
    are processed as admin commands, not I/O commands.
  
    As part of this change, pull out the code for parsing a namespace node
    string into a separate function, since it is used for both identify and
    logpage commands.
  
  Approved by:	re (kib)

Modified:
  stable/9/sbin/nvmecontrol/identify.c
  stable/9/sbin/nvmecontrol/logpage.c
  stable/9/sbin/nvmecontrol/nvmecontrol.c
  stable/9/sbin/nvmecontrol/nvmecontrol.h
Directory Properties:
  stable/9/sbin/nvmecontrol/   (props changed)

Modified: stable/9/sbin/nvmecontrol/identify.c
==============================================================================
--- stable/9/sbin/nvmecontrol/identify.c	Fri Jul 12 22:13:46 2013	(r253299)
+++ stable/9/sbin/nvmecontrol/identify.c	Fri Jul 12 22:14:57 2013	(r253300)
@@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -194,7 +193,6 @@ identify_ns(int argc, char *argv[])
 {
 	struct nvme_namespace_data	nsdata;
 	char				path[64];
-	char				*nsloc;
 	int				ch, fd, hexflag = 0, hexlength, nsid;
 	int				verboseflag = 0;
 
@@ -224,22 +222,12 @@ identify_ns(int argc, char *argv[])
 	close(fd);
 
 	/*
-	 * Pull the namespace id from the string. +2 skips past the "ns" part
-	 *  of the string.  Don't search past 10 characters into the string,
-	 *  otherwise we know it is malformed.
-	 */
-	nsloc = strnstr(argv[optind], NVME_NS_PREFIX, 10);
-	if (nsloc != NULL)
-		nsid = strtol(nsloc + 2, NULL, 10);
-	if (nsloc == NULL || (nsid == 0 && errno != 0))
-		errx(1, "invalid namespace ID '%s'", argv[optind]);
-
-	/*
 	 * We send IDENTIFY commands to the controller, not the namespace,
-	 *  since it is an admin cmd.  So the path should only include the
-	 *  nvmeX part of the nvmeXnsY string.
+	 *  since it is an admin cmd.  The namespace ID will be specified in
+	 *  the IDENTIFY command itself.  So parse the namespace's device node
+	 *  string to get the controller substring and namespace ID.
 	 */
-	snprintf(path, nsloc - argv[optind] + 1, "%s", argv[optind]);
+	parse_ns_str(argv[optind], path, &nsid);
 	open_dev(path, &fd, 1, 1);
 	read_namespace_data(fd, nsid, &nsdata);
 	close(fd);

Modified: stable/9/sbin/nvmecontrol/logpage.c
==============================================================================
--- stable/9/sbin/nvmecontrol/logpage.c	Fri Jul 12 22:13:46 2013	(r253299)
+++ stable/9/sbin/nvmecontrol/logpage.c	Fri Jul 12 22:14:57 2013	(r253300)
@@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -242,12 +241,11 @@ logpage_usage(void)
 void
 logpage(int argc, char *argv[])
 {
-	int				fd, nsid, len;
+	int				fd, nsid;
 	int				log_page = 0, pageflag = false;
-	int				hexflag = false;
-	int				allow_ns = false;
-	char				ch, *p, *nsloc = NULL;
-	char				*cname = NULL;
+	int				hexflag = false, ns_specified;
+	char				ch, *p;
+	char				cname[64];
 	uint32_t			size;
 	void				*buf;
 	struct logpage_function		*f;
@@ -290,46 +288,31 @@ logpage(int argc, char *argv[])
 	if (optind >= argc)
 		logpage_usage();
 
+	if (strstr(argv[optind], NVME_NS_PREFIX) != NULL) {
+		ns_specified = true;
+		parse_ns_str(argv[optind], cname, &nsid);
+		open_dev(cname, &fd, 1, 1);
+	} else {
+		ns_specified = false;
+		nsid = NVME_GLOBAL_NAMESPACE_TAG;
+		open_dev(argv[optind], &fd, 1, 1);
+	}
+
 	/*
 	 * The log page attribtues indicate whether or not the controller
 	 * supports the SMART/Health information log page on a per
 	 * namespace basis.
 	 */
-	cname = malloc(strlen(NVME_CTRLR_PREFIX) + 2);
-	len = strlen(NVME_CTRLR_PREFIX) + 1;
-	cname = strncpy(cname, argv[optind], len);
-	open_dev(cname, &fd, 1, 1);
-	read_controller_data(fd, &cdata);
-
-	if (log_page == NVME_LOG_HEALTH_INFORMATION && cdata.lpa.ns_smart != 0)
-		allow_ns = true;
-
-	/* If a namespace id was specified, validate it's use */
-	if (strstr(argv[optind], NVME_NS_PREFIX) != NULL) {
-		if (!allow_ns) {
-			if (log_page != NVME_LOG_HEALTH_INFORMATION)
-				errx(1,
-				    "log page %d valid only at controller level",
-				    log_page);
-			else if (cdata.lpa.ns_smart == 0)
-				errx(1,
-				    "controller does not support per "
-				    "namespace smart/health information");
-		}
-		nsloc = strnstr(argv[optind], NVME_NS_PREFIX, 10);
-		if (nsloc != NULL)
-			nsid = strtol(nsloc + 2, NULL, 10);
-		if (nsloc == NULL || (nsid == 0 && errno != 0))
-			errx(1, "invalid namespace id '%s'", argv[optind]);
-
-		/*
-		 * User is asking for per namespace log page information
-		 * so close the controller and open up the namespace.
-		 */
-		close(fd);
-		open_dev(argv[optind], &fd, 1, 1);
-	} else
-		nsid = NVME_GLOBAL_NAMESPACE_TAG;
+	if (ns_specified) {
+		if (log_page != NVME_LOG_HEALTH_INFORMATION)
+			errx(1, "log page %d valid only at controller level",
+			    log_page);
+		read_controller_data(fd, &cdata);
+		if (cdata.lpa.ns_smart == 0)
+			errx(1,
+			    "controller does not support per namespace "
+			    "smart/health information");
+	}
 
 	print_fn = print_hex;
 	if (!hexflag) {

Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c
==============================================================================
--- stable/9/sbin/nvmecontrol/nvmecontrol.c	Fri Jul 12 22:13:46 2013	(r253299)
+++ stable/9/sbin/nvmecontrol/nvmecontrol.c	Fri Jul 12 22:14:57 2013	(r253300)
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -198,6 +199,29 @@ open_dev(const char *str, int *fd, int s
 	return (0);
 }
 
+void
+parse_ns_str(const char *ns_str, char *ctrlr_str, int *nsid)
+{
+	char	*nsloc;
+
+	/*
+	 * Pull the namespace id from the string. +2 skips past the "ns" part
+	 *  of the string.  Don't search past 10 characters into the string,
+	 *  otherwise we know it is malformed.
+	 */
+	nsloc = strnstr(ns_str, NVME_NS_PREFIX, 10);
+	if (nsloc != NULL)
+		*nsid = strtol(nsloc + 2, NULL, 10);
+	if (nsloc == NULL || (*nsid == 0 && errno != 0))
+		errx(1, "invalid namespace ID '%s'", ns_str);
+
+	/*
+	 * The controller string will include only the nvmX part of the
+	 *  nvmeXnsY string.
+	 */
+	snprintf(ctrlr_str, nsloc - ns_str + 1, "%s", ns_str);
+}
+
 int
 main(int argc, char *argv[])
 {

Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h
==============================================================================
--- stable/9/sbin/nvmecontrol/nvmecontrol.h	Fri Jul 12 22:13:46 2013	(r253299)
+++ stable/9/sbin/nvmecontrol/nvmecontrol.h	Fri Jul 12 22:14:57 2013	(r253300)
@@ -63,6 +63,7 @@ void logpage(int argc, char *argv[]);
 void firmware(int argc, char *argv[]);
 
 int open_dev(const char *str, int *fd, int show_error, int exit_on_error);
+void parse_ns_str(const char *ns_str, char *ctrlr_str, int *nsid);
 void read_controller_data(int fd, struct nvme_controller_data *cdata);
 void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata);
 void print_hex(void *data, uint32_t length);

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:15:50 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 948E8F15;
 Fri, 12 Jul 2013 22:15:50 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8618B1238;
 Fri, 12 Jul 2013 22:15:50 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CMFoaZ069364;
 Fri, 12 Jul 2013 22:15:50 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CMFoYM069363;
 Fri, 12 Jul 2013 22:15:50 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307122215.r6CMFoYM069363@svn.freebsd.org>
From: Jim Harris 
Date: Fri, 12 Jul 2013 22:15:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253301 - stable/9/sbin/nvmecontrol
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:15:50 -0000

Author: jimharris
Date: Fri Jul 12 22:15:50 2013
New Revision: 253301
URL: http://svnweb.freebsd.org/changeset/base/253301

Log:
  MFC r253115:
  
    Condense the output for displaying LBA formats.
  
  Approved by:	re (kib)

Modified:
  stable/9/sbin/nvmecontrol/identify.c
Directory Properties:
  stable/9/sbin/nvmecontrol/   (props changed)

Modified: stable/9/sbin/nvmecontrol/identify.c
==============================================================================
--- stable/9/sbin/nvmecontrol/identify.c	Fri Jul 12 22:14:57 2013	(r253300)
+++ stable/9/sbin/nvmecontrol/identify.c	Fri Jul 12 22:15:50 2013	(r253301)
@@ -124,13 +124,11 @@ print_namespace(struct nvme_namespace_da
 	printf("Thin Provisioning:           %s\n",
 		nsdata->nsfeat.thin_prov ? "Supported" : "Not Supported");
 	printf("Number of LBA Formats:       %d\n", nsdata->nlbaf+1);
-	printf("Current LBA Format:          LBA Format #%d\n",
+	printf("Current LBA Format:          LBA Format #%02d\n",
 		nsdata->flbas.format);
-	for (i = 0; i <= nsdata->nlbaf; i++) {
-		printf("LBA Format #%d:\n", i);
-		printf("  LBA Data Size:             %d\n",
-			1 << nsdata->lbaf[i].lbads);
-	}
+	for (i = 0; i <= nsdata->nlbaf; i++)
+		printf("LBA Format #%02d: Data Size: %5d  Metadata Size: %5d\n",
+		    i, 1 << nsdata->lbaf[i].lbads, nsdata->lbaf[i].ms);
 }
 
 static void

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:16:43 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id CF63AD9;
 Fri, 12 Jul 2013 22:16:43 +0000 (UTC)
 (envelope-from jimharris@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id C0FD0123D;
 Fri, 12 Jul 2013 22:16:43 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CMGhLx069526;
 Fri, 12 Jul 2013 22:16:43 GMT
 (envelope-from jimharris@svn.freebsd.org)
Received: (from jimharris@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CMGhtU069522;
 Fri, 12 Jul 2013 22:16:43 GMT
 (envelope-from jimharris@svn.freebsd.org)
Message-Id: <201307122216.r6CMGhtU069522@svn.freebsd.org>
From: Jim Harris 
Date: Fri, 12 Jul 2013 22:16:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r253302 - stable/9/sbin/nvmecontrol
X-SVN-Group: stable-9
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:16:43 -0000

Author: jimharris
Date: Fri Jul 12 22:16:43 2013
New Revision: 253302
URL: http://svnweb.freebsd.org/changeset/base/253302

Log:
  MFC r253116:
  
    Ensure controller or namespace node name is specified before trying to
    access it.
  
    While here, also fix the identify usage message to show the -v and -x
    parameters.
  
  Approved by:	re (kib)

Modified:
  stable/9/sbin/nvmecontrol/identify.c
  stable/9/sbin/nvmecontrol/nvmecontrol.h
Directory Properties:
  stable/9/sbin/nvmecontrol/   (props changed)

Modified: stable/9/sbin/nvmecontrol/identify.c
==============================================================================
--- stable/9/sbin/nvmecontrol/identify.c	Fri Jul 12 22:15:50 2013	(r253301)
+++ stable/9/sbin/nvmecontrol/identify.c	Fri Jul 12 22:16:43 2013	(r253302)
@@ -259,6 +259,10 @@ identify(int argc, char *argv[])
 
 	while (getopt(argc, argv, "vx") != -1) ;
 
+	/* Check that a controller or namespace was specified. */
+	if (optind >= argc)
+		identify_usage();
+
 	target = argv[optind];
 
 	optreset = 1;

Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h
==============================================================================
--- stable/9/sbin/nvmecontrol/nvmecontrol.h	Fri Jul 12 22:15:50 2013	(r253301)
+++ stable/9/sbin/nvmecontrol/nvmecontrol.h	Fri Jul 12 22:16:43 2013	(r253302)
@@ -38,7 +38,7 @@
 "       nvmecontrol devlist\n"
 
 #define IDENTIFY_USAGE							       \
-"       nvmecontrol identify \n"
+"       nvmecontrol identify [-x [-v]] \n"
 
 #define PERFTEST_USAGE							       \
 "       nvmecontrol perftest <-n num_threads> <-o read|write>\n"	       \

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 22:36:27 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id CEA077A7;
 Fri, 12 Jul 2013 22:36:27 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id BFD5C1358;
 Fri, 12 Jul 2013 22:36:27 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CMaRVP075070;
 Fri, 12 Jul 2013 22:36:27 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CMaQq4075062;
 Fri, 12 Jul 2013 22:36:26 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201307122236.r6CMaQq4075062@svn.freebsd.org>
From: Jack F Vogel 
Date: Fri, 12 Jul 2013 22:36:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253303 - in head/sys: dev/e1000 modules/em modules/igb
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 22:36:27 -0000

Author: jfv
Date: Fri Jul 12 22:36:26 2013
New Revision: 253303
URL: http://svnweb.freebsd.org/changeset/base/253303

Log:
  Change the E1000 driver option header handling to match the
  ixgbe driver. As it was, when building them as a module INET
  and INET6 are not defined. In these drivers it does not cause
  a panic, however it does result in different behavior in the
  ioctl routine when you are using a module vs static, and I
  think the behavior should be the same.
  
  MFC after: 3 days

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_lem.c
  head/sys/modules/em/Makefile
  head/sys/modules/igb/Makefile

Modified: head/sys/dev/e1000/if_em.c
==============================================================================
--- head/sys/dev/e1000/if_em.c	Fri Jul 12 22:16:43 2013	(r253302)
+++ head/sys/dev/e1000/if_em.c	Fri Jul 12 22:36:26 2013	(r253303)
@@ -32,10 +32,11 @@
 ******************************************************************************/
 /*$FreeBSD$*/
 
-#ifdef HAVE_KERNEL_OPTION_HEADERS
-#include "opt_device_polling.h"
 #include "opt_inet.h"
 #include "opt_inet6.h"
+
+#ifdef HAVE_KERNEL_OPTION_HEADERS
+#include "opt_device_polling.h"
 #endif
 
 #include 

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Fri Jul 12 22:16:43 2013	(r253302)
+++ head/sys/dev/e1000/if_igb.c	Fri Jul 12 22:36:26 2013	(r253303)
@@ -33,10 +33,11 @@
 /*$FreeBSD$*/
 
 
-#ifdef HAVE_KERNEL_OPTION_HEADERS
-#include "opt_device_polling.h"
 #include "opt_inet.h"
 #include "opt_inet6.h"
+
+#ifdef HAVE_KERNEL_OPTION_HEADERS
+#include "opt_device_polling.h"
 #include "opt_altq.h"
 #endif
 

Modified: head/sys/dev/e1000/if_lem.c
==============================================================================
--- head/sys/dev/e1000/if_lem.c	Fri Jul 12 22:16:43 2013	(r253302)
+++ head/sys/dev/e1000/if_lem.c	Fri Jul 12 22:36:26 2013	(r253303)
@@ -32,10 +32,11 @@
 ******************************************************************************/
 /*$FreeBSD$*/
 
-#ifdef HAVE_KERNEL_OPTION_HEADERS
-#include "opt_device_polling.h"
 #include "opt_inet.h"
 #include "opt_inet6.h"
+
+#ifdef HAVE_KERNEL_OPTION_HEADERS
+#include "opt_device_polling.h"
 #endif
 
 #include 

Modified: head/sys/modules/em/Makefile
==============================================================================
--- head/sys/modules/em/Makefile	Fri Jul 12 22:16:43 2013	(r253302)
+++ head/sys/modules/em/Makefile	Fri Jul 12 22:36:26 2013	(r253303)
@@ -1,7 +1,10 @@
 # $FreeBSD$
+
+.include 
+
 .PATH:  ${.CURDIR}/../../dev/e1000
 KMOD    = if_em
-SRCS    = device_if.h bus_if.h pci_if.h opt_inet.h
+SRCS    = device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h
 SRCS    += $(CORE_SRC) $(LEGACY_SRC)
 SRCS	+= $(COMMON_SHARED) $(LEGACY_SHARED) $(PCIE_SHARED)
 CORE_SRC = if_em.c e1000_osdep.c
@@ -18,4 +21,16 @@ CFLAGS += -I${.CURDIR}/../../dev/e1000
 # DEVICE_POLLING for a non-interrupt-driven method
 #CFLAGS  += -DDEVICE_POLLING
 
+.if !defined(KERNBUILDDIR)
+.if ${MK_INET_SUPPORT} != "no"
+opt_inet.h:
+	@echo "#define INET 1" > ${.TARGET}
+.endif
+
+.if ${MK_INET6_SUPPORT} != "no"
+opt_inet6.h:
+	@echo "#define INET6 1" > ${.TARGET}
+.endif
+.endif
+
 .include 

Modified: head/sys/modules/igb/Makefile
==============================================================================
--- head/sys/modules/igb/Makefile	Fri Jul 12 22:16:43 2013	(r253302)
+++ head/sys/modules/igb/Makefile	Fri Jul 12 22:36:26 2013	(r253303)
@@ -1,7 +1,10 @@
 #$FreeBSD$
+
+.include 
+
 .PATH:  ${.CURDIR}/../../dev/e1000
 KMOD    = if_igb
-SRCS    = device_if.h bus_if.h pci_if.h opt_inet.h
+SRCS    = device_if.h bus_if.h pci_if.h opt_inet.h opt_inet6.h
 SRCS    += if_igb.c $(SHARED_SRCS)
 SHARED_SRCS = e1000_api.c e1000_phy.c e1000_nvm.c e1000_mac.c e1000_manage.c
 SHARED_SRCS += e1000_80003es2lan.c e1000_82542.c e1000_82541.c e1000_82543.c
@@ -20,4 +23,16 @@ CFLAGS += -I${.CURDIR}/../../dev/e1000 -
 # ALTQ. 
 #CFLAGS  += -DIGB_LEGACY_TX
 
+.if !defined(KERNBUILDDIR)
+.if ${MK_INET_SUPPORT} != "no"
+opt_inet.h:
+	@echo "#define INET 1" > ${.TARGET}
+.endif
+
+.if ${MK_INET6_SUPPORT} != "no"
+opt_inet6.h:
+	@echo "#define INET6 1" > ${.TARGET}
+.endif
+.endif
+
 .include 

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 23:08:45 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id EABDC478;
 Fri, 12 Jul 2013 23:08:45 +0000 (UTC)
 (envelope-from bapt@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id C120F1604;
 Fri, 12 Jul 2013 23:08:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CN8jia084438;
 Fri, 12 Jul 2013 23:08:45 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CN8jZC084437;
 Fri, 12 Jul 2013 23:08:45 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201307122308.r6CN8jZC084437@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Fri, 12 Jul 2013 23:08:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253304 - head/tools/build/options
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 23:08:46 -0000

Author: bapt
Date: Fri Jul 12 23:08:44 2013
New Revision: 253304
URL: http://svnweb.freebsd.org/changeset/base/253304

Log:
  Ensure the locale is LC_ALL=C when regenerating src.conf.5
  
  MFC after:	3 days

Modified:
  head/tools/build/options/makeman

Modified: head/tools/build/options/makeman
==============================================================================
--- head/tools/build/options/makeman	Fri Jul 12 22:36:26 2013	(r253303)
+++ head/tools/build/options/makeman	Fri Jul 12 23:08:44 2013	(r253304)
@@ -3,6 +3,7 @@
 # This file is in the public domain.
 
 set -o errexit
+LC_ALL=C
 
 ident='$FreeBSD$'
 

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 23:11:17 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id E03BE5D7;
 Fri, 12 Jul 2013 23:11:17 +0000 (UTC)
 (envelope-from bapt@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id D344E161B;
 Fri, 12 Jul 2013 23:11:17 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CNBHHN086588;
 Fri, 12 Jul 2013 23:11:17 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CNBH9V086585;
 Fri, 12 Jul 2013 23:11:17 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201307122311.r6CNBH9V086585@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Fri, 12 Jul 2013 23:11:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253305 - in head: . tools/build/options
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 23:11:18 -0000

Author: bapt
Date: Fri Jul 12 23:11:17 2013
New Revision: 253305
URL: http://svnweb.freebsd.org/changeset/base/253305

Log:
  Disable building of pkg_install by default
  If people still want to have pkg_install they can specify WITH_PKGTOOLS when building world

Added:
  head/tools/build/options/WITH_PKGTOOLS
     - copied, changed from r253303, head/tools/build/options/WITHOUT_PKGTOOLS
Deleted:
  head/tools/build/options/WITHOUT_PKGTOOLS
Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Fri Jul 12 23:08:44 2013	(r253304)
+++ head/UPDATING	Fri Jul 12 23:11:17 2013	(r253305)
@@ -32,6 +32,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
 	"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
 20130709:
+	pkg_install has been disconnected from the build if you really need it
+	you should add WITH_PKGTOOLS in your src.conf(5).
+
+20130709:
 	Most of network statistics structures were changed to be able
 	keep 64-bits counters. Thus all tools, that work with networking
 	statistics, must be rebuilded (netstat(1), bsnmpd(1), etc.)

Copied and modified: head/tools/build/options/WITH_PKGTOOLS (from r253303, head/tools/build/options/WITHOUT_PKGTOOLS)
==============================================================================
--- head/tools/build/options/WITHOUT_PKGTOOLS	Fri Jul 12 22:36:26 2013	(r253303, copy source)
+++ head/tools/build/options/WITH_PKGTOOLS	Fri Jul 12 23:11:17 2013	(r253305)
@@ -1,4 +1,4 @@
 .\" $FreeBSD$
-Set to not build
+Set to build
 .Xr pkg_add 8
 and related programs.

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 23:11:38 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id E885A713;
 Fri, 12 Jul 2013 23:11:38 +0000 (UTC)
 (envelope-from adrian.chadd@gmail.com)
Received: from mail-we0-x22a.google.com (mail-we0-x22a.google.com
 [IPv6:2a00:1450:400c:c03::22a])
 by mx1.freebsd.org (Postfix) with ESMTP id DAE851623;
 Fri, 12 Jul 2013 23:11:37 +0000 (UTC)
Received: by mail-we0-f170.google.com with SMTP id w57so8662673wes.15
 for ; Fri, 12 Jul 2013 16:11:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date
 :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
 bh=9LpEtgAsF1Q3LQ6Y/k53YbSHYj5xA5d6CsHEhs+lmfg=;
 b=GPJofXN5Mjm27LwG/m2iy2SjGi3GHtZBfHT+ntLMZeVMATs5fKSgAhUvWx8XnB5xVe
 SdMwYsB1XyjSKLWeZM0uu5SEEF971nW9wluaCfrG9vF+84gvNcGF146AzpootOxjZdxW
 vLRxWKJ5Kj0eaaunXNd+6sXiS9pyDfRTxZSwXTSSdZO0qMgxIwU0XRItOOAUTn4uXLVo
 M5rbl6mkHfCeUTS+aakyG32KZJch96vHQP+gMXWsDponBI0bpPg5eCe2wfLozEv164P2
 Ey1LMOi6gFJY49VIkB2BHhkiFDUNjY3yOW9RjreaFoSzqSFtnyljMPwCNofBWo/9NWYx
 wiZw==
MIME-Version: 1.0
X-Received: by 10.180.94.67 with SMTP id da3mr2916251wib.30.1373670697071;
 Fri, 12 Jul 2013 16:11:37 -0700 (PDT)
Sender: adrian.chadd@gmail.com
Received: by 10.217.94.132 with HTTP; Fri, 12 Jul 2013 16:11:37 -0700 (PDT)
In-Reply-To: <20130712202710.GB2757@gmail.com>
References: <201307120803.r6C83ACp016523@svn.freebsd.org>
 
 
 <20130712202710.GB2757@gmail.com>
Date: Fri, 12 Jul 2013 16:11:37 -0700
X-Google-Sender-Auth: pCAzPaZDPPZ0zRceY3AEU1cj2wQ
Message-ID: 
Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt
From: Adrian Chadd 
To: Mikolaj Golub 
Content-Type: text/plain; charset=ISO-8859-1
Cc: Craig Rodrigues , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org, Marko Zec 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 23:11:39 -0000

Hah, because I forgot. I have a lot going on in my head. :-)

Anyway, my detach patch looks like its needed for detach (try doing an
ACPI suspend, see if you panic :-) .. this stuff for setting a default
context during device attach is needed but for attach, rather than
detach.


-adrian

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 23:12:37 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 9DDB484B;
 Fri, 12 Jul 2013 23:12:37 +0000 (UTC)
 (envelope-from bapt@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 8FC7B1629;
 Fri, 12 Jul 2013 23:12:37 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CNCbQF086827;
 Fri, 12 Jul 2013 23:12:37 GMT (envelope-from bapt@svn.freebsd.org)
Received: (from bapt@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CNCbpE086826;
 Fri, 12 Jul 2013 23:12:37 GMT (envelope-from bapt@svn.freebsd.org)
Message-Id: <201307122312.r6CNCbpE086826@svn.freebsd.org>
From: Baptiste Daroussin 
Date: Fri, 12 Jul 2013 23:12:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253306 - head/share/man/man5
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 23:12:37 -0000

Author: bapt
Date: Fri Jul 12 23:12:37 2013
New Revision: 253306
URL: http://svnweb.freebsd.org/changeset/base/253306

Log:
  Regenerate src.conf(5) after changing WITHOUT_PKGTOOLS to WITH_PKGTOOLS

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==============================================================================
--- head/share/man/man5/src.conf.5	Fri Jul 12 23:11:17 2013	(r253305)
+++ head/share/man/man5/src.conf.5	Fri Jul 12 23:12:37 2013	(r253306)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
-.\" from FreeBSD: head/tools/build/options/makeman 251685 2013-06-13 13:05:08Z emaste
+.\" from FreeBSD: head/tools/build/options/makeman 253304 2013-07-12 23:08:44Z bapt
 .\" $FreeBSD$
-.Dd July 3, 2013
+.Dd July 13, 2013
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -962,9 +962,9 @@ When set, it also enforces the following
 Set to not build
 .Xr pkg 1
 bootstrap tool
-.It Va WITHOUT_PKGTOOLS
-.\" from FreeBSD: head/tools/build/options/WITHOUT_PKGTOOLS 183242 2008-09-21 22:02:26Z sam
-Set to not build
+.It Va WITH_PKGTOOLS
+.\" from FreeBSD: head/tools/build/options/WITH_PKGTOOLS 253305 2013-07-12 23:11:17Z bapt
+Set to build
 .Xr pkg_add 8
 and related programs.
 .It Va WITHOUT_PMC

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 23:13:52 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 072549A5;
 Fri, 12 Jul 2013 23:13:52 +0000 (UTC)
 (envelope-from adrian.chadd@gmail.com)
Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com
 [IPv6:2a00:1450:400c:c00::231])
 by mx1.freebsd.org (Postfix) with ESMTP id EBE87163B;
 Fri, 12 Jul 2013 23:13:50 +0000 (UTC)
Received: by mail-wg0-f49.google.com with SMTP id a12so8799456wgh.16
 for ; Fri, 12 Jul 2013 16:13:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date
 :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
 bh=NcIyfHyUH3uq6vuUz2iZ9X0pFuJnCbljxEYPzBkgbTs=;
 b=ZvZB3TGZ4tySYgJqwkHWWa5N9CGq/gIl0u1OJrngWoS9Kha6s9VFU+i6zNKp4tAuMn
 a6fnDUx6H9l8Jvs+fsgcmYJM3kdhZ5PIj93bqpD8YpzfwWFEFgXaBRX6aZxNHzxkvaTy
 pEwnjBbDVmS2oJR/0fy/R0yQqa4Q+01ElKdjInNQukqtreYrDjGopLBxeH7ssNlkeJz3
 lAAtIorXpkiGSrnhkhb+LRteLLdFfNOvgKFi7HTuz/JZy5xddYUC4NclP9y4db/8oFp3
 5Hhrjek4J1r2lnpVlCpcxBXk/RSsMomGmi+Gzz8vj/sY0TlYEdtDzTzNxtxBTJcOm9gh
 bMVw==
MIME-Version: 1.0
X-Received: by 10.194.63.229 with SMTP id j5mr24773503wjs.79.1373670830107;
 Fri, 12 Jul 2013 16:13:50 -0700 (PDT)
Sender: adrian.chadd@gmail.com
Received: by 10.217.94.132 with HTTP; Fri, 12 Jul 2013 16:13:50 -0700 (PDT)
In-Reply-To: 
References: <201307120803.r6C83ACp016523@svn.freebsd.org>
 
 
 <20130712202710.GB2757@gmail.com>
 
Date: Fri, 12 Jul 2013 16:13:50 -0700
X-Google-Sender-Auth: fTwdQv2rB6Kr4626o59NCG2oKBQ
Message-ID: 
Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt
From: Adrian Chadd 
To: Mikolaj Golub 
Content-Type: text/plain; charset=ISO-8859-1
Cc: Craig Rodrigues , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org, Marko Zec 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 23:13:52 -0000

... and as a side-note, I am upgrading my test laptops to -HEAD very
slowly and I'll make sure one gets VIMAGE.

I'm sure I'll then find _all_ the odd crap with VIMAGE when used with
non-server hardware.


-adrian

From owner-svn-src-all@FreeBSD.ORG  Fri Jul 12 23:20:12 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 59A95CD4;
 Fri, 12 Jul 2013 23:20:12 +0000 (UTC)
 (envelope-from scottl@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 4BF651685;
 Fri, 12 Jul 2013 23:20:12 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6CNKCJj089237;
 Fri, 12 Jul 2013 23:20:12 GMT (envelope-from scottl@svn.freebsd.org)
Received: (from scottl@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6CNKCiN089236;
 Fri, 12 Jul 2013 23:20:12 GMT (envelope-from scottl@svn.freebsd.org)
Message-Id: <201307122320.r6CNKCiN089236@svn.freebsd.org>
From: Scott Long 
Date: Fri, 12 Jul 2013 23:20:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253307 - head/sys/cam/scsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 12 Jul 2013 23:20:12 -0000

Author: scottl
Date: Fri Jul 12 23:20:11 2013
New Revision: 253307
URL: http://svnweb.freebsd.org/changeset/base/253307

Log:
  Const-ify the new da_delete_functions.
  Remove a redundant sanity check
  
  Submitted by:	Steven Hartland
  Obtained from:	Netflix
  MFC after:	3 days

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Fri Jul 12 23:12:37 2013	(r253306)
+++ head/sys/cam/scsi/scsi_da.c	Fri Jul 12 23:20:11 2013	(r253307)
@@ -150,7 +150,7 @@ static da_delete_func_t da_delete_trim;
 static da_delete_func_t da_delete_unmap;
 static da_delete_func_t da_delete_ws;
 
-static void * da_delete_functions[] = {
+static const void * da_delete_functions[] = {
 	NULL,
 	NULL,
 	da_delete_trim,
@@ -1818,10 +1818,7 @@ dadeletemethodset(struct da_softc *softc
 
 	softc->delete_method = delete_method;
 	softc->disk->d_delmaxsize = dadeletemaxsize(softc, delete_method);
-	if (delete_method <= DA_DELETE_MAX)
-		softc->delete_func = da_delete_functions[delete_method];
-	else
-		softc->delete_func = NULL;
+	softc->delete_func = da_delete_functions[delete_method];
 
 	if (softc->delete_method > DA_DELETE_DISABLE)
 		softc->disk->d_flags |= DISKFLAG_CANDELETE;

From owner-svn-src-all@FreeBSD.ORG  Sat Jul 13 00:39:07 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id B269B941;
 Sat, 13 Jul 2013 00:39:07 +0000 (UTC)
 (envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id A4A381975;
 Sat, 13 Jul 2013 00:39:07 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6D0d7NW010746;
 Sat, 13 Jul 2013 00:39:07 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6D0d7gL010745;
 Sat, 13 Jul 2013 00:39:07 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201307130039.r6D0d7gL010745@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 13 Jul 2013 00:39:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253309 - head/sys/arm/arm
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 13 Jul 2013 00:39:07 -0000

Author: rpaulo
Date: Sat Jul 13 00:39:07 2013
New Revision: 253309
URL: http://svnweb.freebsd.org/changeset/base/253309

Log:
  Indent the "scp=... rlv=..." to make it easier to read the backtrace.

Modified:
  head/sys/arm/arm/db_trace.c

Modified: head/sys/arm/arm/db_trace.c
==============================================================================
--- head/sys/arm/arm/db_trace.c	Sat Jul 13 00:36:19 2013	(r253308)
+++ head/sys/arm/arm/db_trace.c	Sat Jul 13 00:39:07 2013	(r253309)
@@ -515,11 +515,11 @@ db_stack_trace_cmd(db_expr_t addr, db_ex
 		db_printsym(scp, DB_STGY_PROC);
 		db_printf("\n");
 #ifdef __PROG26
-		db_printf("scp=0x%08x rlv=0x%08x (", scp, frame[FR_RLV] & R15_PC);
+		db_printf("\tscp=0x%08x rlv=0x%08x (", scp, frame[FR_RLV] & R15_PC);
 		db_printsym(frame[FR_RLV] & R15_PC, DB_STGY_PROC);
 		db_printf(")\n");
 #else
-		db_printf("scp=0x%08x rlv=0x%08x (", scp, frame[FR_RLV]);
+		db_printf("\tscp=0x%08x rlv=0x%08x (", scp, frame[FR_RLV]);
 		db_printsym(frame[FR_RLV], DB_STGY_PROC);
 		db_printf(")\n");
 #endif

From owner-svn-src-all@FreeBSD.ORG  Sat Jul 13 04:25:04 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id A0460322;
 Sat, 13 Jul 2013 04:25:04 +0000 (UTC)
 (envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 82A941051;
 Sat, 13 Jul 2013 04:25:04 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6D4P4RA078647;
 Sat, 13 Jul 2013 04:25:04 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6D4P31J078644;
 Sat, 13 Jul 2013 04:25:03 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201307130425.r6D4P31J078644@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 13 Jul 2013 04:25:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253314 - head/sys/net
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 13 Jul 2013 04:25:04 -0000

Author: adrian
Date: Sat Jul 13 04:25:03 2013
New Revision: 253314
URL: http://svnweb.freebsd.org/changeset/base/253314

Log:
  Bring over some link aggregation / LACP protocol improvements and debugging
  additions.
  
  * Add some new tracing events to aid in debugging.
  * Add in a debugging mode to drop transmit and received frames, specifically
    to test whether seeing or hearing heartbeats correctly cause LACP to
    drop the port.
  * Add in (and make default) a strict LACP mode, which requires the
    heartbeat on a port to be heard before it's used.  Sometimes vendor ports
    will hang but the link layer stays up, resulting in hung traffic.
  * Add logging the number of link status flaps, again to aid in debugging
    badly behaving switch ports.
  * Calculate the lagg interface port speed as the multiple of the
    configured ports, rather than the largest.
  
  Obtained from:	Netflix
  MFC after:	2 weeks

Modified:
  head/sys/net/ieee8023ad_lacp.c
  head/sys/net/if_lagg.c
  head/sys/net/if_lagg.h

Modified: head/sys/net/ieee8023ad_lacp.c
==============================================================================
--- head/sys/net/ieee8023ad_lacp.c	Sat Jul 13 01:24:16 2013	(r253313)
+++ head/sys/net/ieee8023ad_lacp.c	Sat Jul 13 04:25:03 2013	(r253314)
@@ -188,29 +188,43 @@ static void	lacp_dprintf(const struct la
 		    __attribute__((__format__(__printf__, 2, 3)));
 
 static int lacp_debug = 0;
-SYSCTL_INT(_net, OID_AUTO, lacp_debug, CTLFLAG_RW | CTLFLAG_TUN,
+SYSCTL_NODE(_net_link_lagg, OID_AUTO, lacp, CTLFLAG_RD, 0, "ieee802.3ad");
+SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN,
     &lacp_debug, 0, "Enable LACP debug logging (1=debug, 2=trace)");
-TUNABLE_INT("net.lacp_debug", &lacp_debug);
+TUNABLE_INT("net.link.lagg.lacp.debug", &lacp_debug);
 
-#define LACP_DPRINTF(a) if (lacp_debug > 0) { lacp_dprintf a ; }
-#define LACP_TRACE(a) if (lacp_debug > 1) { lacp_dprintf(a,"%s\n",__func__); }
+/* bitmap of ports */
+static int lacp_rx_test = 0;
+static int lacp_tx_test = 0;
+SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, rxtest, CTLFLAG_RW, &lacp_rx_test, 0,
+    "RXTest");
+SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, txtest, CTLFLAG_RW, &lacp_tx_test, 0,
+    "TXTest");
+
+static int lacp_strict = 1;
+SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, strict, CTLFLAG_RW, &lacp_strict,
+    0, "Strict spec compliance");
+
+#define LACP_DPRINTF(a) if (lacp_debug & 0x01) { lacp_dprintf a ; }
+#define LACP_TRACE(a) if (lacp_debug & 0x02) { lacp_dprintf(a,"%s\n",__func__); }
+#define LACP_TPRINTF(a) if (lacp_debug & 0x04) { lacp_dprintf a ; }
 
 /*
  * partner administration variables.
  * XXX should be configurable.
  */
 
-static const struct lacp_peerinfo lacp_partner_admin = {
+static const struct lacp_peerinfo lacp_partner_admin_optimistic = {
 	.lip_systemid = { .lsi_prio = 0xffff },
 	.lip_portid = { .lpi_prio = 0xffff },
-#if 1
-	/* optimistic */
 	.lip_state = LACP_STATE_SYNC | LACP_STATE_AGGREGATION |
 	    LACP_STATE_COLLECTING | LACP_STATE_DISTRIBUTING,
-#else
-	/* pessimistic */
+};
+
+static const struct lacp_peerinfo lacp_partner_admin_strict = {
+	.lip_systemid = { .lsi_prio = 0xffff },
+	.lip_portid = { .lpi_prio = 0xffff },
 	.lip_state = 0,
-#endif
 };
 
 static const lacp_timer_func_t lacp_timer_funcs[LACP_NTIMER] = {
@@ -301,6 +315,11 @@ lacp_pdu_input(struct lacp_port *lp, str
 		lacp_dump_lacpdu(du);
 	}
 
+	if ((1 << lp->lp_ifp->if_dunit) & lacp_rx_test) {
+		LACP_TPRINTF((lp, "Dropping RX PDU\n"));
+		goto bad;
+	}
+
 	LACP_LOCK(lsc);
 	lacp_sm_rx(lp, du);
 	LACP_UNLOCK(lsc);
@@ -653,6 +672,7 @@ lacp_disable_distributing(struct lacp_po
 {
 	struct lacp_aggregator *la = lp->lp_aggregator;
 	struct lacp_softc *lsc = lp->lp_lsc;
+	struct lagg_softc *sc = lsc->lsc_softc;
 	char buf[LACP_LAGIDSTR_MAX+1];
 
 	LACP_LOCK_ASSERT(lsc);
@@ -672,6 +692,7 @@ lacp_disable_distributing(struct lacp_po
 
 	TAILQ_REMOVE(&la->la_ports, lp, lp_dist_q);
 	la->la_nports--;
+	sc->sc_active = la->la_nports;
 
 	if (lsc->lsc_active_aggregator == la) {
 		lacp_suppress_distributing(lsc, la);
@@ -688,6 +709,7 @@ lacp_enable_distributing(struct lacp_por
 {
 	struct lacp_aggregator *la = lp->lp_aggregator;
 	struct lacp_softc *lsc = lp->lp_lsc;
+	struct lagg_softc *sc = lsc->lsc_softc;
 	char buf[LACP_LAGIDSTR_MAX+1];
 
 	LACP_LOCK_ASSERT(lsc);
@@ -704,6 +726,7 @@ lacp_enable_distributing(struct lacp_por
 	KASSERT(la->la_refcnt > la->la_nports, ("aggregator refcnt invalid"));
 	TAILQ_INSERT_HEAD(&la->la_ports, lp, lp_dist_q);
 	la->la_nports++;
+	sc->sc_active = la->la_nports;
 
 	lp->lp_state |= LACP_STATE_DISTRIBUTING;
 
@@ -908,7 +931,6 @@ lacp_aggregator_bandwidth(struct lacp_ag
 static void
 lacp_select_active_aggregator(struct lacp_softc *lsc)
 {
-	struct lagg_softc *sc = lsc->lsc_softc;
 	struct lacp_aggregator *la;
 	struct lacp_aggregator *best_la = NULL;
 	uint64_t best_speed = 0;
@@ -960,7 +982,6 @@ lacp_select_active_aggregator(struct lac
 	    lacp_format_lagid_aggregator(best_la, buf, sizeof(buf))));
 
 	if (lsc->lsc_active_aggregator != best_la) {
-		sc->sc_ifp->if_baudrate = best_speed;
 		lsc->lsc_active_aggregator = best_la;
 		lacp_update_portmap(lsc);
 		if (best_la) {
@@ -976,15 +997,18 @@ lacp_select_active_aggregator(struct lac
 static void
 lacp_update_portmap(struct lacp_softc *lsc)
 {
+	struct lagg_softc *sc = lsc->lsc_softc;
 	struct lacp_aggregator *la;
 	struct lacp_portmap *p;
 	struct lacp_port *lp;
+	uint64_t speed;
 	u_int newmap;
 	int i;
 
 	newmap = lsc->lsc_activemap == 0 ? 1 : 0;
 	p = &lsc->lsc_pmap[newmap];
 	la = lsc->lsc_active_aggregator;
+	speed = 0;
 	bzero(p, sizeof(struct lacp_portmap));
 
 	if (la != NULL && la->la_nports > 0) {
@@ -993,7 +1017,9 @@ lacp_update_portmap(struct lacp_softc *l
 		TAILQ_FOREACH(lp, &la->la_ports, lp_dist_q)
 			p->pm_map[i++] = lp;
 		KASSERT(i == p->pm_count, ("Invalid port count"));
+		speed = lacp_aggregator_bandwidth(la);
 	}
+	sc->sc_ifp->if_baudrate = speed;
 
 	/* switch the active portmap over */
 	atomic_store_rel_int(&lsc->lsc_activemap, newmap);
@@ -1264,6 +1290,8 @@ lacp_unselect(struct lacp_port *lp)
 static void
 lacp_sm_mux(struct lacp_port *lp)
 {
+	struct lagg_port *lgp = lp->lp_lagg;
+	struct lagg_softc *sc = lgp->lp_softc;
 	enum lacp_mux_state new_state;
 	boolean_t p_sync =
 		    (lp->lp_partner.lip_state & LACP_STATE_SYNC) != 0;
@@ -1273,7 +1301,9 @@ lacp_sm_mux(struct lacp_port *lp)
 	struct lacp_aggregator *la;
 
 	if (lacp_debug > 1)
-		lacp_dprintf(lp, "%s: state %d\n", __func__, lp->lp_mux_state);
+		lacp_dprintf(lp, "%s: state= 0x%x, selected= 0x%x, "
+		    "p_sync= 0x%x, p_collecting= 0x%x\n", __func__,
+		    lp->lp_mux_state, selected, p_sync, p_collecting);
 
 re_eval:
 	la = lp->lp_aggregator;
@@ -1313,6 +1343,8 @@ re_eval:
 	case LACP_MUX_DISTRIBUTING:
 		if (selected != LACP_SELECTED || !p_sync || !p_collecting) {
 			new_state = LACP_MUX_COLLECTING;
+			lacp_dprintf(lp, "Interface stopped DISTRIBUTING, possible flaping\n");
+			sc->sc_flapping++;
 		}
 		break;
 	default:
@@ -1561,6 +1593,10 @@ lacp_sm_rx_record_pdu(struct lacp_port *
 		    sizeof(buf))));
 	}
 
+	/* XXX Hack, still need to implement 5.4.9 para 2,3,4 */
+	if (lacp_strict)
+		lp->lp_partner.lip_state |= LACP_STATE_SYNC;
+
 	lacp_sm_ptx_update_timeout(lp, oldpstate);
 }
 
@@ -1586,7 +1622,10 @@ lacp_sm_rx_record_default(struct lacp_po
 	LACP_TRACE(lp);
 
 	oldpstate = lp->lp_partner.lip_state;
-	lp->lp_partner = lacp_partner_admin;
+	if (lacp_strict)
+		lp->lp_partner = lacp_partner_admin_strict;
+	else
+		lp->lp_partner = lacp_partner_admin_optimistic;;
 	lp->lp_state |= LACP_STATE_DEFAULTED;
 	lacp_sm_ptx_update_timeout(lp, oldpstate);
 }
@@ -1621,7 +1660,12 @@ lacp_sm_rx_update_default_selected(struc
 
 	LACP_TRACE(lp);
 
-	lacp_sm_rx_update_selected_from_peerinfo(lp, &lacp_partner_admin);
+	if (lacp_strict)
+		lacp_sm_rx_update_selected_from_peerinfo(lp,
+		    &lacp_partner_admin_strict);
+	else
+		lacp_sm_rx_update_selected_from_peerinfo(lp,
+		    &lacp_partner_admin_optimistic);
 }
 
 /* transmit machine */
@@ -1629,7 +1673,7 @@ lacp_sm_rx_update_default_selected(struc
 static void
 lacp_sm_tx(struct lacp_port *lp)
 {
-	int error;
+	int error = 0;
 
 	if (!(lp->lp_state & LACP_STATE_AGGREGATION)
 #if 1
@@ -1651,7 +1695,10 @@ lacp_sm_tx(struct lacp_port *lp)
 		return;
 	}
 
-	error = lacp_xmit_lacpdu(lp);
+	if (((1 << lp->lp_ifp->if_dunit) & lacp_tx_test) == 0)
+		error = lacp_xmit_lacpdu(lp);
+	else
+		LACP_TPRINTF((lp, "Dropping TX PDU\n"));
 
 	if (error == 0) {
 		lp->lp_flags &= ~LACP_PORT_NTT;

Modified: head/sys/net/if_lagg.c
==============================================================================
--- head/sys/net/if_lagg.c	Sat Jul 13 01:24:16 2013	(r253313)
+++ head/sys/net/if_lagg.c	Sat Jul 13 04:25:03 2013	(r253314)
@@ -122,6 +122,7 @@ static void	lagg_media_status(struct ifn
 static struct lagg_port *lagg_link_active(struct lagg_softc *,
 	    struct lagg_port *);
 static const void *lagg_gethdr(struct mbuf *, u_int, u_int, void *);
+static int	lagg_sysctl_active(SYSCTL_HANDLER_ARGS);
 
 /* Simple round robin */
 static int	lagg_rr_attach(struct lagg_softc *);
@@ -171,7 +172,7 @@ static const struct {
 };
 
 SYSCTL_DECL(_net_link);
-static SYSCTL_NODE(_net_link, OID_AUTO, lagg, CTLFLAG_RW, 0,
+SYSCTL_NODE(_net_link, OID_AUTO, lagg, CTLFLAG_RW, 0,
     "Link Aggregation");
 
 static int lagg_failover_rx_all = 0; /* Allow input on any failover links */
@@ -298,6 +299,12 @@ lagg_clone_create(struct if_clone *ifc, 
 	SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
 		"count", CTLTYPE_INT|CTLFLAG_RD, &sc->sc_count, sc->sc_count,
 		"Total number of ports");
+	SYSCTL_ADD_PROC(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
+		"active", CTLTYPE_INT|CTLFLAG_RD, sc, 0, lagg_sysctl_active,
+		"I", "Total number of active ports");
+	SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
+		"flapping", CTLTYPE_INT|CTLFLAG_RD, &sc->sc_flapping,
+		sc->sc_flapping, "Total number of port change events");
 	/* Hash all layers by default */
 	sc->sc_flags = LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4;
 
@@ -1488,6 +1495,27 @@ lagg_gethdr(struct mbuf *m, u_int off, u
 	return (mtod(m, char *) + off);
 }
 
+static int
+lagg_sysctl_active(SYSCTL_HANDLER_ARGS)
+{
+	struct lagg_softc *sc = (struct lagg_softc *)arg1;
+	struct lagg_port *lp;
+	int error;
+
+	/* LACP tracks active links automatically, the others do not */
+	if (sc->sc_proto != LAGG_PROTO_LACP) {
+		sc->sc_active = 0;
+		SLIST_FOREACH(lp, &sc->sc_ports, lp_entries)
+			sc->sc_active += LAGG_PORTACTIVE(lp);
+	}
+
+	error = sysctl_handle_int(oidp, &sc->sc_active, 0, req);
+	if ((error) || (req->newptr == NULL))
+		return (error);
+
+	return (0);
+}
+
 uint32_t
 lagg_hashmbuf(struct lagg_softc *sc, struct mbuf *m, uint32_t key)
 {

Modified: head/sys/net/if_lagg.h
==============================================================================
--- head/sys/net/if_lagg.h	Sat Jul 13 01:24:16 2013	(r253313)
+++ head/sys/net/if_lagg.h	Sat Jul 13 04:25:03 2013	(r253314)
@@ -190,6 +190,9 @@ struct lagg_softc {
 	struct rwlock			sc_mtx;
 	int				sc_proto;	/* lagg protocol */
 	u_int				sc_count;	/* number of ports */
+	u_int				sc_active;	/* active port count */
+	u_int				sc_flapping;	/* number of flapping
+							 * events */
 	struct lagg_port		*sc_primary;	/* primary port */
 	struct ifmedia			sc_media;	/* media config */
 	caddr_t				sc_psc;		/* protocol data */
@@ -266,6 +269,8 @@ extern void	(*lagg_linkstate_p)(struct i
 int		lagg_enqueue(struct ifnet *, struct mbuf *);
 uint32_t	lagg_hashmbuf(struct lagg_softc *, struct mbuf *, uint32_t);
 
+SYSCTL_DECL(_net_link_lagg);
+
 #endif /* _KERNEL */
 
 #endif /* _NET_LAGG_H */

From owner-svn-src-all@FreeBSD.ORG  Sat Jul 13 05:40:10 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id D3605E1C;
 Sat, 13 Jul 2013 05:40:10 +0000 (UTC)
 (envelope-from adrian.chadd@gmail.com)
Received: from mail-we0-x229.google.com (mail-we0-x229.google.com
 [IPv6:2a00:1450:400c:c03::229])
 by mx1.freebsd.org (Postfix) with ESMTP id AF06F11C5;
 Sat, 13 Jul 2013 05:40:09 +0000 (UTC)
Received: by mail-we0-f169.google.com with SMTP id n57so8781272wev.14
 for ; Fri, 12 Jul 2013 22:40:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date
 :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
 bh=RXarwmDKRz6RQAPWrz/drzQfP1k+IfWKRf21fLGRmWk=;
 b=pNVhoQebC/yNkUbSKCGK3q0vdsvxNXI3lD9on8bKmNzUXsZ6UoBxwB+TO0l8uH8jj3
 GinaGE+C8GNzZaTTE/94Hz0L6el52bsXj47nb69ZK3/jgiNe1eclF3Xu+JJZ9AlxL+Wx
 6oN8qMSoPpsfE1bTnlrc8z+NysEhcOlZkmBYpHtLZH7sLF6mspqMwYXT/yeQmXMpGNlS
 9OSJrJ7VW8A/G0HriOOh3y6wr/woKLNMjxfisUzAacpfaL/3unnfKOLVqp8sZlrKHeIx
 zywt6F9ed5WqveJk6q2D8gFA0x/nKpRvl4LiuJtfnRKk89NFW5oYDpWjXsXDeLSLYGrF
 oqCg==
MIME-Version: 1.0
X-Received: by 10.194.11.72 with SMTP id o8mr26565938wjb.0.1373694008866; Fri,
 12 Jul 2013 22:40:08 -0700 (PDT)
Sender: adrian.chadd@gmail.com
Received: by 10.217.94.132 with HTTP; Fri, 12 Jul 2013 22:40:08 -0700 (PDT)
In-Reply-To: 
References: <201307120803.r6C83ACp016523@svn.freebsd.org>
 
 
 <20130712202710.GB2757@gmail.com>
 
 
Date: Fri, 12 Jul 2013 22:40:08 -0700
X-Google-Sender-Auth: SnIWEr9djNyGJl9OCLAYUmaLH9w
Message-ID: 
Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt
From: Adrian Chadd 
To: Mikolaj Golub 
Content-Type: text/plain; charset=ISO-8859-1
Cc: Craig Rodrigues , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org, Marko Zec 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 13 Jul 2013 05:40:10 -0000

Here's what I have running on my stable/9 VIMAGE laptop.

http://people.freebsd.org/~adrian/ath/20130712-vimage-default-attach-detach.diff

How's this look to put into -HEAD?



-adrian

From owner-svn-src-all@FreeBSD.ORG  Sat Jul 13 07:16:46 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 56DB8733;
 Sat, 13 Jul 2013 07:16:46 +0000 (UTC)
 (envelope-from jhibbits@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 486FC1478;
 Sat, 13 Jul 2013 07:16:46 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6D7GkI7029096;
 Sat, 13 Jul 2013 07:16:46 GMT
 (envelope-from jhibbits@svn.freebsd.org)
Received: (from jhibbits@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6D7GkAN029095;
 Sat, 13 Jul 2013 07:16:46 GMT
 (envelope-from jhibbits@svn.freebsd.org)
Message-Id: <201307130716.r6D7GkAN029095@svn.freebsd.org>
From: Justin Hibbits 
Date: Sat, 13 Jul 2013 07:16:46 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253315 - head/sys/modules
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 13 Jul 2013 07:16:46 -0000

Author: jhibbits
Date: Sat Jul 13 07:16:45 2013
New Revision: 253315
URL: http://svnweb.freebsd.org/changeset/base/253315

Log:
  Clean up the modules list for PowerPC.  powerpc64 has MACHINE_CPUARCH of
  powerpc.  While here, sort the list.

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Sat Jul 13 04:25:03 2013	(r253314)
+++ head/sys/modules/Makefile	Sat Jul 13 07:16:45 2013	(r253315)
@@ -808,23 +808,24 @@ _cardbus=	cardbus
 _cbb=		cbb
 _cfi=		cfi
 _cpufreq=	cpufreq
+.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
+_cyclic=	cyclic
+.endif
 _drm=		drm
+.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
+_dtrace=	dtrace
+.endif
 _exca=		exca
 _nvram=		powermac_nvram
 _pccard=	pccard
 _smbfs=		smbfs
 _sound=		sound
-_cyclic=	cyclic
-_dtrace=	dtrace
+.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
 _opensolaris=	opensolaris
 .endif
+.endif
 
 .if ${MACHINE_ARCH} == "powerpc64"
-.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
-_cyclic=	cyclic
-_dtrace=	dtrace
-_opensolaris=	opensolaris
-.endif
 .if ${MK_ZFS} != "no" || defined(ALL_MODULES)
 _zfs=		zfs
 .endif

From owner-svn-src-all@FreeBSD.ORG  Sat Jul 13 07:17:18 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id E7F6F864;
 Sat, 13 Jul 2013 07:17:18 +0000 (UTC)
 (envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id C01A3147B;
 Sat, 13 Jul 2013 07:17:18 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6D7HIwf029199;
 Sat, 13 Jul 2013 07:17:18 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6D7HI8N029198;
 Sat, 13 Jul 2013 07:17:18 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201307130717.r6D7HI8N029198@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 13 Jul 2013 07:17:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253316 - head/sys/conf
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 13 Jul 2013 07:17:19 -0000

Author: rpaulo
Date: Sat Jul 13 07:17:18 2013
New Revision: 253316
URL: http://svnweb.freebsd.org/changeset/base/253316

Log:
  Fix the urtwnfw definitions. We can now use urtwnfw in kernel config files.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Sat Jul 13 07:16:45 2013	(r253315)
+++ head/sys/conf/files	Sat Jul 13 07:17:18 2013	(r253316)
@@ -2329,34 +2329,34 @@ dev/usb/wlan/if_upgt.c		optional upgt
 dev/usb/wlan/if_ural.c		optional ural
 dev/usb/wlan/if_urtw.c		optional urtw
 dev/usb/wlan/if_urtwn.c		optional urtwn
-urtwnrtl8192cfwT.c		optional urtwn-rtl8192cfwT | urtwnfw	\
-	compile-with	"${AWK} -f $S/tools/fw_stub.awk urtwnrtl8192cT.fw:urtwnrtl8192cfwT -murtwnrtl8192cfwT -c${.TARGET}" \
+urtwn-rtl8192cfwT.c		optional urtwn-rtl8192cfwT | urtwnfw	\
+	compile-with	"${AWK} -f $S/tools/fw_stub.awk urtwn-rtl8192cfwT.fw:urtwn-rtl8192cfwT:111 -murtwn-rtl8192cfwT -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
-	clean		"urtwnrtl8192cfwT.c"
-urtwnrtl8192cfwT.fwo		optional urtwn-rtl8192cfwT | urtwnfw	\
-	dependency	"urtwnrtl8192cT.fw"				\
+	clean		"urtwn-rtl8192cfwT.c"
+urtwn-rtl8192cfwT.fwo		optional urtwn-rtl8192cfwT | urtwnfw	\
+	dependency	"urtwn-rtl8192cfwT.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
-	clean		"urtwnrtl8192cfwT.fwo"
-urtwnrtl8192cT.fw		optional urtwn-rtl8192cfwT | urtwnfw	\
+	clean		"urtwn-rtl8192cfwT.fwo"
+urtwn-rtl8192cfwT.fw		optional urtwn-rtl8192cfwT | urtwnfw	\
 	dependency	"$S/contrib/dev/urtwn/urtwn-rtl8192cfwT.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
-	clean		"urtwnrtl8192cT.fw"
-urtwnrtl8192cfwU.c		optional urtwn-rtl8192cfwU | urtwnfw	\
-	compile-with	"${AWK} -f $S/tools/fw_stub.awk urtwnrtl8192cU.fw:urtwnrtl8192cfwU -murtwnrtl8192cfwU -c${.TARGET}" \
+	clean		"urtwn-rtl8192cfwT.fw"
+urtwn-rtl8192cfwU.c		optional urtwn-rtl8192cfwU | urtwnfw	\
+	compile-with	"${AWK} -f $S/tools/fw_stub.awk urtwn-rtl8192cfwU.fw:urtwn-rtl8192cfwU:111 -murtwn-rtl8192cfwU -c${.TARGET}" \
 	no-implicit-rule before-depend local				\
-	clean		"urtwnrtl8192cfwU.c"
-urtwnrtl8192cfwU.fwo		optional urtwn-rtl8192cfwU | urtwnfw	\
-	dependency	"urtwnrtl8192cU.fw"				\
+	clean		"urtwn-rtl8192cfwU.c"
+urtwn-rtl8192cfwU.fwo		optional urtwn-rtl8192cfwU | urtwnfw	\
+	dependency	"urtwn-rtl8192cfwU.fw"				\
 	compile-with	"${NORMAL_FWO}"					\
 	no-implicit-rule						\
-	clean		"urtwnrtl8192cfwU.fwo"
-urtwnrtl8192cU.fw		optional urtwn-rtl8192cfwU | urtwnfw	\
+	clean		"urtwn-rtl8192cfwU.fwo"
+urtwn-rtl8192cfwU.fw		optional urtwn-rtl8192cfwU | urtwnfw	\
 	dependency	"$S/contrib/dev/urtwn/urtwn-rtl8192cfwU.fw.uu"	\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
-	clean		"urtwnrtl8192cU.fw"
+	clean		"urtwn-rtl8192cfwU.fw"
 
 dev/usb/wlan/if_zyd.c		optional zyd
 #

From owner-svn-src-all@FreeBSD.ORG  Sat Jul 13 07:31:25 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 56D7EB03;
 Sat, 13 Jul 2013 07:31:25 +0000 (UTC)
 (envelope-from to.my.trociny@gmail.com)
Received: from mail-lb0-x233.google.com (mail-lb0-x233.google.com
 [IPv6:2a00:1450:4010:c04::233])
 by mx1.freebsd.org (Postfix) with ESMTP id 1428515EF;
 Sat, 13 Jul 2013 07:31:23 +0000 (UTC)
Received: by mail-lb0-f179.google.com with SMTP id w20so8250843lbh.10
 for ; Sat, 13 Jul 2013 00:31:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=N9MIz1E9XGwqRLjEPBBxb36I0XBI3z6EHFP2S5b6KDI=;
 b=HyIzA6aVxY0y4e/IH2J9pA9E9Q4I9dMUw7qyamlGnQbdhfbDl3A7w/wtBwNP835AIB
 lm7JcKyHjl7zg3xAR9Y6AdTNwjAFFjVhktGelIX2AP8rfSBCqxGoa9E9vr5AZvar0gAv
 Z33BTn6MbcOqrT+ZuZtjUqAGkBSRTQc/WLmmIt2pN0MiM6SkG1MagYkG16COWLx0zOxE
 UcCP+VKCK9NYYNr61zfyDPrv9qe0dN0gB14uzvedokMNtVN5Z4yzcFEX/RaBS5UHsQ0m
 OI/cn4Ct3wXd9qC+4LsX70Cfvhc9Ba+DSwLD6SAYFtJwcqjj9nZCPL0UYxLKBedXr/vC
 SD7Q==
X-Received: by 10.152.115.194 with SMTP id jq2mr20626411lab.53.1373700683001; 
 Sat, 13 Jul 2013 00:31:23 -0700 (PDT)
Received: from localhost ([178.150.115.244])
 by mx.google.com with ESMTPSA id x5sm15024221lbx.8.2013.07.13.00.31.21
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Sat, 13 Jul 2013 00:31:22 -0700 (PDT)
Sender: Mikolaj Golub 
Date: Sat, 13 Jul 2013 10:31:19 +0300
From: Mikolaj Golub 
To: Adrian Chadd 
Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt
Message-ID: <20130713073118.GC2757@gmail.com>
References: <201307120803.r6C83ACp016523@svn.freebsd.org>
 
 
 <20130712202710.GB2757@gmail.com>
 
 
 
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Craig Rodrigues , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org, Marko Zec 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 13 Jul 2013 07:31:25 -0000

On Fri, Jul 12, 2013 at 10:40:08PM -0700, Adrian Chadd wrote:
> Here's what I have running on my stable/9 VIMAGE laptop.
> 
> http://people.freebsd.org/~adrian/ath/20130712-vimage-default-attach-detach.diff
> 
> How's this look to put into -HEAD?

Your patch looks similar to Marko's:

http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20121115/0824ca85/attachment.diff

Marko took your idea of setting vnet0 context in
device_probe_and_attach(), although there is no is_default_vnet check,
and I also think it is not necessary here -- just unconditionally set
vnet0 is ok.

Also, as I understand, after handling vnet context in
device_probe_and_attach(), there is no need in curvnet setting in
kldload/kldunload, and Marko removed it.

In net/if.c, similarly to you, Marko sets vnet context in if_detach(),
but also in if_free(), so this would be good to commit too (I suppose
Marko had good reasons to do this).

I can't comment the netgraph related parts of your patch as I have no
idea what is going on here. Though I think this could be committed
separately if it is needed.

-- 
Mikolaj Golub

From owner-svn-src-all@FreeBSD.ORG  Sat Jul 13 07:59:58 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id B34DDE6D;
 Sat, 13 Jul 2013 07:59:58 +0000 (UTC)
 (envelope-from crodr001@gmail.com)
Received: from mail-lb0-x236.google.com (mail-lb0-x236.google.com
 [IPv6:2a00:1450:4010:c04::236])
 by mx1.freebsd.org (Postfix) with ESMTP id 6D3551685;
 Sat, 13 Jul 2013 07:59:57 +0000 (UTC)
Received: by mail-lb0-f182.google.com with SMTP id r11so8238686lbv.13
 for ; Sat, 13 Jul 2013 00:59:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date
 :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
 bh=TSvaCYG7mzyfhQrjWN9juLdvkAyMvTOQr8Q6/65lBd4=;
 b=yHShLSvPvWNxudBfiJRkdh/k4gFe4q0yRIECNQOKkyoDED4kVhNIUDLbe7NZjQt52Q
 twaQjNLCCoKuofNRdnhEmbj2dscMioGuaqXKbaZznUeIFqoJpBnAgd+X37Afh/MHzPS/
 GNf0eGCW5kyx17kt4JAy8DjMqNY2j0Uo/oApVgwhV9imKhWaij46k1T6ZwtO0zipgx4M
 7W96CDclU+9mTrCX9u0GPrE14GMMXPIif11+KqCNlksINTXG5JQ7tMY4Ilxa2C+7fxXN
 0w+lgTbWv4sKsGAO6JG21Hr7643tW5tMH9+78HnD8h1T3tCe+Gy+EU8NC4CWqie6cDWO
 2O4w==
MIME-Version: 1.0
X-Received: by 10.152.19.194 with SMTP id h2mr21170828lae.26.1373702396146;
 Sat, 13 Jul 2013 00:59:56 -0700 (PDT)
Sender: crodr001@gmail.com
Received: by 10.112.149.38 with HTTP; Sat, 13 Jul 2013 00:59:56 -0700 (PDT)
In-Reply-To: 
References: <201307120803.r6C83ACp016523@svn.freebsd.org>
 
 
 <20130712202710.GB2757@gmail.com>
 
 
 
Date: Sat, 13 Jul 2013 00:59:56 -0700
X-Google-Sender-Auth: Q-1sNPTsD9fhAZbvW2zwdaaPbTw
Message-ID: 
Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt
From: Craig Rodrigues 
To: Adrian Chadd 
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.14
Cc: Mikolaj Golub , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org, Marko Zec 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 13 Jul 2013 07:59:58 -0000

On Fri, Jul 12, 2013 at 10:40 PM, Adrian Chadd  wrote:

> Here's what I have running on my stable/9 VIMAGE laptop.
>
>
> http://people.freebsd.org/~adrian/ath/20130712-vimage-default-attach-detach.diff
>
> How's this look to put into -HEAD?
>
>
Your patch overlaps with a patch proposed by Marko here:
http://lists.freebsd.org/pipermail/freebsd-hackers/2012-November/041120.html

Marko modified a few more places than you did in his patch, and his
kern/subr_bus.c is slightly different, but it is in the same area of code.

Are the additional places that Marko modified, like kern_linker.c necessary?

Can we come up with a combined patch between Marko's patch and your patch?
I think if a combined patch can go into HEAD, then my patch to bluetooth can
be reverted.

--
Craig

From owner-svn-src-all@FreeBSD.ORG  Sat Jul 13 08:17:56 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id 378133F0;
 Sat, 13 Jul 2013 08:17:56 +0000 (UTC) (envelope-from hrs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 28AFD16FE;
 Sat, 13 Jul 2013 08:17:56 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6D8HuBi046406;
 Sat, 13 Jul 2013 08:17:56 GMT (envelope-from hrs@svn.freebsd.org)
Received: (from hrs@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6D8Hutd046405;
 Sat, 13 Jul 2013 08:17:56 GMT (envelope-from hrs@svn.freebsd.org)
Message-Id: <201307130817.r6D8Hutd046405@svn.freebsd.org>
From: Hiroki Sato 
Date: Sat, 13 Jul 2013 08:17:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253318 - head/lib/libc/gen
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 13 Jul 2013 08:17:56 -0000

Author: hrs
Date: Sat Jul 13 08:17:55 2013
New Revision: 253318
URL: http://svnweb.freebsd.org/changeset/base/253318

Log:
  Fix mdoc syntax.
  
  Pointed out by:	joeld

Modified:
  head/lib/libc/gen/sysctl.3

Modified: head/lib/libc/gen/sysctl.3
==============================================================================
--- head/lib/libc/gen/sysctl.3	Sat Jul 13 07:22:51 2013	(r253317)
+++ head/lib/libc/gen/sysctl.3	Sat Jul 13 08:17:55 2013	(r253318)
@@ -548,13 +548,13 @@ The third level name is a protocol numbe
 The fourth level name is an address family, which may be set to 0 to
 select all address families.
 The fifth, sixth, and seventh level names are as follows:
-.Bl -column "Fifth level	" "Sixth level	" -offset indent
-.It Sy "Fifth level	Sixth level	Seventh level"
-.It "NET_RT_FLAGS	rtflags			None"
-.It "NET_RT_DUMP	None			None or fib number"
-.It "NET_RT_IFLIST	0 or if_index		None"
-.It "NET_RT_IFMALIST	0 or if_index		None"
-.It "NET_RT_IFLISTL	0 or if_index		None"
+.Bl -column -offset indent "Fifth level      Sixth level" "Seventh level"
+.It Sy "Fifth level      Sixth level" Ta Sy "Seventh level"
+.It "NET_RT_FLAGS     rtflags" Ta "None"
+.It "NET_RT_DUMP      None" Ta "None or fib number"
+.It "NET_RT_IFLIST    0 or if_index" Ta None
+.It "NET_RT_IFMALIST  0 or if_index" Ta None
+.It "NET_RT_IFLISTL   0 or if_index" Ta None
 .El
 .Pp
 The

From owner-svn-src-all@FreeBSD.ORG  Sat Jul 13 08:22:05 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 8E19A53A;
 Sat, 13 Jul 2013 08:22:05 +0000 (UTC)
 (envelope-from to.my.trociny@gmail.com)
Received: from mail-la0-x235.google.com (mail-la0-x235.google.com
 [IPv6:2a00:1450:4010:c03::235])
 by mx1.freebsd.org (Postfix) with ESMTP id 7E8A2170D;
 Sat, 13 Jul 2013 08:22:04 +0000 (UTC)
Received: by mail-la0-f53.google.com with SMTP id fs12so8360040lab.12
 for ; Sat, 13 Jul 2013 01:22:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-disposition:in-reply-to:user-agent;
 bh=A4W4a+TP4z5DEE+fqSNuStCi4a2imz8L8mb0nlymRE4=;
 b=NJh76b9At5Vpl/7SEnXxeNc+e761Iyg98ZAhhJn2MErDBrmwajqtZicg2v/e53Hsr7
 zBPzrfs/UGu0hHI9QDgBJwVZ4XmHkfrk6j6m7vnlJHGfl/mZ/YbjnAeIcpS3QVaQmKVQ
 ZY0JL2spsIdx1B6RVQ+Pva9MS2QxLhRzs9k6wVbQCinlm9l0/ZA3ZzVxCjo0DNuLax6l
 llnm20fKLmYd0TYc6O5j7P/AYVkAbDC8+/33KpAVpCP0EvB/Qv/4Rjbehn2zcRHF6XPD
 3NCNNzjwO5zyMw9dD/v0SVCJrzkh4JrvbQipAFWA9oCaNTrEPKv9nLcUoltpSa7LtU2E
 s/mg==
X-Received: by 10.152.21.99 with SMTP id u3mr21393170lae.18.1373703723263;
 Sat, 13 Jul 2013 01:22:03 -0700 (PDT)
Received: from localhost ([178.150.115.244])
 by mx.google.com with ESMTPSA id am8sm15639863lac.1.2013.07.13.01.22.01
 for 
 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
 Sat, 13 Jul 2013 01:22:02 -0700 (PDT)
Sender: Mikolaj Golub 
Date: Sat, 13 Jul 2013 11:21:59 +0300
From: Mikolaj Golub 
To: Adrian Chadd 
Subject: Re: svn commit: r253314 - head/sys/net
Message-ID: <20130713082158.GD2757@gmail.com>
References: <201307130425.r6D4P31J078644@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201307130425.r6D4P31J078644@svn.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
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 13 Jul 2013 08:22:05 -0000

On Sat, Jul 13, 2013 at 04:25:03AM +0000, Adrian Chadd wrote:

> +static int
> +lagg_sysctl_active(SYSCTL_HANDLER_ARGS)
> +{
> +	struct lagg_softc *sc = (struct lagg_softc *)arg1;
> +	struct lagg_port *lp;
> +	int error;
> +
> +	/* LACP tracks active links automatically, the others do not */
> +	if (sc->sc_proto != LAGG_PROTO_LACP) {
> +		sc->sc_active = 0;
> +		SLIST_FOREACH(lp, &sc->sc_ports, lp_entries)
> +			sc->sc_active += LAGG_PORTACTIVE(lp);

Shouldn't sc be wlocked here?

> +	}
> +
> +	error = sysctl_handle_int(oidp, &sc->sc_active, 0, req);
> +	if ((error) || (req->newptr == NULL))
> +		return (error);
> +
> +	return (0);
> +}

-- 
Mikolaj Golub

From owner-svn-src-all@FreeBSD.ORG  Sat Jul 13 10:10:45 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 by hub.freebsd.org (Postfix) with ESMTP id DC92F172;
 Sat, 13 Jul 2013 10:10:45 +0000 (UTC)
 (envelope-from theraven@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id B39C31979;
 Sat, 13 Jul 2013 10:10:45 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6DAAjVp078368;
 Sat, 13 Jul 2013 10:10:45 GMT
 (envelope-from theraven@svn.freebsd.org)
Received: (from theraven@localhost)
 by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6DAAjrL078366;
 Sat, 13 Jul 2013 10:10:45 GMT
 (envelope-from theraven@svn.freebsd.org)
Message-Id: <201307131010.r6DAAjrL078366@svn.freebsd.org>
From: David Chisnall 
Date: Sat, 13 Jul 2013 10:10:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r253319 - head/lib/msun/src
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 13 Jul 2013 10:10:45 -0000

Author: theraven
Date: Sat Jul 13 10:10:45 2013
New Revision: 253319
URL: http://svnweb.freebsd.org/changeset/base/253319

Log:
  Ensure that the _Generic() macro in math.h works with qualified types.
  
  tgmath.h contains the same bugs and so should be fixed in the same way.

Modified:
  head/lib/msun/src/math.h

Modified: head/lib/msun/src/math.h
==============================================================================
--- head/lib/msun/src/math.h	Sat Jul 13 08:17:55 2013	(r253318)
+++ head/lib/msun/src/math.h	Sat Jul 13 10:10:45 2013	(r253319)
@@ -83,22 +83,31 @@ extern const union __nan_un {
 
 #if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \
     __has_extension(c_generic_selections)
-#define	__fp_type_select(x, f, d, ld) _Generic((x),     \
-	float: f(x),                                    \
-	double: d(x),                                   \
-	long double: ld(x))
+#define	__fp_type_select(x, f, d, ld) _Generic((x),			\
+    float: f(x),							\
+    double: d(x),							\
+    long double: ld(x),							\
+    volatile float: f(x),						\
+    volatile double: d(x),						\
+    volatile long double: ld(x),					\
+    volatile const float: f(x),						\
+    volatile const double: d(x),					\
+    volatile const long double: ld(x),					\
+    const float: f(x),							\
+    const double: d(x),							\
+    const long double: ld(x))
 #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
-#define	__fp_type_select(x, f, d, ld) __builtin_choose_expr(              \
-	__builtin_types_compatible_p(__typeof(x), long double), ld(x),    \
-	__builtin_choose_expr(                                            \
-	__builtin_types_compatible_p(__typeof(x), double), d(x),          \
-	__builtin_choose_expr(                                            \
-	__builtin_types_compatible_p(__typeof(x), float), f(x), (void)0)))
+#define	__fp_type_select(x, f, d, ld) __builtin_choose_expr(		\
+    __builtin_types_compatible_p(__typeof(x), long double), ld(x),	\
+    __builtin_choose_expr(						\
+    __builtin_types_compatible_p(__typeof(x), double), d(x),		\
+    __builtin_choose_expr(						\
+    __builtin_types_compatible_p(__typeof(x), float), f(x), (void)0)))
 #else
-#define	 __fp_type_select(x, f, d, ld)                         \
-	((sizeof(x) == sizeof(float)) ? f(x)                   \
-	: (sizeof(x) == sizeof(double)) ? d(x)                 \
-	: ld(x))
+#define	 __fp_type_select(x, f, d, ld)					\
+    ((sizeof(x) == sizeof(float)) ? f(x)				\
+    : (sizeof(x) == sizeof(double)) ? d(x)				\
+    : ld(x))
 #endif
 
 #define	fpclassify(x) \
@@ -189,21 +198,21 @@ int	__signbitf(float) __pure2;
 int	__signbitl(long double) __pure2;
 
 static __inline int
-__inline_isnan(double __x)
+__inline_isnan(__const double __x)
 {
 
 	return (__x != __x);
 }
 
 static __inline int
-__inline_isnanf(float __x)
+__inline_isnanf(__const float __x)
 {
 
 	return (__x != __x);
 }
 
 static __inline int
-__inline_isnanl(long double __x)
+__inline_isnanl(__const long double __x)
 {
 
 	return (__x != __x);

From owner-svn-src-all@FreeBSD.ORG  Sat Jul 13 10:31:37 2013
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by hub.freebsd.org (Postfix) with ESMTP id 0D76B5FA;
 Sat, 13 Jul 2013 10:31:37 +0000 (UTC)
 (envelope-from crodr001@gmail.com)
Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com
 [IPv6:2a00:1450:4010:c04::22f])
 by mx1.freebsd.org (Postfix) with ESMTP id A4FED1A07;
 Sat, 13 Jul 2013 10:31:35 +0000 (UTC)
Received: by mail-lb0-f175.google.com with SMTP id r10so8118243lbi.6
 for ; Sat, 13 Jul 2013 03:31:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date
 :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
 bh=aIebN9ihgd396g5PpZTY9O1VJ9Hd5PxGX2ia7Kzc2Ok=;
 b=tecVB6/u/Pe6mtwKPYeU0R7kd0Ilz3iSJgFyBiQ6fZEmkVF3o4BLBG/iMsolpJK92+
 J1slFiTMwPFJICngUo6RhdKKYF8CeHg+5cl5Gv3aqHQr4UG304mnoiGZ7NJg8DgbEIUl
 eMe9H8BBcHmDeMO5s5br35Dji9cvIJcMsilwRqR3n1onlp/3fvW5mQFQ6Pfm7e8nbPmo
 wmgW6fECq2zhAyGr4gtDXQg6oNg5zvppWYa+OpCThxoHL97+WhxQmUZ0GhZYFSX6QZxr
 wYfCEoi6ouGj7+yTKStjOad77hjKn3yT3F2Zc3b/YiSR1NwakKILrhiksAC3Et8zOgMj
 RwQw==
MIME-Version: 1.0
X-Received: by 10.112.172.35 with SMTP id az3mr20517896lbc.66.1373711494482;
 Sat, 13 Jul 2013 03:31:34 -0700 (PDT)
Sender: crodr001@gmail.com
Received: by 10.112.149.38 with HTTP; Sat, 13 Jul 2013 03:31:34 -0700 (PDT)
In-Reply-To: <20130713073118.GC2757@gmail.com>
References: <201307120803.r6C83ACp016523@svn.freebsd.org>
 
 
 <20130712202710.GB2757@gmail.com>
 
 
 
 <20130713073118.GC2757@gmail.com>
Date: Sat, 13 Jul 2013 03:31:34 -0700
X-Google-Sender-Auth: hL9t3BS55LyZ14BQ2E__5bsdN9Q
Message-ID: 
Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt
From: Craig Rodrigues 
To: Mikolaj Golub 
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.14
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 Adrian Chadd , src-committers@freebsd.org,
 Marko Zec 
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for "
 user" and " projects" \)" 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 13 Jul 2013 10:31:37 -0000

On Sat, Jul 13, 2013 at 12:31 AM, Mikolaj Golub  wrote:

>
> Your patch looks similar to Marko's:
>
>
> http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20121115/0824ca85/attachment.diff
>
>
>


> Also, as I understand, after handling vnet context in
> device_probe_and_attach(), there is no need in curvnet setting in
> kldload/kldunload, and Marko removed it.
>

I experimented with Marko's patch, and found that the kernel crashed
inside the code which initializes PF.

(kgdb) where
#0  doadump (textdump=) at
pcpu.h:234

#1  0xffffffff80923e06 in kern_reboot
(howto=260)

    at
/usr/home/rodrigc/freebsd/9/sys/kern/kern_shutdown.c:449

#2  0xffffffff80924307 in panic (fmt=0x1 
) at /usr/home/rodrigc/freebsd/9/sys/kern/kern_shutdown.c:637 #3 0xffffffff80ce9820 in trap_fatal (frame=0xc, eva=) at /usr/home/rodrigc/freebsd/9/sys/amd64/amd64/trap.c:879 #4 0xffffffff80ce9b81 in trap_pfault (frame=0xffffff8128845050, usermode=0) at /usr/home/rodrigc/freebsd/9/sys/amd64/amd64/trap.c:795 #5 0xffffffff80cea134 in trap (frame=0xffffff8128845050) at /usr/home/rodrigc/freebsd/9/sys/amd64/amd64/trap.c:463 #6 0xffffffff80cd3463 in calltrap () at /usr/home/rodrigc/freebsd/9/sys/amd64/amd64/exception.S:228 #7 0xffffffff820a0fb4 in init_zone_var () at /usr/home/rodrigc/freebsd/9/sys/modules/pf/../../contrib/pf/net/pf_ioctl.c:295 #8 0xffffffff820a34db in pf_modevent (mod=, type=, data=) at /usr/home/rodrigc/freebsd/9/sys/modules/pf/../../contrib/pf/net/pf_ioctl.c:4342 #9 0xffffffff8090ea48 in module_register_init (arg=) at /usr/home/rodrigc/freebsd/9/sys/kern/kern_module.c:123 #10 0xffffffff809069ce in linker_load_module (kldname=, modname=0xfffffe000730bc00 "pf", parent=0x0, verinfo=0x0, lfpp=0xffffff8128845958) at /usr/home/rodrigc/freebsd/9/sys/kern/kern_linker.c:237 #11 0xffffffff80907008 in kern_kldload (td=0xfffffe0007e10920, file=, ---Type to continue, or q to quit--- fileid=0xffffff81288459b4) at /usr/home/rodrigc/freebsd/9/sys/kern/kern_linker.c:1031 #12 0xffffffff80907224 in sys_kldload (td=0xfffffe0007e10920, uap=) at /usr/home/rodrigc/freebsd/9/sys/kern/kern_linker.c:1062 #13 0xffffffff80ce8fca in amd64_syscall (td=0xfffffe0007e10920, traced=0) at subr_syscall.c:135 #14 0xffffffff80cd3747 in Xfast_syscall () at /usr/home/rodrigc/freebsd/9/sys/amd64/amd64/exception.S:387 #15 0x000000080087e10c in ?? () #7 0xffffffff820a0fb4 in init_zone_var () at /usr/home/rodrigc/freebsd/9/sys/modules/pf/../../contrib/pf/net/pf_ioctl.c:295 295 { (kgdb) l 290 291 mtx_destroy(&pf_task_mtx); 292 } 293 void 294 init_zone_var(void) 295 { 296 V_pf_src_tree_pl = V_pf_rule_pl = NULL; 297 V_pf_state_pl = V_pf_state_key_pl = V_pf_state_item_pl = NULL; 298 V_pf_altq_pl = V_pf_pooladdr_pl = NULL; 299 V_pf_frent_pl = V_pf_frag_pl = V_pf_cache_pl = V_pf_cent_pl = NULL; In init_zone_var(), curthread->td_vnet was NULL. So, I don't think it is safe to remove the vnet stuff from kldload/kldunload just yet, without fixing some code in some kernel modules like PF. The other parts of the patch look OK. -- Craig From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 10:47:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A1E8C78D; Sat, 13 Jul 2013 10:47:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 938BA1A3F; Sat, 13 Jul 2013 10:47:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6DAlIJV088946; Sat, 13 Jul 2013 10:47:18 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6DAlIfi088944; Sat, 13 Jul 2013 10:47:18 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201307131047.r6DAlIfi088944@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 13 Jul 2013 10:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r253320 - in stable/9: tools/build/mk usr.sbin/authpf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 10:47:18 -0000 Author: des Date: Sat Jul 13 10:47:17 2013 New Revision: 253320 URL: http://svnweb.freebsd.org/changeset/base/253320 Log: MFH (r253138,r253258): install authpf-noip Approved by: re (delphij) Modified: stable/9/tools/build/mk/OptionalObsoleteFiles.inc stable/9/usr.sbin/authpf/Makefile Directory Properties: stable/9/tools/build/ (props changed) stable/9/usr.sbin/authpf/ (props changed) Modified: stable/9/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/9/tools/build/mk/OptionalObsoleteFiles.inc Sat Jul 13 10:10:45 2013 (r253319) +++ stable/9/tools/build/mk/OptionalObsoleteFiles.inc Sat Jul 13 10:47:17 2013 (r253320) @@ -134,7 +134,9 @@ OLD_FILES+=usr/share/man/man8/auditd.8.g .if ${MK_AUTHPF} == no OLD_FILES+=usr/sbin/authpf +OLD_FILES+=usr/sbin/authpf-noip OLD_FILES+=usr/share/man/man8/authpf.8.gz +OLD_FILES+=usr/share/man/man8/authpf-noip.8.gz .endif .if ${MK_BIND} == no Modified: stable/9/usr.sbin/authpf/Makefile ============================================================================== --- stable/9/usr.sbin/authpf/Makefile Sat Jul 13 10:10:45 2013 (r253319) +++ stable/9/usr.sbin/authpf/Makefile Sat Jul 13 10:47:17 2013 (r253320) @@ -21,4 +21,7 @@ DPADD+= ${LIBM} ${LIBMD} ${LIBUTIL} WARNS?= 3 +LINKS= ${BINDIR}/authpf ${BINDIR}/authpf-noip +MLINKS= authpf.8 authpf-noip.8 + .include From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 11:18:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9EC11EBC; Sat, 13 Jul 2013 11:18:34 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-lb0-x22b.google.com (mail-lb0-x22b.google.com [IPv6:2a00:1450:4010:c04::22b]) by mx1.freebsd.org (Postfix) with ESMTP id 5A1E11B2E; Sat, 13 Jul 2013 11:18:33 +0000 (UTC) Received: by mail-lb0-f171.google.com with SMTP id 13so8203796lba.2 for ; Sat, 13 Jul 2013 04:18:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=Moa+Yt8826etSzMwVRCHyl7jFZ4n40T00bKxslnZMs8=; b=KaegsC3tZP9zE5c+/mJ9ngxt7Ap5ouiUxObMPck3y4BK4YfYGBixVHRomIclm1ZWy5 9eMtSzJIJWKrs6emyGRLrhMp30FXYscc5xNf+NSXQfbRjrdXZM3IHxGEukBt+tOTJmzy mZNqmMqJ7Exw9WvQWBeNHcLaGYjYjzFJiTixGUyyDC1L3jVdOCU6nudSC2GvH3iZmdqd MDs0PJpAbqMPcz6x1HhJnHTp6954SwvZD0N06kiQr88X3RoSvuYFqDZaVaKrHa8CBj2I Nws0v9j/hQXqOpaNjXNyigjs/y5D331gQPdJur7svpf8smIcHWCEE/QxFympdygQFAYP NYcQ== X-Received: by 10.112.53.10 with SMTP id x10mr21092170lbo.28.1373714310633; Sat, 13 Jul 2013 04:18:30 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id e5sm15298086lbw.3.2013.07.13.04.18.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 13 Jul 2013 04:18:29 -0700 (PDT) Sender: Mikolaj Golub Date: Sat, 13 Jul 2013 14:18:26 +0300 From: Mikolaj Golub To: Craig Rodrigues Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt Message-ID: <20130713111825.GE2757@gmail.com> References: <201307120803.r6C83ACp016523@svn.freebsd.org> <20130712202710.GB2757@gmail.com> <20130713073118.GC2757@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Adrian Chadd , src-committers@freebsd.org, Marko Zec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 11:18:34 -0000 On Sat, Jul 13, 2013 at 03:31:34AM -0700, Craig Rodrigues wrote: > > I experimented with Marko's patch, and found that the kernel crashed > inside the code which initializes PF. .... > /usr/home/rodrigc/freebsd/9/sys/modules/pf/../../contrib/pf/net/pf_ioctl.c:295 > 295 { > (kgdb) l > 290 > 291 mtx_destroy(&pf_task_mtx); > 292 } > 293 void > 294 init_zone_var(void) > 295 { > 296 V_pf_src_tree_pl = V_pf_rule_pl = NULL; > 297 V_pf_state_pl = V_pf_state_key_pl = V_pf_state_item_pl = > NULL; > 298 V_pf_altq_pl = V_pf_pooladdr_pl = NULL; > 299 V_pf_frent_pl = V_pf_frag_pl = V_pf_cache_pl = V_pf_cent_pl > = NULL; > > In init_zone_var(), curthread->td_vnet was NULL. I wonder if it fails on current too? It looks this code is not there any more. I will try. > So, I don't think it is safe to remove the vnet stuff from > kldload/kldunload just yet, > without fixing some code in some kernel modules like PF. > If you have plans to merge the changes to stable then yes, I think it is safer to commit the patch without kldload/kldunload part and commit the last separately after testing (and fixing affected modules if there are). > The other parts of the patch look OK. So it works for you with your commit reverted and without Adrians' netgraph patch? -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 11:41:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C9D83494; Sat, 13 Jul 2013 11:41:05 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) by mx1.freebsd.org (Postfix) with ESMTP id 5FB1C1C20; Sat, 13 Jul 2013 11:41:04 +0000 (UTC) Received: from x23.lan (89.164.2.162) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server (TLS) id 14.2.342.3; Sat, 13 Jul 2013 13:39:50 +0200 From: Marko Zec To: Mikolaj Golub Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt Date: Sat, 13 Jul 2013 13:39:52 +0200 User-Agent: KMail/1.9.10 References: <201307120803.r6C83ACp016523@svn.freebsd.org> <20130713073118.GC2757@gmail.com> In-Reply-To: <20130713073118.GC2757@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <201307131339.52599.zec@fer.hr> X-Originating-IP: [89.164.2.162] Cc: Craig Rodrigues , svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 11:41:05 -0000 On Saturday 13 July 2013 09:31:19 Mikolaj Golub wrote: > On Fri, Jul 12, 2013 at 10:40:08PM -0700, Adrian Chadd wrote: > > Here's what I have running on my stable/9 VIMAGE laptop. > > > > http://people.freebsd.org/~adrian/ath/20130712-vimage-default-attach-de > >tach.diff > > > > How's this look to put into -HEAD? > > Your patch looks similar to Marko's: > > http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20121115/0 >824ca85/attachment.diff > > Marko took your idea of setting vnet0 context in > device_probe_and_attach(), although there is no is_default_vnet check, > and I also think it is not necessary here -- just unconditionally set > vnet0 is ok. > > Also, as I understand, after handling vnet context in > device_probe_and_attach(), there is no need in curvnet setting in > kldload/kldunload, and Marko removed it. > > In net/if.c, similarly to you, Marko sets vnet context in if_detach(), > but also in if_free(), so this would be good to commit too (I suppose > Marko had good reasons to do this). > > I can't comment the netgraph related parts of your patch as I have no > idea what is going on here. Though I think this could be committed > separately if it is needed. I fear both Adrian's and my patch fall short of addressing the issue of generic USB device attach handling in VIMAGE kernels, i.e. the patches discussed in this thread might be OK for preventing panics with ng_ubt, but what about USB ethernet or wifi devices? If I recall correctly the USB stack has a separate thread which handles device attach events, and IMO the curvnet context should be set there to cover a broader set of different devices. I might be able to find an USB ethernet device for testing next week, but ATM I don't have any piece of USB hardware I could experiment with... Marko From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 13:04:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0CFD3BA4; Sat, 13 Jul 2013 13:04:39 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F3ECD1FC0; Sat, 13 Jul 2013 13:04:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6DD4cOC029379; Sat, 13 Jul 2013 13:04:38 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6DD4cwC029378; Sat, 13 Jul 2013 13:04:38 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201307131304.r6DD4cwC029378@svn.freebsd.org> From: David Chisnall Date: Sat, 13 Jul 2013 13:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253321 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 13:04:39 -0000 Author: theraven Date: Sat Jul 13 13:04:38 2013 New Revision: 253321 URL: http://svnweb.freebsd.org/changeset/base/253321 Log: Cleaner support for type qualifiers. Submitted by: Pasi Parviainen Modified: head/lib/msun/src/math.h Modified: head/lib/msun/src/math.h ============================================================================== --- head/lib/msun/src/math.h Sat Jul 13 10:47:17 2013 (r253320) +++ head/lib/msun/src/math.h Sat Jul 13 13:04:38 2013 (r253321) @@ -83,19 +83,10 @@ extern const union __nan_un { #if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \ __has_extension(c_generic_selections) -#define __fp_type_select(x, f, d, ld) _Generic((x), \ +#define __fp_type_select(x, f, d, ld) _Generic((0,(x)), \ float: f(x), \ double: d(x), \ - long double: ld(x), \ - volatile float: f(x), \ - volatile double: d(x), \ - volatile long double: ld(x), \ - volatile const float: f(x), \ - volatile const double: d(x), \ - volatile const long double: ld(x), \ - const float: f(x), \ - const double: d(x), \ - const long double: ld(x)) + long double: ld(x)) #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) #define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \ __builtin_types_compatible_p(__typeof(x), long double), ld(x), \ From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 13:35:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0B632CF5; Sat, 13 Jul 2013 13:35:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E205910B3; Sat, 13 Jul 2013 13:35:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6DDZALs039109; Sat, 13 Jul 2013 13:35:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6DDZAQp039101; Sat, 13 Jul 2013 13:35:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307131335.r6DDZAQp039101@svn.freebsd.org> From: Alexander Motin Date: Sat, 13 Jul 2013 13:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253322 - in head/sys/cam: . scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 13:35:11 -0000 Author: mav Date: Sat Jul 13 13:35:09 2013 New Revision: 253322 URL: http://svnweb.freebsd.org/changeset/base/253322 Log: Improve handling of 0x3F/0x0E "Reported LUNs data has changed" and 0x25/0x00 "Logical unit not supported" errors. First initiates specific target rescan, second -- destroys specific LUN. That allows to automatically detect changes in list of device LUNs. This mechanism doesn't work when target is completely idle, but probably that is all what can be done without active polling. Reviewed by: ken Sponsored by: iXsystems, Inc. Modified: head/sys/cam/cam_periph.c head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Sat Jul 13 13:04:38 2013 (r253321) +++ head/sys/cam/cam_periph.c Sat Jul 13 13:35:09 2013 (r253322) @@ -75,7 +75,7 @@ static int camperiphscsistatuserror(uni int *openings, u_int32_t *relsim_flags, u_int32_t *timeout, - int *print, + u_int32_t *action, const char **action_string); static int camperiphscsisenseerror(union ccb *ccb, union ccb **orig_ccb, @@ -84,7 +84,7 @@ static int camperiphscsisenseerror(unio int *openings, u_int32_t *relsim_flags, u_int32_t *timeout, - int *print, + u_int32_t *action, const char **action_string); static int nperiph_drivers; @@ -1274,7 +1274,7 @@ static int camperiphscsistatuserror(union ccb *ccb, union ccb **orig_ccb, cam_flags camflags, u_int32_t sense_flags, int *openings, u_int32_t *relsim_flags, - u_int32_t *timeout, int *print, const char **action_string) + u_int32_t *timeout, u_int32_t *action, const char **action_string) { int error; @@ -1293,7 +1293,7 @@ camperiphscsistatuserror(union ccb *ccb, openings, relsim_flags, timeout, - print, + action, action_string); break; case SCSI_STATUS_QUEUE_FULL: @@ -1348,7 +1348,7 @@ camperiphscsistatuserror(union ccb *ccb, } *timeout = 0; error = ERESTART; - *print = 0; + *action &= ~SSQ_PRINT_SENSE; break; } /* FALLTHROUGH */ @@ -1380,7 +1380,7 @@ static int camperiphscsisenseerror(union ccb *ccb, union ccb **orig, cam_flags camflags, u_int32_t sense_flags, int *openings, u_int32_t *relsim_flags, - u_int32_t *timeout, int *print, const char **action_string) + u_int32_t *timeout, u_int32_t *action, const char **action_string) { struct cam_periph *periph; union ccb *orig_ccb = ccb; @@ -1403,7 +1403,7 @@ camperiphscsisenseerror(union ccb *ccb, * imperitive that we don't violate this assumption. */ error = ERESTART; - *print = 0; + *action &= ~SSQ_PRINT_SENSE; } else { scsi_sense_action err_action; struct ccb_getdev cgd; @@ -1575,7 +1575,7 @@ camperiphscsisenseerror(union ccb *ccb, } sense_error_done: - *print = ((err_action & SSQ_PRINT_SENSE) != 0); + *action = err_action; } return (error); } @@ -1589,32 +1589,32 @@ int cam_periph_error(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags, union ccb *save_ccb) { - union ccb *orig_ccb; + struct cam_path *newpath; + union ccb *orig_ccb, *scan_ccb; struct cam_periph *periph; const char *action_string; cam_status status; - int frozen, error, openings, print, lost_device; - int error_code, sense_key, asc, ascq; - u_int32_t relsim_flags, timeout; + int frozen, error, openings; + u_int32_t action, relsim_flags, timeout; - print = 1; + action = SSQ_PRINT_SENSE; periph = xpt_path_periph(ccb->ccb_h.path); action_string = NULL; status = ccb->ccb_h.status; frozen = (status & CAM_DEV_QFRZN) != 0; status &= CAM_STATUS_MASK; - openings = relsim_flags = timeout = lost_device = 0; + openings = relsim_flags = timeout = 0; orig_ccb = ccb; switch (status) { case CAM_REQ_CMP: error = 0; - print = 0; + action &= ~SSQ_PRINT_SENSE; break; case CAM_SCSI_STATUS_ERROR: error = camperiphscsistatuserror(ccb, &orig_ccb, camflags, sense_flags, &openings, &relsim_flags, - &timeout, &print, &action_string); + &timeout, &action, &action_string); break; case CAM_AUTOSENSE_FAIL: error = EIO; /* we have to kill the command */ @@ -1645,8 +1645,7 @@ cam_periph_error(union ccb *ccb, cam_fla /* FALLTHROUGH */ case CAM_DEV_NOT_THERE: error = ENXIO; - print = 0; - lost_device = 1; + action = SSQ_LOST; break; case CAM_REQ_INVALID: case CAM_PATH_INVALID: @@ -1677,7 +1676,7 @@ cam_periph_error(union ccb *ccb, cam_fla action_string = "Retry was blocked"; } else { error = ERESTART; - print = 0; + action &= ~SSQ_PRINT_SENSE; } break; case CAM_RESRC_UNAVAIL: @@ -1716,12 +1715,12 @@ cam_periph_error(union ccb *ccb, cam_fla if ((sense_flags & SF_PRINT_ALWAYS) || CAM_DEBUGGED(ccb->ccb_h.path, CAM_DEBUG_INFO)) - print = 1; + action |= SSQ_PRINT_SENSE; else if (sense_flags & SF_NO_PRINT) - print = 0; - if (print) + action &= ~SSQ_PRINT_SENSE; + if ((action & SSQ_PRINT_SENSE) != 0) cam_error_print(orig_ccb, CAM_ESF_ALL, CAM_EPF_ALL); - if (error != 0 && print) { + if (error != 0 && (action & SSQ_PRINT_SENSE) != 0) { if (error != ERESTART) { if (action_string == NULL) action_string = "Unretryable error"; @@ -1733,8 +1732,7 @@ cam_periph_error(union ccb *ccb, cam_fla xpt_print(ccb->ccb_h.path, "Retrying command\n"); } - if (lost_device) { - struct cam_path *newpath; + if ((action & SSQ_LOST) != 0) { lun_id_t lun_id; /* @@ -1743,10 +1741,10 @@ cam_periph_error(union ccb *ccb, cam_fla * then we only get rid of the device(s) specified by the * path in the original CCB. */ - if (status == CAM_DEV_NOT_THERE) - lun_id = xpt_path_lun_id(ccb->ccb_h.path); - else + if (status == CAM_SEL_TIMEOUT) lun_id = CAM_LUN_WILDCARD; + else + lun_id = xpt_path_lun_id(ccb->ccb_h.path); /* Should we do more if we can't create the path?? */ if (xpt_create_path(&newpath, periph, @@ -1761,12 +1759,25 @@ cam_periph_error(union ccb *ccb, cam_fla xpt_async(AC_LOST_DEVICE, newpath, NULL); xpt_free_path(newpath); } + } /* Broadcast UNIT ATTENTIONs to all periphs. */ - } else if (scsi_extract_sense_ccb(ccb, - &error_code, &sense_key, &asc, &ascq) && - sense_key == SSD_KEY_UNIT_ATTENTION) { + if ((action & SSQ_UA) != 0) xpt_async(AC_UNIT_ATTENTION, orig_ccb->ccb_h.path, orig_ccb); + + /* Rescan target on "Reported LUNs data has changed" */ + if ((action & SSQ_RESCAN) != 0) { + if (xpt_create_path(&newpath, NULL, + xpt_path_path_id(ccb->ccb_h.path), + xpt_path_target_id(ccb->ccb_h.path), + -1) == CAM_REQ_CMP) { + + scan_ccb = xpt_alloc_ccb_nowait(); + scan_ccb->ccb_h.path = newpath; + scan_ccb->ccb_h.func_code = XPT_SCAN_BUS; + scan_ccb->crcn.flags = 0; + xpt_rescan(scan_ccb); + } } /* Attempt a retry */ Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Sat Jul 13 13:04:38 2013 (r253321) +++ head/sys/cam/scsi/scsi_all.c Sat Jul 13 13:35:09 2013 (r253322) @@ -1645,7 +1645,7 @@ static struct asc_table_entry asc_table[ { SST(0x24, 0x08, SS_RDEF, /* XXX TBD */ "Invalid XCDB") }, /* DTLPWROMAEBKVF */ - { SST(0x25, 0x00, SS_FATAL | ENXIO, + { SST(0x25, 0x00, SS_FATAL | ENXIO | SSQ_LOST, "Logical unit not supported") }, /* DTLPWROMAEBKVF */ { SST(0x26, 0x00, SS_FATAL | EINVAL, @@ -2163,7 +2163,7 @@ static struct asc_table_entry asc_table[ { SST(0x3F, 0x0D, SS_RDEF, "Volume set reassigned") }, /* DTLPWROMAE */ - { SST(0x3F, 0x0E, SS_RDEF, /* XXX TBD */ + { SST(0x3F, 0x0E, SS_RDEF | SSQ_RESCAN , "Reported LUNs data has changed") }, /* DTLPWROMAEBKVF */ { SST(0x3F, 0x0F, SS_RDEF, /* XXX TBD */ @@ -3263,6 +3263,7 @@ scsi_error_action(struct ccb_scsiio *csi action |= SS_RETRY|SSQ_DECREMENT_COUNT| SSQ_PRINT_SENSE; } + action |= SSQ_UA; } } if ((action & SS_MASK) >= SS_START && Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Sat Jul 13 13:04:38 2013 (r253321) +++ head/sys/cam/scsi/scsi_all.h Sat Jul 13 13:35:09 2013 (r253322) @@ -88,6 +88,9 @@ typedef enum { * and text. */ SSQ_PRINT_SENSE = 0x0800, + SSQ_UA = 0x1000, /* Broadcast UA. */ + SSQ_RESCAN = 0x2000, /* Rescan target for LUNs. */ + SSQ_LOST = 0x4000, /* Destroy the LUNs. */ SSQ_MASK = 0xff00 } scsi_sense_action_qualifier; From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 13:48:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 375A9F9A; Sat, 13 Jul 2013 13:48:28 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com [IPv6:2a00:1450:4010:c04::229]) by mx1.freebsd.org (Postfix) with ESMTP id EAC271102; Sat, 13 Jul 2013 13:48:26 +0000 (UTC) Received: by mail-lb0-f169.google.com with SMTP id d10so8393423lbj.0 for ; Sat, 13 Jul 2013 06:48:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=NVaEAak1XwOw04ZRDQHqXXZL7tV1BRnNDT2TbdYEPt8=; b=kNYXCoMqobhQ+nwxP88jBeH5qaHsg/DEHouJ/BzagZcY8946/jJT4qm9zf5+jQ2Ckq zIzEtK9k28sxtCbz64FyxV7NJs5og/kZaV8A+wMLEyOz7gKKyfI60YieOpv6hJfa/B+O RJO8jU9lMN6Bjw+VPVeDTuwGkpe6sjrZItYsr+1voqVrtwcQHGkC3r75MiqLDUnG5BHZ WawT/+jNwvRcTLZ5SWsfLUATwl3phEtW/l87KUnMOHpypilW/ZGfivXRy1Abk4aLU1CO SRZhDB7b4woItmxdFI3vMWK/ZBA5ZVAehGsBD8KthUgw37IKaA0hPbOhmYAxRX70JguP rfpQ== X-Received: by 10.152.5.227 with SMTP id v3mr21587060lav.31.1373723305738; Sat, 13 Jul 2013 06:48:25 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id m1sm16030446lag.3.2013.07.13.06.48.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 13 Jul 2013 06:48:24 -0700 (PDT) Sender: Mikolaj Golub Date: Sat, 13 Jul 2013 16:48:20 +0300 From: Mikolaj Golub To: Marko Zec Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt Message-ID: <20130713134819.GF2757@gmail.com> References: <201307120803.r6C83ACp016523@svn.freebsd.org> <20130713073118.GC2757@gmail.com> <201307131339.52599.zec@fer.hr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201307131339.52599.zec@fer.hr> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Craig Rodrigues , svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 13:48:28 -0000 On Sat, Jul 13, 2013 at 01:39:52PM +0200, Marko Zec wrote: > I fear both Adrian's and my patch fall short of addressing the issue of > generic USB device attach handling in VIMAGE kernels, i.e. the patches > discussed in this thread might be OK for preventing panics with ng_ubt, but > what about USB ethernet or wifi devices? If I recall correctly the USB > stack has a separate thread which handles device attach events, and IMO the > curvnet context should be set there to cover a broader set of different > devices. You mean usb_process thread? But as I see it calls device_probe_and_attach() in usb_probe_and_attach(), which has vnet context properly set to the default vnet after your patch. So I beleive paths like these are fixed: http://lists.freebsd.org/pipermail/freebsd-virtualization/2009-May/000325.html http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/169991 Or do you mean something else? -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 14:18:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CFC5995E; Sat, 13 Jul 2013 14:18:08 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com [IPv6:2a00:1450:4010:c03::22e]) by mx1.freebsd.org (Postfix) with ESMTP id 8B92F11D4; Sat, 13 Jul 2013 14:18:07 +0000 (UTC) Received: by mail-la0-f46.google.com with SMTP id eg20so8488246lab.19 for ; Sat, 13 Jul 2013 07:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=MEs4mvQ2tKm1fTcY3YWj01wmvzRr1CPLU5xFXXESWX8=; b=zMHtJbuft0G86PSzU/L3ApiTGmBPdA5FSq2kPkQiR4gI3Fz8Ji5vD01x8ZmPevM4mR fVOlD4NkuARJHUFtNleoCcGGQZV15xcgHL6+FvuHuVHaSZsQueJEs46zQuQF9lz6f7/W z6x1syM3QfLlse8tRf0uz4/ADFgkM8n2quGHIm0brgjq6+ho7Q81me0ZD0iqjpT9NVWk c8i/ZXsGrUWAtbNg/1U76lkSezRijbRhIw1+YeGh6w1hSU33rC8+TPYbDdH412ZsNi9G +SKW+6cOA3YpBEvzba1qhwMeyvn6qI76r7W6lBvbB0b95i06/gjQrK+gy8vPlfonRkZH k+kg== X-Received: by 10.112.135.99 with SMTP id pr3mr20887310lbb.23.1373725086422; Sat, 13 Jul 2013 07:18:06 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id n3sm16066354lag.9.2013.07.13.07.18.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 13 Jul 2013 07:18:05 -0700 (PDT) Sender: Mikolaj Golub Date: Sat, 13 Jul 2013 17:18:03 +0300 From: Mikolaj Golub To: Craig Rodrigues Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt Message-ID: <20130713141802.GG2757@gmail.com> References: <201307120803.r6C83ACp016523@svn.freebsd.org> <20130712202710.GB2757@gmail.com> <20130713073118.GC2757@gmail.com> <20130713111825.GE2757@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130713111825.GE2757@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Adrian Chadd , src-committers@freebsd.org, Marko Zec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 14:18:08 -0000 On Sat, Jul 13, 2013 at 02:18:26PM +0300, Mikolaj Golub wrote: > I wonder if it fails on current too? It looks this code is not there > any more. I will try. Yes. It crashes on current too. In pfattach(). Also, loading ipfw and ipfw_nat causes panics in ipfw_init() and ipfw_nat_init(). Although this can be easily bandaged with CURVNET_SET(vnet0), it rather reveals problems with these modules. E.g. currently in ipfw_nat_init() we lock virtualized layer3_chain in vnet0 context, I think, to restrict the access to ipfw_nat_*_ptr variables during modification. But the access is not protected from another vnets, which might already exist at the moment when ipfw_nat is loaded. -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 14:46:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A1BB1EE5 for ; Sat, 13 Jul 2013 14:46:21 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ie0-f181.google.com (mail-ie0-f181.google.com [209.85.223.181]) by mx1.freebsd.org (Postfix) with ESMTP id 70C711340 for ; Sat, 13 Jul 2013 14:46:21 +0000 (UTC) Received: by mail-ie0-f181.google.com with SMTP id x12so23015781ief.12 for ; Sat, 13 Jul 2013 07:46:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=iC8/TDAXA2kZulFTaV6u6ARLtSbwIDsTC0oUZicq/RU=; b=XAJL2sgu6XgOFFf6nsUQH23zFnRccq6lkr4qH6VYTAc0B3v4V4clZf1guZlM+H8lda e1M7Q/Gzd23C5SMm81Sa0sySk+8JrJ2kIXFxOKPpj13VQzLrG8HSLc3Ydai0XsNMvA+1 39cARgXXM7mU6TwGRH0nBqIKsYhEiKjxMRSTQLYihZ61LEQ7adWN1vUc0981VDPVbCBY RHM2HksMZD3F/zc0fh8MVxLj6eHPuIIhpSdCGgiBfyuZkYAOadnzg1/3GRCvawcUChsa bf7/xyz8k0Vrg9xXQAXd5rP9NXkaRdzY8bDDTvrjgaRW3DTcj8X5LnzhNqMaJ9AWsjkb 9FSw== X-Received: by 10.50.129.68 with SMTP id nu4mr2998516igb.9.1373726774980; Sat, 13 Jul 2013 07:46:14 -0700 (PDT) Received: from [10.0.0.53] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id ri10sm5781253igc.1.2013.07.13.07.46.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 13 Jul 2013 07:46:14 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Sat, 13 Jul 2013 08:46:10 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201307120803.r6C83ACp016523@svn.freebsd.org> <20130712202710.GB2757@gmail.com> To: Adrian Chadd X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQkerGSLLJpJgevjNA3oEZmfC3kxZ73ITlz960d9kcehWhimAl+CdrDVF9PVKZHX1pXfjpk/ Cc: Craig Rodrigues , src-committers@freebsd.org, svn-src-all@freebsd.org, Marko Zec , Mikolaj Golub , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 14:46:21 -0000 On Jul 12, 2013, at 11:40 PM, Adrian Chadd wrote: > Here's what I have running on my stable/9 VIMAGE laptop. > = http://people.freebsd.org/~adrian/ath/20130712-vimage-default-attach-detac= h.diff > How's this look to put into -HEAD? Apart from the style issues (no space after !), I wonder why newbus = needs this vnet intrusion. Seems like a needless dependency :( Warner From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 15:34:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D8793A3B; Sat, 13 Jul 2013 15:34:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C8F7E1702; Sat, 13 Jul 2013 15:34:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6DFYbRs073869; Sat, 13 Jul 2013 15:34:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6DFYbEr073868; Sat, 13 Jul 2013 15:34:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307131534.r6DFYbEr073868@svn.freebsd.org> From: Alexander Motin Date: Sat, 13 Jul 2013 15:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253323 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 15:34:37 -0000 Author: mav Date: Sat Jul 13 15:34:37 2013 New Revision: 253323 URL: http://svnweb.freebsd.org/changeset/base/253323 Log: When printing opcode description, map T_NODEVICE to Direct Access Device to handle REPORT LUNS, etc. Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Sat Jul 13 13:35:09 2013 (r253322) +++ head/sys/cam/scsi/scsi_all.c Sat Jul 13 15:34:37 2013 (r253323) @@ -665,6 +665,10 @@ scsi_op_desc(u_int16_t opcode, struct sc if (pd_type == T_RBC) pd_type = T_DIRECT; + /* Map NODEVICE to Direct Access Device to handle REPORT LUNS, etc. */ + if (pd_type == T_NODEVICE) + pd_type = T_DIRECT; + opmask = 1 << pd_type; for (j = 0; j < num_tables; j++) { From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 17:44:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2531A7B2; Sat, 13 Jul 2013 17:44:35 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-pb0-x232.google.com (mail-pb0-x232.google.com [IPv6:2607:f8b0:400e:c01::232]) by mx1.freebsd.org (Postfix) with ESMTP id E5E291AA2; Sat, 13 Jul 2013 17:44:34 +0000 (UTC) Received: by mail-pb0-f50.google.com with SMTP id wz7so9887430pbc.23 for ; Sat, 13 Jul 2013 10:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=f8/afkrUHURPIS2dmewcgD4zrAPAMtYSzSOHlLDNNDg=; b=kO2i9g8V0TbAraMYyUdnl/37cUxvfDh1gibLbc7Nog2os2liY+FGeHeLcmgDr9ikUv 7IKLczbPXwzHvBp1LFF/PKLniRWZMPfOf5nl46pIRUVhiRNAPnPQl3t2MMxysuJkkcLj Ky75iuEr6QkXBS9w2BV8maVKyeeJAkGwDcRBNcXrFCL+SzCXkhDYfaZWkHarLPqkWfax PObWJKaeLDMopZzaq6IN7qcu9H8/z/2x6DCyx6WuhttPi6zGbDH3UETMm9rAkApxjfoR tbUlU10ZUo+glXEj2OCIA4hrSVuEkPbra8BsA7dhOntoZNUGuJH+V9kNRPU3/eLLzTOC ZU7A== X-Received: by 10.66.150.9 with SMTP id ue9mr44869603pab.88.1373737474688; Sat, 13 Jul 2013 10:44:34 -0700 (PDT) Received: from localhost (c-67-188-139-74.hsd1.ca.comcast.net. [67.188.139.74]) by mx.google.com with ESMTPSA id ep4sm24161846pbd.35.2013.07.13.10.44.33 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 13 Jul 2013 10:44:33 -0700 (PDT) Sender: Gleb Kurtsou Date: Sat, 13 Jul 2013 10:44:55 -0700 From: Gleb Kurtsou To: "Pedro F. Giffuni" Subject: Re: svn commit: r253276 - head/sys/fs/fuse Message-ID: <20130713174455.GA1108@reks> References: <201307121722.r6CHMxAs083287@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201307121722.r6CHMxAs083287@svn.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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 17:44:35 -0000 On (12/07/2013 17:22), Pedro F. Giffuni wrote: > Author: pfg > Date: Fri Jul 12 17:22:59 2013 > New Revision: 253276 > URL: http://svnweb.freebsd.org/changeset/base/253276 > > Log: > Add creation timestamp (birthtime) support for fuse. > > This is based on similar support in MacFUSE. Looks like it breaks backward compatibility, do we want to preserve it taking into account that there was on fusefs official release as part of base but we had fuse in ports for a while? fusefs-libs seems to have its own version of fuse_kernel.h. There are fuse file system implementations that skip libfuse entirely (glusterfs? I'm not sure). At least we should have bumped fuse version.. Thanks, Gleb. > > Modified: > head/sys/fs/fuse/fuse_internal.h > head/sys/fs/fuse/fuse_kernel.h > > Modified: head/sys/fs/fuse/fuse_internal.h > ============================================================================== > --- head/sys/fs/fuse/fuse_internal.h Fri Jul 12 17:11:30 2013 (r253275) > +++ head/sys/fs/fuse/fuse_internal.h Fri Jul 12 17:22:59 2013 (r253276) > @@ -223,6 +223,8 @@ fuse_internal_attr_fat2vat(struct mount > vap->va_mtime.tv_nsec = fat->mtimensec; > vap->va_ctime.tv_sec = fat->ctime; > vap->va_ctime.tv_nsec = fat->ctimensec; > + vap->va_birthtime.tv_sec = fat->crtime; > + vap->va_birthtime.tv_nsec = fat->crtimensec; > vap->va_blocksize = PAGE_SIZE; > vap->va_type = IFTOVT(fat->mode); > > > Modified: head/sys/fs/fuse/fuse_kernel.h > ============================================================================== > --- head/sys/fs/fuse/fuse_kernel.h Fri Jul 12 17:11:30 2013 (r253275) > +++ head/sys/fs/fuse/fuse_kernel.h Fri Jul 12 17:22:59 2013 (r253276) > @@ -69,9 +69,15 @@ struct fuse_attr { > __u64 atime; > __u64 mtime; > __u64 ctime; > +#ifdef __FreeBSD__ > + __u64 crtime; > +#endif > __u32 atimensec; > __u32 mtimensec; > __u32 ctimensec; > +#ifdef __FreeBSD__ > + __u32 crtimensec; > +#endif > __u32 mode; > __u32 nlink; > __u32 uid; From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 18:04:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 728533AD; Sat, 13 Jul 2013 18:04:24 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com [IPv6:2607:f8b0:4003:c01::230]) by mx1.freebsd.org (Postfix) with ESMTP id 083CF1B35; Sat, 13 Jul 2013 18:04:23 +0000 (UTC) Received: by mail-ob0-f176.google.com with SMTP id v19so12599794obq.35 for ; Sat, 13 Jul 2013 11:04:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=xAvN4OKRc5slSzgTzN7VYGc9qbvCYsxpxL7HgFNaHVY=; b=ytAyReHVUpwD/4e6sZKzTJizDTQVHiWQ9/8vicnLH5wl1e/7KWSSta2CQP1NsqSTQh EGJtimz/6s9YvC/vVhXCwrRFsWK2YLz8Dk4+zHYxYeVr9kcsxFFRcCr9aK3cEKa/b0w8 aSbUz+6jRjcyzfLwzga2PYSJBqHNPC7kCTF2xSMXO9wn9rPb6QJjKDCwGbWzjO1WP7tT mjQK9ewq1iEjxzuRCJxY6FLzm04rQZ5EGI3K33B3wgg+tjzmTbdWbOUZumL8JkJmR638 WQESLa5UT0h+bqU72PUnlMWeK1BdO0eMHkMzslkpJv3ZNygswrEuTU/GgiE5R5w/vSIs CEkg== MIME-Version: 1.0 X-Received: by 10.60.173.169 with SMTP id bl9mr40187951oec.51.1373738663560; Sat, 13 Jul 2013 11:04:23 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.60.161.200 with HTTP; Sat, 13 Jul 2013 11:04:23 -0700 (PDT) In-Reply-To: <20130713141802.GG2757@gmail.com> References: <201307120803.r6C83ACp016523@svn.freebsd.org> <20130712202710.GB2757@gmail.com> <20130713073118.GC2757@gmail.com> <20130713111825.GE2757@gmail.com> <20130713141802.GG2757@gmail.com> Date: Sat, 13 Jul 2013 11:04:23 -0700 X-Google-Sender-Auth: XpaXy--kSg3Rx_U4b2nEhsYRCKs Message-ID: Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt From: Craig Rodrigues To: Mikolaj Golub Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Adrian Chadd , src-committers@freebsd.org, Marko Zec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 18:04:24 -0000 On Sat, Jul 13, 2013 at 7:18 AM, Mikolaj Golub wrote: > On Sat, Jul 13, 2013 at 02:18:26PM +0300, Mikolaj Golub wrote: > > > I wonder if it fails on current too? It looks this code is not there > > any more. I will try. > > Yes. It crashes on current too. In pfattach(). Also, loading ipfw and > ipfw_nat causes panics in ipfw_init() and ipfw_nat_init(). Although > this can be easily bandaged with CURVNET_SET(vnet0), it rather reveals > problems with these modules. > Can you try this combination of patches: (1) Combine Adrian and Marko's patches, but omit Marko's changes to kldload/kldunload: http://people.freebsd.org/~rodrigc/vnet-patch-adrian+marko.txt (2) Revert my Bluetooth patch: http://people.freebsd.org/~rodrigc/patch-revert-GRN-253255.txt This combination of patches work for me: -> Bluetooth works with ng_ubt driver -> Wireless with iwn driver -> PF works I don't have a USB Ethernet device to test. -- Craig From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 18:09:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B21985F9; Sat, 13 Jul 2013 18:09:43 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 944781B67; Sat, 13 Jul 2013 18:09:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6DI9h92099887; Sat, 13 Jul 2013 18:09:43 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6DI9hsk099878; Sat, 13 Jul 2013 18:09:43 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201307131809.r6DI9hsk099878@svn.freebsd.org> From: Kirk McKusick Date: Sat, 13 Jul 2013 18:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r253324 - stable/9/sys/ufs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 18:09:43 -0000 Author: mckusick Date: Sat Jul 13 18:09:42 2013 New Revision: 253324 URL: http://svnweb.freebsd.org/changeset/base/253324 Log: MFC of 252527: Make better use of metadata area by avoiding using it for data blocks that no should no longer immediately follow their indirect blocks. Reviewed by: Bruce Evans Approved by: re (marius@) Modified: stable/9/sys/ufs/ffs/ffs_alloc.c stable/9/sys/ufs/ffs/ffs_balloc.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_alloc.c Sat Jul 13 15:34:37 2013 (r253323) +++ stable/9/sys/ufs/ffs/ffs_alloc.c Sat Jul 13 18:09:42 2013 (r253324) @@ -1709,7 +1709,7 @@ ffs_alloccgblk(ip, bp, bpref, size) cgp = (struct cg *)bp->b_data; blksfree = cg_blksfree(cgp); if (bpref == 0) { - bpref = cgp->cg_rotor; + bpref = cgbase(fs, cgp->cg_cgx) + cgp->cg_rotor + fs->fs_frag; } else if ((cgbpref = dtog(fs, bpref)) != cgp->cg_cgx) { /* map bpref to correct zone in this cg */ if (bpref < cgdata(fs, cgbpref)) Modified: stable/9/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_balloc.c Sat Jul 13 15:34:37 2013 (r253323) +++ stable/9/sys/ufs/ffs/ffs_balloc.c Sat Jul 13 18:09:42 2013 (r253324) @@ -299,6 +299,10 @@ retry: continue; } UFS_LOCK(ump); + /* + * If parent indirect has just been allocated, try to cluster + * immediately following it. + */ if (pref == 0) pref = ffs_blkpref_ufs1(ip, lbn, i - num - 1, (ufs1_daddr_t *)0); @@ -368,7 +372,14 @@ retry: */ if (nb == 0) { UFS_LOCK(ump); - if (pref == 0) + /* + * If allocating metadata at the front of the cylinder + * group and parent indirect block has just been allocated, + * then cluster next to it if it is the first indirect in + * the file. Otherwise it has been allocated in the metadata + * area, so we want to find our own place out in the data area. + */ + if (pref == 0 || (lbn > NDADDR && fs->fs_metaspace != 0)) pref = ffs_blkpref_ufs1(ip, lbn, indirs[i].in_off, &bap[0]); error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, @@ -850,6 +861,10 @@ retry: continue; } UFS_LOCK(ump); + /* + * If parent indirect has just been allocated, try to cluster + * immediately following it. + */ if (pref == 0) pref = ffs_blkpref_ufs2(ip, lbn, i - num - 1, (ufs2_daddr_t *)0); @@ -920,7 +935,14 @@ retry: */ if (nb == 0) { UFS_LOCK(ump); - if (pref == 0) + /* + * If allocating metadata at the front of the cylinder + * group and parent indirect block has just been allocated, + * then cluster next to it if it is the first indirect in + * the file. Otherwise it has been allocated in the metadata + * area, so we want to find our own place out in the data area. + */ + if (pref == 0 || (lbn > NDADDR && fs->fs_metaspace != 0)) pref = ffs_blkpref_ufs2(ip, lbn, indirs[i].in_off, &bap[0]); error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 18:34:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 258ADCED; Sat, 13 Jul 2013 18:34:02 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-lb0-x236.google.com (mail-lb0-x236.google.com [IPv6:2a00:1450:4010:c04::236]) by mx1.freebsd.org (Postfix) with ESMTP id D294D1C38; Sat, 13 Jul 2013 18:34:00 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id r11so8461710lbv.13 for ; Sat, 13 Jul 2013 11:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=9ntxM2iTFFhuvinuR4rwUGJcJ3yNYFNnzgAVIKFf/Cg=; b=L4PK65Bkn4ON9zc8d8OQcBq1JvDYk+zUz6JKOaapB3l3xX5ftlMql8FMSXtg18oQKf n9716JwP9bDY8wsXw2xsChozaZvYHUL5Vt31Naqavj19vqA2J7VPqbvro70qyCPMGgcP B2jZv/tg3Z6y7r8iqcqH0PfkaZmj7/WxoCqScLfW5r/WzhGS6ViHWRo3rAgSBoQG2hqx 1fqeGC6L0XIQi7ASqLFbNcAuyW6TUWz6cUNwB8LmVde7yIyB1FYyc2Hb88D4BH95rdwl PQC+5EUhlvmXq6a1P/pKLgT3IoEY8r+v/uqU9FBf51X0uE6J0FX86FBZcZ/vKTLvaQ3f 1JwA== X-Received: by 10.112.11.162 with SMTP id r2mr21415316lbb.41.1373740439724; Sat, 13 Jul 2013 11:33:59 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id am8sm16369489lac.1.2013.07.13.11.33.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 13 Jul 2013 11:33:58 -0700 (PDT) Sender: Mikolaj Golub Date: Sat, 13 Jul 2013 21:33:56 +0300 From: Mikolaj Golub To: Craig Rodrigues Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt Message-ID: <20130713183354.GA2832@gmail.com> References: <20130712202710.GB2757@gmail.com> <20130713073118.GC2757@gmail.com> <20130713111825.GE2757@gmail.com> <20130713141802.GG2757@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Adrian Chadd , src-committers@freebsd.org, Marko Zec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 18:34:02 -0000 On Sat, Jul 13, 2013 at 11:04:23AM -0700, Craig Rodrigues wrote: > Can you try this combination of patches: > > (1) Combine Adrian and Marko's patches, but omit Marko's changes to > kldload/kldunload: > > http://people.freebsd.org/~rodrigc/vnet-patch-adrian+marko.txt > > (2) Revert my Bluetooth patch: > > http://people.freebsd.org/~rodrigc/patch-revert-GRN-253255.txt Currently I don't have any pluggable device so my testing would not be very useful. I tried Marko's patch to test kldload/kldunload change, which is not in your patch. Concerning your combined patch, as I said previously I don't like very much that dance with is_default_vnet. What is a purpose of it? As for me, it only makes the code less readable. I would just set curvnet to vnet0, as it is in Marko's patch. -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 18:47:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4076AFD0 for ; Sat, 13 Jul 2013 18:47:05 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm13-vm3.bullet.mail.ne1.yahoo.com (nm13-vm3.bullet.mail.ne1.yahoo.com [98.138.91.143]) by mx1.freebsd.org (Postfix) with ESMTP id 127D61C93 for ; Sat, 13 Jul 2013 18:47:05 +0000 (UTC) Received: from [98.138.90.51] by nm13.bullet.mail.ne1.yahoo.com with NNFMP; 13 Jul 2013 18:46:58 -0000 Received: from [98.138.226.133] by tm4.bullet.mail.ne1.yahoo.com with NNFMP; 13 Jul 2013 18:46:58 -0000 Received: from [127.0.0.1] by smtp220.mail.ne1.yahoo.com with NNFMP; 13 Jul 2013 18:46:58 -0000 X-Yahoo-Newman-Id: 464791.48610.bm@smtp220.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 85Ozn3sVM1lTqkDvN_LrCSSvdewt3SwZT8uILUgY5rvk19e xk7u9yA4DdQ8QC7ezLkrU0dBSNOOnv_3.j7Qof5dNjHJXf3R7iOvVQSx_5ZE z4rBlqSKOi67HjIJoksclg10k2OyzOmj_g3MF4h2sYBtFzp58WMCC8.OoXDf 3ULP6_pj2eYsaVIZlyWqhXcHzMO9a8JIYsa9q1BAeTyu6DfAcxwQOiH_Z6rE rtQX8EXIqV5GBKW35EaGgyXCZRWCOlevmrlQSY6NY.KztffB4E6atLSS6qCp DzxIHX2q2isZ1sn0uOwfa1j1wTn5fdn5j_kJlP1xO2AS0v2t2Lqr8HmsZ8JT .WXHKUBWd19pdoicPLLy64DhJUqcNjvjxDYJadH0YwxcHRMtvYC5al_Xjwil xMfkE5EBPO2eciaUx_HvlrwUqFFdPxNMy6TEX6eZRj9OPK.npVcGGOEkMA0N pX3pFjelZaRb.tUeQVwaZfgrAYWMcIxIDimEsSIsu05KL67MsI5jD4p_BM1i zzw_WQsbqaXYNv2FvyuvI7WxfpcPN2nyguAVhRNpEsOVngIMW.EmHc58SMdv tz2l0SS_aClwXeTfhFERmtJtxQ54L1.K5qGGe0yQJrgIv2yBl4vrE0fqxlP. KVAVdYlawGHdDFqhFSRCkqFqi7cUfppAOy1Eqh9vPLgAr8GoJyvJcVM0Xo9K 1fpl6QXHKtrURmV_ZhGjr.J_nqrR2pR0NsTKNkrEJ1dIjdim7ym7Z X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with ) by smtp220.mail.ne1.yahoo.com with SMTP; 13 Jul 2013 11:46:58 -0700 PDT Message-ID: <51E1A09F.2060701@FreeBSD.org> Date: Sat, 13 Jul 2013 13:46:55 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130630 Thunderbird/17.0.7 MIME-Version: 1.0 To: Gleb Kurtsou Subject: Re: svn commit: r253276 - head/sys/fs/fuse References: <201307121722.r6CHMxAs083287@svn.freebsd.org> <20130713174455.GA1108@reks> In-Reply-To: <20130713174455.GA1108@reks> Content-Type: multipart/mixed; boundary="------------090907020501030505050307" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 18:47:05 -0000 This is a multi-part message in MIME format. --------------090907020501030505050307 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 13.07.2013 12:44, Gleb Kurtsou wrote: > On (12/07/2013 17:22), Pedro F. Giffuni wrote: >> Author: pfg >> Date: Fri Jul 12 17:22:59 2013 >> New Revision: 253276 >> URL: http://svnweb.freebsd.org/changeset/base/253276 >> >> Log: >> Add creation timestamp (birthtime) support for fuse. >> >> This is based on similar support in MacFUSE. > Looks like it breaks backward compatibility, do we want to preserve it > taking into account that there was on fusefs official release as part of > base but we had fuse in ports for a while? It's not really a compatibility issue, It's just a field that remains unused on most fuse implementations. For all purposes our upstream seems to be macfuse: http://code.google.com/p/macfuse/source/detail?spec=svn1686&r=1360 > fusefs-libs seems to have its own version of fuse_kernel.h. That's bad, but not really under our control. > There are fuse file system implementations that skip libfuse entirely > (glusterfs? I'm not sure). > > At least we should have bumped fuse version. Make no illusions; we have no control over what the version numbers actually mean, and the API has become dangerously linux dependent. We could apply the attached patch but I wonder if it makes any sense since we don't support the changes. Pedro. --------------090907020501030505050307 Content-Type: text/plain; charset=UTF-8; name="patch-fuse-7.9" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="patch-fuse-7.9" SW5kZXg6IGZzL2Z1c2UvZnVzZV9rZXJuZWwuaAo9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBmcy9mdXNl L2Z1c2Vfa2VybmVsLmgJKHJldmlzaW9uIDI1MzI3NikKKysrIGZzL2Z1c2UvZnVzZV9rZXJu ZWwuaAkod29ya2luZyBjb3B5KQpAQCAtMzQsNiArMzQsMTkgQEAKICAqICRGcmVlQlNEJAog ICovCiAKKy8qCisgKiBUaGlzIGZpbGUgZGVmaW5lcyB0aGUga2VybmVsIGludGVyZmFjZSBv ZiBGVVNFCisgKgorICogUHJvdG9jb2wgY2hhbmdlbG9nOgorICoKKyAqIDcuOToKKyAqICAt IG5ldyBmdXNlX2dldGF0dHJfaW4gaW5wdXQgYXJndW1lbnQgb2YgR0VUQVRUUgorICogIC0g YWRkIGxrX2ZsYWdzIGluIGZ1c2VfbGtfaW4KKyAqICAtIGFkZCBsb2NrX293bmVyIGZpZWxk IHRvIGZ1c2Vfc2V0YXR0cl9pbiwgZnVzZV9yZWFkX2luIGFuZCBmdXNlX3dyaXRlX2luCisg KiAgLSBhZGQgYmxrc2l6ZSBmaWVsZCB0byBmdXNlX2F0dHIKKyAqICAtIGFkZCBmaWxlIGZs YWdzIGZpZWxkIHRvIGZ1c2VfcmVhZF9pbiBhbmQgZnVzZV93cml0ZV9pbgorICovCisKICNp Zm5kZWYgbGludXgKICNpbmNsdWRlIDxzeXMvdHlwZXMuaD4KICNkZWZpbmUgX191NjQgdWlu dDY0X3QKQEAgLTQ4LDcgKzYxLDcgQEAKICNkZWZpbmUgRlVTRV9LRVJORUxfVkVSU0lPTiA3 CiAKIC8qKiBNaW5vciB2ZXJzaW9uIG51bWJlciBvZiB0aGlzIGludGVyZmFjZSAqLwotI2Rl ZmluZSBGVVNFX0tFUk5FTF9NSU5PUl9WRVJTSU9OIDgKKyNkZWZpbmUgRlVTRV9LRVJORUxf TUlOT1JfVkVSU0lPTiA5CiAKIC8qKiBUaGUgbm9kZSBJRCBvZiB0aGUgcm9vdCBpbm9kZSAq LwogI2RlZmluZSBGVVNFX1JPT1RfSUQgMQpAQCAtNzAsMTkgKzgzLDIxIEBACiAJX191NjQJ bXRpbWU7CiAJX191NjQJY3RpbWU7CiAjaWZkZWYgX19GcmVlQlNEX18KLQlfX3U2NAljcnRp bWU7CisJX191NjQgICBjcnRpbWU7CiAjZW5kaWYKIAlfX3UzMglhdGltZW5zZWM7CiAJX191 MzIJbXRpbWVuc2VjOwogCV9fdTMyCWN0aW1lbnNlYzsKICNpZmRlZiBfX0ZyZWVCU0RfXwot CV9fdTMyCWNydGltZW5zZWM7CisJX191MzIgICBjcnRpbWVuc2VjOwogI2VuZGlmCiAJX191 MzIJbW9kZTsKIAlfX3UzMglubGluazsKIAlfX3UzMgl1aWQ7CiAJX191MzIJZ2lkOwogCV9f dTMyCXJkZXY7CisJX191MzIJYmxrc2l6ZTsKKwlfX3UzMglwYWRkaW5nOwogfTsKIAogc3Ry dWN0IGZ1c2Vfa3N0YXRmcyB7CkBAIC0xMTUsNiArMTMwLDkgQEAKICNkZWZpbmUgRkFUVFJf QVRJTUUJKDEgPDwgNCkKICNkZWZpbmUgRkFUVFJfTVRJTUUJKDEgPDwgNSkKICNkZWZpbmUg RkFUVFJfRkgJKDEgPDwgNikKKyNkZWZpbmUgRkFUVFJfQVRJTUVfTk9XCSgxIDw8IDcpCisj ZGVmaW5lIEZBVFRSX01USU1FX05PVwkoMSA8PCA4KQorI2RlZmluZSBGQVRUUl9MT0NLT1dO RVIJKDEgPDwgOSkKIAogLyoqCiAgKiBGbGFncyByZXR1cm5lZCBieSB0aGUgT1BFTiByZXF1 ZXN0CkBAIC0xMzAsMTIgKzE0OCwzOSBAQAogICovCiAjZGVmaW5lIEZVU0VfQVNZTkNfUkVB RAkJKDEgPDwgMCkKICNkZWZpbmUgRlVTRV9QT1NJWF9MT0NLUwkoMSA8PCAxKQorI2RlZmlu ZSBGVVNFX0ZJTEVfT1BTCQkoMSA8PCAyKQorI2RlZmluZSBGVVNFX0FUT01JQ19PX1RSVU5D CSgxIDw8IDMpCisjZGVmaW5lIEZVU0VfQklHX1dSSVRFUwkJKDEgPDwgNSkKIAogLyoqCiAg KiBSZWxlYXNlIGZsYWdzCiAgKi8KICNkZWZpbmUgRlVTRV9SRUxFQVNFX0ZMVVNICSgxIDw8 IDApCiAKKy8qKgorICogR2V0YXR0ciBmbGFncworICovCisjZGVmaW5lIEZVU0VfR0VUQVRU Ul9GSAkJKDEgPDwgMCkKKworLyoqCisgKiBMb2NrIGZsYWdzCisgKi8KKyNkZWZpbmUgRlVT RV9MS19GTE9DSwkJKDEgPDwgMCkKKworLyoqCisgKiBXUklURSBmbGFncworICoKKyAqIEZV U0VfV1JJVEVfQ0FDSEU6IGRlbGF5ZWQgd3JpdGUgZnJvbSBwYWdlIGNhY2hlLCBmaWxlIGhh bmRsZSBpcyBndWVzc2VkCisgKiBGVVNFX1dSSVRFX0xPQ0tPV05FUjogbG9ja19vd25lciBm aWVsZCBpcyB2YWxpZAorICovCisjZGVmaW5lIEZVU0VfV1JJVEVfQ0FDSEUJKDEgPDwgMCkK KyNkZWZpbmUgRlVTRV9XUklURV9MT0NLT1dORVIJKDEgPDwgMSkKKworLyoqCisgKiBSZWFk IGZsYWdzCisgKi8KKyNkZWZpbmUgRlVTRV9SRUFEX0xPQ0tPV05FUgkoMSA8PCAxKQorCiBl bnVtIGZ1c2Vfb3Bjb2RlIHsKIAlGVVNFX0xPT0tVUAkgICA9IDEsCiAJRlVTRV9GT1JHRVQJ ICAgPSAyLCAgLyogbm8gcmVwbHkgKi8KQEAgLTE3OCw2ICsyMjMsOCBAQAogLyogVGhlIHJl YWQgYnVmZmVyIGlzIHJlcXVpcmVkIHRvIGJlIGF0IGxlYXN0IDhrLCBidXQgbWF5IGJlIG11 Y2ggbGFyZ2VyICovCiAjZGVmaW5lIEZVU0VfTUlOX1JFQURfQlVGRkVSIDgxOTIKIAorI2Rl ZmluZSBGVVNFX0NPTVBBVF9FTlRSWV9PVVRfU0laRSAxMjAKKwogc3RydWN0IGZ1c2VfZW50 cnlfb3V0IHsKIAlfX3U2NAlub2RlaWQ7CQkvKiBJbm9kZSBJRCAqLwogCV9fdTY0CWdlbmVy YXRpb247CS8qIElub2RlIGdlbmVyYXRpb246IG5vZGVpZDpnZW4gbXVzdApAQCAtMTkzLDYg KzI0MCwxNCBAQAogCV9fdTY0CW5sb29rdXA7CiB9OwogCitzdHJ1Y3QgZnVzZV9nZXRhdHRy X2luIHsKKwlfX3UzMglnZXRhdHRyX2ZsYWdzOworCV9fdTMyCWR1bW15OworCV9fdTY0CWZo OworfTsKKworI2RlZmluZSBGVVNFX0NPTVBBVF9BVFRSX09VVF9TSVpFIDk2CisKIHN0cnVj dCBmdXNlX2F0dHJfb3V0IHsKIAlfX3U2NAlhdHRyX3ZhbGlkOwkvKiBDYWNoZSB0aW1lb3V0 IGZvciB0aGUgYXR0cmlidXRlcyAqLwogCV9fdTMyCWF0dHJfdmFsaWRfbnNlYzsKQEAgLTIw MCw2ICsyNTUsMTEgQEAKIAlzdHJ1Y3QgZnVzZV9hdHRyIGF0dHI7CiB9OwogCitzdHJ1Y3Qg ZnVzZV9ta25vZF9pbiB7CisJX191MzIJbW9kZTsKKwlfX3UzMglyZGV2OworfTsKKwogc3Ry dWN0IGZ1c2VfbWtkaXJfaW4gewogCV9fdTMyCW1vZGU7CiAJX191MzIJcGFkZGluZzsKQEAg LTIxOCw3ICsyNzgsNyBAQAogCV9fdTMyCXBhZGRpbmc7CiAJX191NjQJZmg7CiAJX191NjQJ c2l6ZTsKLQlfX3U2NAl1bnVzZWQxOworCV9fdTY0CWxvY2tfb3duZXI7CiAJX191NjQJYXRp bWU7CiAJX191NjQJbXRpbWU7CiAJX191NjQJdW51c2VkMjsKQEAgLTI2MSwxNCArMzIxLDIy IEBACiAJX191NjQJZmg7CiAJX191NjQJb2Zmc2V0OwogCV9fdTMyCXNpemU7CisJX191MzIJ cmVhZF9mbGFnczsKKwlfX3U2NAlsb2NrX293bmVyOworCV9fdTMyCWZsYWdzOwogCV9fdTMy CXBhZGRpbmc7CiB9OwogCisjZGVmaW5lIEZVU0VfQ09NUEFUX1dSSVRFX0lOX1NJWkUgMjQK Kwogc3RydWN0IGZ1c2Vfd3JpdGVfaW4gewogCV9fdTY0CWZoOwogCV9fdTY0CW9mZnNldDsK IAlfX3UzMglzaXplOwogCV9fdTMyCXdyaXRlX2ZsYWdzOworCV9fdTY0CWxvY2tfb3duZXI7 CisJX191MzIJZmxhZ3M7CisJX191MzIJcGFkZGluZzsKIH07CiAKIHN0cnVjdCBmdXNlX3dy aXRlX291dCB7CkBAIC0zMDcsNiArMzc1LDggQEAKIAlfX3U2NAlmaDsKIAlfX3U2NAlvd25l cjsKIAlzdHJ1Y3QgZnVzZV9maWxlX2xvY2sgbGs7CisJX191MzIJbGtfZmxhZ3M7CisJX191 MzIJcGFkZGluZzsKIH07CiAKIHN0cnVjdCBmdXNlX2xrX291dCB7Cg== --------------090907020501030505050307-- From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 19:32:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 808976BB; Sat, 13 Jul 2013 19:32:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 731641DC9; Sat, 13 Jul 2013 19:32:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6DJWp95011006; Sat, 13 Jul 2013 19:32:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6DJWpAS011005; Sat, 13 Jul 2013 19:32:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307131932.r6DJWpAS011005@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Jul 2013 19:32:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253325 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 19:32:51 -0000 Author: kib Date: Sat Jul 13 19:32:50 2013 New Revision: 253325 URL: http://svnweb.freebsd.org/changeset/base/253325 Log: Allow to call clock_gettime() on the clock id for zombie process. Reported by: Petr Salinger PR: threads/180496 Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_time.c Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Sat Jul 13 18:09:42 2013 (r253324) +++ head/sys/kern/kern_time.c Sat Jul 13 19:32:50 2013 (r253325) @@ -297,14 +297,9 @@ get_cputime(struct thread *td, clockid_t PROC_UNLOCK(td2->td_proc); } else { pid = clock_id & CPUCLOCK_ID_MASK; - p2 = pfind(pid); - if (p2 == NULL) - return (EINVAL); - error = p_cansee(td, p2); - if (error) { - PROC_UNLOCK(p2); + error = pget(pid, PGET_CANSEE, &p2); + if (error != 0) return (EINVAL); - } get_process_cputime(p2, ats); PROC_UNLOCK(p2); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 19:34:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 266CE812; Sat, 13 Jul 2013 19:34:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 190E81DDD; Sat, 13 Jul 2013 19:34:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6DJYYsx011283; Sat, 13 Jul 2013 19:34:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6DJYYw1011282; Sat, 13 Jul 2013 19:34:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307131934.r6DJYYw1011282@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Jul 2013 19:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253326 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 19:34:35 -0000 Author: kib Date: Sat Jul 13 19:34:34 2013 New Revision: 253326 URL: http://svnweb.freebsd.org/changeset/base/253326 Log: There is no need to count waiters for the runningbufspace. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sat Jul 13 19:32:50 2013 (r253325) +++ head/sys/kern/vfs_bio.c Sat Jul 13 19:34:34 2013 (r253326) @@ -561,7 +561,7 @@ waitrunningbufspace(void) mtx_lock(&rbreqlock); while (runningbufspace > hirunningspace) { - ++runningbufreq; + runningbufreq = 1; msleep(&runningbufreq, &rbreqlock, PVM, "wdrain", 0); } mtx_unlock(&rbreqlock); From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 19:36:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1A085954; Sat, 13 Jul 2013 19:36:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0C8DE1DE6; Sat, 13 Jul 2013 19:36:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6DJaIAI011535; Sat, 13 Jul 2013 19:36:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6DJaIZa011534; Sat, 13 Jul 2013 19:36:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307131936.r6DJaIZa011534@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Jul 2013 19:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253327 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 19:36:19 -0000 Author: kib Date: Sat Jul 13 19:36:18 2013 New Revision: 253327 URL: http://svnweb.freebsd.org/changeset/base/253327 Log: Assert that runningbufspace does not underflow. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sat Jul 13 19:34:34 2013 (r253326) +++ head/sys/kern/vfs_bio.c Sat Jul 13 19:36:18 2013 (r253327) @@ -474,10 +474,12 @@ runningbufwakeup(struct buf *bp) { long space, bspace; - if (bp->b_runningbufspace == 0) - return; - space = atomic_fetchadd_long(&runningbufspace, -bp->b_runningbufspace); bspace = bp->b_runningbufspace; + if (bspace == 0) + return; + space = atomic_fetchadd_long(&runningbufspace, -bspace); + KASSERT(space >= bspace, ("runningbufspace underflow %ld %ld", + space, bspace)); bp->b_runningbufspace = 0; /* * Only acquire the lock and wakeup on the transition from exceeding From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 19:42:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D4CE1BCE; Sat, 13 Jul 2013 19:42:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C5B711E0B; Sat, 13 Jul 2013 19:42:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6DJgq9R013955; Sat, 13 Jul 2013 19:42:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6DJgq0C013954; Sat, 13 Jul 2013 19:42:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307131942.r6DJgq0C013954@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 13 Jul 2013 19:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253328 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 19:42:52 -0000 Author: kib Date: Sat Jul 13 19:42:52 2013 New Revision: 253328 URL: http://svnweb.freebsd.org/changeset/base/253328 Log: Create a proper stack frame for i386 version of bcopy(), despite the function is leaf. The frame allows ddb to not loose the direct caller of bcopy() in backtrace. Other functions from support.s would benefit from the same change as well, but for now bcopy() is the most frequent offender. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/support.s Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Sat Jul 13 19:36:18 2013 (r253327) +++ head/sys/i386/i386/support.s Sat Jul 13 19:42:52 2013 (r253328) @@ -181,11 +181,13 @@ END(bcopyb) * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800 */ ENTRY(bcopy) + pushl %ebp + movl %esp,%ebp pushl %esi pushl %edi - movl 12(%esp),%esi - movl 16(%esp),%edi - movl 20(%esp),%ecx + movl 8(%ebp),%esi + movl 12(%ebp),%edi + movl 16(%ebp),%ecx movl %edi,%eax subl %esi,%eax @@ -196,12 +198,13 @@ ENTRY(bcopy) cld /* nope, copy forwards */ rep movsl - movl 20(%esp),%ecx + movl 16(%ebp),%ecx andl $3,%ecx /* any bytes left? */ rep movsb popl %edi popl %esi + popl %ebp ret ALIGN_TEXT @@ -214,7 +217,7 @@ ENTRY(bcopy) std rep movsb - movl 20(%esp),%ecx /* copy remainder by 32-bit words */ + movl 16(%ebp),%ecx /* copy remainder by 32-bit words */ shrl $2,%ecx subl $3,%esi subl $3,%edi @@ -223,6 +226,7 @@ ENTRY(bcopy) popl %edi popl %esi cld + popl %ebp ret END(bcopy) From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 19:45:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7F208DE8; Sat, 13 Jul 2013 19:45:15 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-ob0-x231.google.com (mail-ob0-x231.google.com [IPv6:2607:f8b0:4003:c01::231]) by mx1.freebsd.org (Postfix) with ESMTP id 149041E15; Sat, 13 Jul 2013 19:45:15 +0000 (UTC) Received: by mail-ob0-f177.google.com with SMTP id ta17so12474831obb.36 for ; Sat, 13 Jul 2013 12:45:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=C6dburt0aDMtlmRXKORZMh4gQJf8ttE4vTMCDMP2GBw=; b=Q9z7RtWWl6KtcriAq4GIIxXWVAFzKi56h1WOUOHIpOGRfUFo5uLOeGJRqDv85KrTA1 Neeedk0o/lUG2aHaTgjTbkVi3G5LNCgo783lAUdhnAKeJndZ8zgTZwKPDKMQMObIh7Y/ YugPTV3/UipABwxW8fKco0IImagTkbFPz5MHM0qdMd3dZF9Jsu7EPyGwznrt0NyLAJak jo+EtuAwkoxNXoegmC+PgcC60t/g9zz8Q0nkxs0/LEu0y9xzgENqtYDd28T6HADivuvN aLMhGJLqWUDuat+qdxsPEM98Mq+i3otLrfwcBGcpkrWpgd5g90+W4aC4OUr/kqi/UMzw WocQ== MIME-Version: 1.0 X-Received: by 10.182.87.170 with SMTP id az10mr39823287obb.10.1373744713402; Sat, 13 Jul 2013 12:45:13 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.60.161.200 with HTTP; Sat, 13 Jul 2013 12:45:13 -0700 (PDT) In-Reply-To: <20130713183354.GA2832@gmail.com> References: <20130712202710.GB2757@gmail.com> <20130713073118.GC2757@gmail.com> <20130713111825.GE2757@gmail.com> <20130713141802.GG2757@gmail.com> <20130713183354.GA2832@gmail.com> Date: Sat, 13 Jul 2013 12:45:13 -0700 X-Google-Sender-Auth: SCFUEGGHaNEmR9w3Xe3D8blQaDU Message-ID: Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt From: Craig Rodrigues To: Mikolaj Golub Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Adrian Chadd , src-committers@freebsd.org, Marko Zec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 19:45:15 -0000 On Sat, Jul 13, 2013 at 11:33 AM, Mikolaj Golub wrote: > > Currently I don't have any pluggable device so my testing would not be > very useful. I tried Marko's patch to test kldload/kldunload change, > which is not in your patch. OK, just to double check, based on reading your post: http://lists.freebsd.org/pipermail/svn-src-all/2013-July/071848.html , with Marko's kldload/kldunload change, you encountered kernel panics in PF and IPFW? I also encountered kernel panics in PF with that patch. Maybe we can clean up those modules in a separate pass, and apply the kldload/kldunload fix some time in the future. > > > Concerning your combined patch, as I said previously I don't like very > much that dance with is_default_vnet. What is a purpose of it? As for > me, it only makes the code less readable. I would just set curvnet to > vnet0, as it is in Marko's patch. > Fine by me. I have re-rolled my combined patch to remove the is_default_vnet check and go with Marko's code to set curvnet to vnet0: (1) Combine Adrian and Marko's patches, but omit Marko's changes to kldload/kldunload: http://people.freebsd.org/~rodrigc/vnet-patch-adrian+marko-p2.txt (2) Revert my Bluetooth patch: http://people.freebsd.org/~rodrigc/patch-revert-GRN-253255.txt -- Craig From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 19:54:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 90424EF; Sat, 13 Jul 2013 19:54:44 +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 7F2B61E41; Sat, 13 Jul 2013 19:54:43 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmEGADyw4VFR8aPm/2dsb2JhbABagwbCYIEIF3SCIwEBBAFWIgEFCwsOCgkWDwkDAgECASceBg0BBQIBAYgGCrYaj2QHg3gDkA+BLZdtgxQ6 Received: from 230.163-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.163.230]) by relay.skynet.be with ESMTP; 13 Jul 2013 21:54:30 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r6DJsSDs003538; Sat, 13 Jul 2013 21:54:29 +0200 (CEST) (envelope-from tijl@coosemans.org) Message-ID: <51E1B06E.2010300@coosemans.org> Date: Sat, 13 Jul 2013 21:54:22 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130701 Thunderbird/17.0.7 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r253215 - head/lib/msun/src References: <201307111741.r6BHf5gQ060844@svn.freebsd.org> <51DEFEF7.4080709@coosemans.org> <7D521907-4802-4141-9A5E-40EB157A5AEF@FreeBSD.org> <51DF0FA5.4050106@coosemans.org> <51DF14F9.50001@coosemans.org> <20130712180753.E5131@besplex.bde.org> In-Reply-To: <20130712180753.E5131@besplex.bde.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2AURBEBSHXJSPFJCLLSSL" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, David Chisnall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 19:54:44 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2AURBEBSHXJSPFJCLLSSL Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-07-12 11:14, Bruce Evans wrote: > On Thu, 11 Jul 2013, Tijl Coosemans wrote: >> On 2013-07-11 22:03, Tijl Coosemans wrote: >>> On 2013-07-11 21:36, David Chisnall wrote: >>>> On 11 Jul 2013, at 19:52, Tijl Coosemans wrote:= >>>>>> @@ -227,8 +250,6 @@ double expm1(double); >>>>>> double fma(double, double, double); >>>>>> double hypot(double, double); >>>>>> int ilogb(double) __pure2; >>>>>> -int (isinf)(double) __pure2; >>>>>> -int (isnan)(double) __pure2; >>>>> >>>>> I think they should stay for the C90 case. >>>> >>>> That would completely defeat the point of this entire exercise and b= e >>>> redundant unless we aim to support a compiler that only supports C90= >>>> and no GNU extensions, in which case you'll hit errors in cdefs.h, >>>> long before you get to this point in an include. >>> >>> isnan(double) is part of SUSv2. It should be visible when compiling w= ith >>> -D_XOPEN_SOURCE=3D500. I think you need something like this: >>>=20 >>> #if (__BSD_VISIBLE || __XSI_VISIBLE <=3D 500) && __ISO_C_VISIBLE < 19= 99 >>> int isinf(double) __pure2; >>> int isnan(double) __pure2; >>> #endif >> >> Actually this: >> >> #if (__BSD_VISIBLE || (defined(__XSI_VISIBLE) && __XSI_VISIBLE <=3D 50= 0)) >> && __ISO_C_VISIBLE < 1999 >=20 > Remove the __ISO_C_VISIBLE part, since this is not in C90. This also > fixes a style bug (long line). I shouldn't have mentioned C90. What I meant to say is the not-C99-or-higher case which is further restricted by __BSD_VISIBLE and __XSI_VISIBLE, but where the macros aren't defined. These two symbols are the cause for the original problem report about clang's cmath header (in C++11 isnan/isinf are functions returning bool not int). Their visibility had to be constrained somehow and that cascaded into redefining the isnan and isinf macros because they were implemented using these functions. I think completely removing these symbols is wrong however because it breaks the API in the specific case of the #if above. If __ISO_C_VISIBLE < 1999 isn't correct then maybe __cplusplus < 201103L?= > How can that work? Even you forgot to restore the parentheses around > the functions, so the above has syntax errors. The macros aren't there for __ISO_C_VISIBLE < 1999. > I noticed some more problems in the implementation of these macros > and others: > - many or all of the __pure2's in the prototypes are wrong, since even > the classification functions can have side effects for signaling > NaNs. It is impossible to avoid these side effects for extern > functions in some cases, since the ABI gives them. I think static > inline functions must have the same results as extern functions, > so compilers should pessimize inline functions as necessary to > get the same bad results, but compilers don't do that. Apparently, in the 2008 version of IEEE 754 they are considered non-computational and never generate exceptions, even for sNaN. The old IEEE 754-1985 only mentions isfinite and isnan and says implementations may consider them non-arithmetic. > - classification functions are specified to convert to the semantic > type (remove any extra precision or exponent range) before classifyin= g. Yes, it makes the macros more function-like. > For example, if x is a double slightly larger than sqrt(DBL_MAX), and= > if double expressions are evaluated in extra exponent range, then x*x= > is finite with the extra range but infinite in the semantic type. So= > isinf(x*x) is true, and the implementation > #define isinf(x) (fabs(x) =3D=3D INFINITY) is invalid. clang on x86 = gets > __builtin_isinf(x*x) this right as a side effect of its pessimization= > of fabs() to non-inline -- parameter passing to the extern fabs() > converts to the semantic type. Sometimes the arg is known not to hav= e > extra range, so no conversion is needed. If isinf isn't supposed to generate exceptions then it cannot use a floating point comparison either. That would only leave bit operations. > I think C11 has new mistakes for extra precision. It specifies that > return reduces to the semantic type, like the classification macros > are required to do for their arg. clang -std=3Dc11 doesn't implement > this bug for at least: >=20 > #include > double sq(double x) { return (x*x); } > double sq2(double x) { return (fabs(x*x); } >=20 > On i386 without SSE2 (so extra precision), this generates the same code= > as with -std=3Dc99. Squaring x gives extra precision and exponent rang= e. > This is not destroyed on return, so extra precision is not defeated by > writing the squaring operation as a function. fabs() is inlined in bot= h > cases, so it has little effect here (no effect unless x is NaN), but I > think even C99 doesn't permit this. If fabs() were not inline, then > the ABI would force destruction of the extra precision and range when > it is called, and I think C99 requires conversion to the semantic type > for calls. For function parameters both C99 and C11 state that they are converted as if by assignment meaning extra precision should be removed. This is also required by IEEE 754-2008. Both C99 and C11 state that making a function inline suggests calls to the function should be as fast as possible, but I don't think this allows skipping any conversions so even if a function is inlined the compiler should remove extra precision. If a floating point value already has the right precision then assignment and as-if-by-assignment may be seen as copy operations that don't raise any exceptions even for sNaN. I suppose this means math functions must always use each argument in at least one arithmetic operation to trigger sNaNs. For return statements both C99 and C11 state that it's not an assignment. Only if the type of the return expression differs from the return type is the result converted as if by assignment. There's a footnote that says this allows floating point values to be returned with extra precision if there's no conversion. The extra precision can be removed with a cast. IEEE 754-2008 requires that extra precision is removed. Also, fabs is somewhat special. In IEEE 754-1985 it's considered equal to copysign(x, 1.0) which may but doesn't have to raise exceptions even for sNaN. In IEEE 754-2008, operations that only affect the sign, like fabs, don't raise exceptions. ------enig2AURBEBSHXJSPFJCLLSSL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iF4EAREIAAYFAlHhsHQACgkQfoCS2CCgtitQAQD+JsZOKK4gl9sxZg+Yd/rkPw21 7+7O07oJ+IcNPo0VEJUBAIMLkZUomXOFd0te6ScwU3qMi9Zrk5WPOqZZE/zeDXpE =1iBY -----END PGP SIGNATURE----- ------enig2AURBEBSHXJSPFJCLLSSL-- From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 20:27:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3804C6EE; Sat, 13 Jul 2013 20:27:48 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-lb0-x233.google.com (mail-lb0-x233.google.com [IPv6:2a00:1450:4010:c04::233]) by mx1.freebsd.org (Postfix) with ESMTP id E6CF41EE4; Sat, 13 Jul 2013 20:27:46 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id w20so8512786lbh.10 for ; Sat, 13 Jul 2013 13:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=SOhl3HR5RaWQyAodkD7rJ8u6JalJJuUILTV4jJJvv5k=; b=m4S3udELA2SeUOx5y6j1z3b5CxCW91fjnX9jybfjtmv6CYkbb9ebKJQt+DWlLnUxlk YvtOAmRjFN7+nfHN7o7ZVpMvk0et9ddxF5kYjD9dRiQm1VKpvM1w5445wz6zxqS8ne8m Zp+FdOIHTyxcZXURm0EWMxsHbdNoN1YTWgbfsJw55v3PaZK91CMajtRRnnpl7xBhW06e SDG2C3u8k3duDPZlsHyMnbBdxRMHkyiK/mLXslXc3eXBPCvm/8YPHVBiBM1MC2eM9djI jnCb69y0u8JxyybNwQgz+vyDbSRD/40fwjcgfhEG77ql2/1M+d9GAvNJ2/YhxKFdLp7X 0kdw== X-Received: by 10.112.180.164 with SMTP id dp4mr21661574lbc.68.1373747265719; Sat, 13 Jul 2013 13:27:45 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id e5sm15907388lbw.3.2013.07.13.13.27.43 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 13 Jul 2013 13:27:44 -0700 (PDT) Sender: Mikolaj Golub Date: Sat, 13 Jul 2013 23:27:42 +0300 From: Mikolaj Golub To: Craig Rodrigues Subject: Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt Message-ID: <20130713202741.GB2832@gmail.com> References: <20130713073118.GC2757@gmail.com> <20130713111825.GE2757@gmail.com> <20130713141802.GG2757@gmail.com> <20130713183354.GA2832@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Adrian Chadd , src-committers@freebsd.org, Marko Zec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 20:27:48 -0000 On Sat, Jul 13, 2013 at 12:45:13PM -0700, Craig Rodrigues wrote: > OK, just to double check, based on reading your post: > http://lists.freebsd.org/pipermail/svn-src-all/2013-July/071848.html , > with Marko's kldload/kldunload change, you encountered kernel panics in PF > and IPFW? Yes. Also in lagg :( > I also encountered kernel panics in PF with that patch. > Maybe we can clean up those modules in a separate pass, > and apply the kldload/kldunload fix some time in the future. > > > > > > > > Concerning your combined patch, as I said previously I don't like very > > much that dance with is_default_vnet. What is a purpose of it? As for > > me, it only makes the code less readable. I would just set curvnet to > > vnet0, as it is in Marko's patch. > > > > Fine by me. I have re-rolled my combined patch to remove the > is_default_vnet check > and go with Marko's code to set curvnet to vnet0: > > (1) Combine Adrian and Marko's patches, but omit Marko's changes to > kldload/kldunload: > > http://people.freebsd.org/~rodrigc/vnet-patch-adrian+marko-p2.txt > > (2) Revert my Bluetooth patch: > > http://people.freebsd.org/~rodrigc/patch-revert-GRN-253255.txt Thanks. -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 21:24:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CDD7D210; Sat, 13 Jul 2013 21:24:26 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A5F291083; Sat, 13 Jul 2013 21:24:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6DLOQPY073278; Sat, 13 Jul 2013 21:24:26 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6DLOQEX073276; Sat, 13 Jul 2013 21:24:26 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201307132124.r6DLOQEX073276@svn.freebsd.org> From: Matt Jacob Date: Sat, 13 Jul 2013 21:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253330 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 21:24:26 -0000 Author: mjacob Date: Sat Jul 13 21:24:25 2013 New Revision: 253330 URL: http://svnweb.freebsd.org/changeset/base/253330 Log: When fiddling with options of which registers to copy out for a mailbox command and which registers to copy back in when the command completes, the bits being set need to not only specify what bits you want to add from the default from the table but also what bits you want *subtract* (mask) from the default from the table. A failing ISP2200 command pointed this out. Much appreciation to: marius, who persisted and narrowed down what the failure delta was, and shamed me into actually fixing it. MFC after: 1 week Modified: head/sys/dev/isp/isp.c head/sys/dev/isp/ispreg.h Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sat Jul 13 20:56:09 2013 (r253329) +++ head/sys/dev/isp/isp.c Sat Jul 13 21:24:25 2013 (r253330) @@ -2589,7 +2589,7 @@ isp_get_wwn(ispsoftc_t *isp, int chan, i } mbs.param[9] = chan; } else { - mbs.ibits = 3; + mbs.ibitm = 3; mbs.param[1] = loopid << 8; if (nodename) { mbs.param[1] |= 1; @@ -7363,6 +7363,13 @@ isp_mboxcmd(ispsoftc_t *isp, mbreg_t *mb ibits |= mbp->ibits; obits |= mbp->obits; + /* + * Mask any bits that the caller wants us to mask + */ + ibits &= mbp->ibitm; + obits &= mbp->obitm; + + if (ibits == 0 && obits == 0) { mbp->param[0] = MBOX_COMMAND_PARAM_ERROR; isp_prt(isp, ISP_LOGERR, "no parameters for 0x%x", opcode); Modified: head/sys/dev/isp/ispreg.h ============================================================================== --- head/sys/dev/isp/ispreg.h Sat Jul 13 20:56:09 2013 (r253329) +++ head/sys/dev/isp/ispreg.h Sat Jul 13 21:24:25 2013 (r253330) @@ -464,8 +464,10 @@ #define MBCMD_DEFAULT_TIMEOUT 100000 /* 100 ms */ typedef struct { uint16_t param[MAX_MAILBOX]; - uint32_t ibits; - uint32_t obits; + uint32_t ibits; /* bits to add for register copyin */ + uint32_t obits; /* bits to add for register copyout */ + uint32_t ibitm; /* bits to mask for register copyin */ + uint32_t obitm; /* bits to mask for register copyout */ uint32_t lineno : 16, : 12, @@ -475,6 +477,8 @@ typedef struct { } mbreg_t; #define MBSINIT(mbxp, code, loglev, timo) \ ISP_MEMZERO((mbxp), sizeof (mbreg_t)); \ + (mbxp)->ibitm = ~0; \ + (mbxp)->obitm = ~0; \ (mbxp)->param[0] = code; \ (mbxp)->lineno = __LINE__; \ (mbxp)->func = __func__; \ From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 22:06:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 290469F5; Sat, 13 Jul 2013 22:06:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1B39A1181; Sat, 13 Jul 2013 22:06:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6DM6fWe087187; Sat, 13 Jul 2013 22:06:41 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6DM6f8t087186; Sat, 13 Jul 2013 22:06:41 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307132206.r6DM6f8t087186@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 13 Jul 2013 22:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253331 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 22:06:42 -0000 Author: pfg Date: Sat Jul 13 22:06:41 2013 New Revision: 253331 URL: http://svnweb.freebsd.org/changeset/base/253331 Log: Add creation timestamp (birthtime) support for fuse. I was keeping this #ifdef'd for reference with the MacFUSE change[1] but on second thought, this is a FreeBSD-only header so the SVN history should be enough. Add missing padding while here. Reference [1]: http://code.google.com/p/macfuse/source/detail?spec=svn1686&r=1360 Modified: head/sys/fs/fuse/fuse_kernel.h Modified: head/sys/fs/fuse/fuse_kernel.h ============================================================================== --- head/sys/fs/fuse/fuse_kernel.h Sat Jul 13 21:24:25 2013 (r253330) +++ head/sys/fs/fuse/fuse_kernel.h Sat Jul 13 22:06:41 2013 (r253331) @@ -69,20 +69,17 @@ struct fuse_attr { __u64 atime; __u64 mtime; __u64 ctime; -#ifdef __FreeBSD__ __u64 crtime; -#endif __u32 atimensec; __u32 mtimensec; __u32 ctimensec; -#ifdef __FreeBSD__ __u32 crtimensec; -#endif __u32 mode; __u32 nlink; __u32 uid; __u32 gid; __u32 rdev; + __u32 padding; }; struct fuse_kstatfs { From owner-svn-src-all@FreeBSD.ORG Sat Jul 13 22:39:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1E908FB4; Sat, 13 Jul 2013 22:39:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E9D79124E; Sat, 13 Jul 2013 22:39:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6DMduQY098701; Sat, 13 Jul 2013 22:39:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6DMduZn098699; Sat, 13 Jul 2013 22:39:56 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201307132239.r6DMduZn098699@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 13 Jul 2013 22:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253332 - head/sys/dev/usb/input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jul 2013 22:39:57 -0000 Author: hselasky Date: Sat Jul 13 22:39:56 2013 New Revision: 253332 URL: http://svnweb.freebsd.org/changeset/base/253332 Log: Allow regular off-the-shelf keyboards to be overclocked like so-called "Gamers Keyboards" by adding a tunable, "hw.usb.ukbd.pollrate", which can fix the polling rate of the attached USB keyboards in the range 1..1000Hz. A similar feature already exists in the USB mouse driver. Use with care! Might leave you without keyboard input. This feature is only available when the USB_DEBUG option is set in the kernel configuration file. Correct "unit" type to "int" while at it. Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Sat Jul 13 22:06:41 2013 (r253331) +++ head/sys/dev/usb/input/ukbd.c Sat Jul 13 22:39:56 2013 (r253332) @@ -92,14 +92,18 @@ __FBSDID("$FreeBSD$"); #ifdef USB_DEBUG static int ukbd_debug = 0; static int ukbd_no_leds = 0; +static int ukbd_pollrate = 0; -static SYSCTL_NODE(_hw_usb, OID_AUTO, ukbd, CTLFLAG_RW, 0, "USB ukbd"); +static SYSCTL_NODE(_hw_usb, OID_AUTO, ukbd, CTLFLAG_RW, 0, "USB keyboard"); SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ukbd_debug, 0, "Debug level"); TUNABLE_INT("hw.usb.ukbd.debug", &ukbd_debug); SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, no_leds, CTLFLAG_RW | CTLFLAG_TUN, &ukbd_no_leds, 0, "Disables setting of keyboard leds"); TUNABLE_INT("hw.usb.ukbd.no_leds", &ukbd_no_leds); +SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, pollrate, CTLFLAG_RW | CTLFLAG_TUN, + &ukbd_pollrate, 0, "Force this polling rate, 1-1000Hz"); +TUNABLE_INT("hw.usb.ukbd.pollrate", &ukbd_pollrate); #endif #define UKBD_EMULATE_ATSCANCODE 1 @@ -1165,13 +1169,15 @@ ukbd_attach(device_t dev) { struct ukbd_softc *sc = device_get_softc(dev); struct usb_attach_arg *uaa = device_get_ivars(dev); - int32_t unit = device_get_unit(dev); + int unit = device_get_unit(dev); keyboard_t *kbd = &sc->sc_kbd; void *hid_ptr = NULL; usb_error_t err; uint16_t n; uint16_t hid_len; - +#ifdef USB_DEBUG + int rate; +#endif UKBD_LOCK_ASSERT(); kbd_init_struct(kbd, UKBD_DRIVER_NAME, KB_OTHER, unit, 0, 0, 0); @@ -1272,6 +1278,19 @@ ukbd_attach(device_t dev) genkbd_diag(kbd, bootverbose); } +#ifdef USB_DEBUG + /* check for polling rate override */ + rate = ukbd_pollrate; + if (rate > 0) { + if (rate > 1000) + rate = 1; + else + rate = 1000 / rate; + + /* set new polling interval in ms */ + usbd_xfer_set_interval(sc->sc_xfer[UKBD_INTR_DT], rate); + } +#endif /* start the keyboard */ usbd_transfer_start(sc->sc_xfer[UKBD_INTR_DT]);